A TypeScript-based REST API for FarmRPG with monorepo architecture using Bun workspaces.
- Item Management - Buy/sell items with automatic 200 cap handling
- Inventory Tracking - Category-based inventory with filtering support
- Fishing System - Catch fish and track bait/stamina
- Player Stats - Silver/gold balance tracking
- Smart Cap Handling - Automatic inventory cap detection and management
- React 19 - Modern UI with shadcn/ui components
- Responsive Design - TailwindCSS styling
- API Integration - Seamless backend communication
farmrpg/
├── apps/
│ ├── client/ # React + Vite frontend
│ ├── server/ # Hono + Bun API backend
│ └── DEVELOPMENT.md # Development guide
├── package.json # Workspaces configuration
└── README.md
apps/server/src/
├── controllers/ # Request handlers
├── models/ # TypeScript interfaces
├── routes/ # API routes
├── services/ # Business logic
└── utils/ # Helpers & constants
bun installRun both client and server:
bun run devRun client only:
bun run dev:clientRun server only:
bun run dev:serverBuild client:
bun run buildRun server:
bun run startGET /api/player/stats- Get silver/gold balance
GET /api/inventory- Get all inventory categories with statsGET /api/inventory?category=fish- Get specific categoryGET /api/inventory?category=fish,crops- Get multiple categories (comma-separated)
Categories: items, fish, crops, seeds, loot, runestones, books, cards, rares
GET /api/item/:id- Get item details including price and inventoryPOST /api/item/buy- Buy items (automatically respects 200 cap)POST /api/item/sell- Sell specific item by ID and quantityPOST /api/item/sell-all- Sell all items or filter by category
POST /api/fish/catch- Catch fish at a location{ "locationId": 1, "baitAmount": 1 }GET /api/fish/bait?locationId=1- Get bait info (count, streak, best streak)
- React 19 - UI framework
- Vite - Build tool
- TailwindCSS - Styling
- shadcn/ui - Component library
- Bun - Runtime
- Hono - Web framework
- TypeScript - Type safety
- Cheerio - HTML parsing
- Bun Workspaces - Monorepo
- MVC Pattern - Backend structure
- Dependency Injection - Shared services
- ✅ Environment variables for credentials
- ✅
.envexcluded from git - ✅ Input validation on all endpoints
- ✅ No hardcoded secrets
- Server API Docs - Detailed API documentation
- MVC Architecture - Backend architecture patterns
- ✅ TypeScript throughout
- ✅ MVC architecture
- ✅ Dependency injection
- ✅ Constants extraction
- ✅ DRY principles
- ✅ Consistent error handling
Built with ❤️ using Bun and TypeScript