How rumi-13/feasty works
1. System shape
- Feasty is a two-tier MERN application: a Node/Express backend exposes REST APIs, and a React/Vite frontend renders the user experience.
- The domain is centered on short food reels with two roles: regular users and food partners.
2. Backend runtime and entry points
- backend/server.js is the process entry point, and backend/src/app.js likely assembles the Express app.
- The backend is organized by classic Express layers: routes → controllers → models/middleware/services.
3. API boundary and request flow
- Route files under backend/src/routes define the public API surface:
- auth.routes.js
- food.routes.js
- food-partner.routes.js
- Incoming requests are handled by controllers in backend/src/controllers, keeping transport concerns separated from business logic.
4. Authentication and access control
- backend/src/controllers/auth.controller.js and backend/src/middlewares/auth.middleware.js indicate JWT-based login and authorization.
- The middleware is the key security boundary for protecting role-specific endpoints, especially around partner content creation and user-only actions like saving or liking.
5. Data model layer
- MongoDB access is abstracted through Mongoose models in backend/src/models.
- The model set shows the core domain entities:
- user.model.js
- foodpartner.model.js
- food.model.js
- like.model.js
- save.model.js
- This suggests the backend stores both identity/role data and reel interaction state separately.
6. Media handling and external storage
- backend/src/services/storage.service.js is a dedicated integration boundary for media storage.
- Combined with the README, the system relies on ImageKit for video delivery, transformation, and thumbnail/poster generation rather than serving raw media from the app server.
7. Backend functional domains
- food.controller.js and food-partner.controller.js indicate a split between:
- partner-facing content management
- general food reel retrieval and interaction
- The backend likely orchestrates content upload, listing, and engagement events such as likes and saves.
8. Frontend application shell
- The frontend is a Vite-powered React app with its own routing and styling pipeline.
- frontend/src/main.jsx bootstraps the app, App.jsx is the top-level component, and routes/AppRoutes.jsx handles page-level navigation.
9. Frontend page structure
- The UI is organized by user journey:
- pages/auth/* for login/register flows
- pages/general/* for landing and welcome screens
- pages/food-partner/* for partner onboarding/profile/content creation
- pages/components/* for reel playback and saved-content views
- This mirrors the backend role split and makes the architecture role-driven rather than purely feature-driven.
10. Frontend-to-backend communication
- frontend/src/utils/axios.js centralizes HTTP requests, so API calls likely share a common base URL and auth header behavior.
- That utility is the main boundary between the React UI and Express API.
11. Reel/feed experience
- The README describes a reel engine with preloading, sticky caching, autoplay, and buffering management.
- In architecture terms, the frontend reel components are responsible for the high-performance playback experience, while the backend mainly supplies metadata and media URLs.
12. Data flow summary
- A typical flow is:
- user or partner authenticates
- JWT is issued and reused in API calls
- partner uploads or manages food reels
- backend stores metadata in MongoDB and media in ImageKit
- frontend fetches reel data, renders the feed, and tracks like/save interactions
- This creates a clean separation between identity, content metadata, engagement state, and media delivery.
13. Practical diagram boundaries
- For an architecture diagram, the main boxes are:
- React frontend
- Express API
- MongoDB/Mongoose data layer
- ImageKit media/CDN service
- The most important arrows are auth, reel retrieval, upload/media delivery, and engagement updates.
Main entry points: food.controller.js Food logic · AppRoutes.jsx UI routes · db.js MongoDB · routes Routes
Components 28
Backend
Express API, domain logic, and MongoDB data access
- Server · Process entry point that starts the API
backend/server.js - App setup · Assembles middleware, routes, and runtime configuration
backend/src/app.js - Routes · Public REST surface for auth, food, and partner actions
backend/src/routes - Auth API · Login and registration endpoints
backend/src/routes/auth.routes.js - Food API · Reel and engagement endpoints
backend/src/routes/food.routes.js - Partner API · Food partner endpoints for content management
backend/src/routes/food-partner.routes.js - Controllers · HTTP handlers that coordinate business actions
backend/src/controllers - Auth logic · Authentication and token issuance
backend/src/controllers/auth.controller.js - Food logic · Reel retrieval and engagement actions
backend/src/controllers/food.controller.js - Partner logic · Partner onboarding and reel creation workflows
backend/src/controllers/food-partner.controller.js - Auth guard · JWT-based access control for protected routes
backend/src/middlewares/auth.middleware.js - Models · Core domain entities persisted in MongoDB
backend/src/models - Food reel · Food reel metadata and content records
backend/src/models/food.model.js - Food partner · Partner account and profile records
backend/src/models/foodpartner.model.js - User · Regular user account records
backend/src/models/user.model.js - Likes · Per-user like state for reels
backend/src/models/like.model.js - Saves · Per-user saved reel state
backend/src/models/save.model.js
Frontend
React/Vite app for user and partner journeys
- Main · Frontend bootstrap entry point
frontend/src/main.jsx - App shell · Top-level React component and layout composition
frontend/src/App.jsx - UI routes · Page-level navigation and protected route structure
frontend/src/routes/AppRoutes.jsx - API client · Shared Axios configuration for backend requests
frontend/src/utils/axios.js - Auth pages · Login and registration screens for both roles
frontend/src/pages/auth - Landing pages · Welcome and home screens
frontend/src/pages/general - Partner pages · Partner onboarding, profile, and content creation screens
frontend/src/pages/food-partner - Reel views · Feed playback and saved reel views
frontend/src/pages/components
External services
Infrastructure and third-party media delivery
- Media store · Integration boundary for uploading and serving video assets
backend/src/services/storage.service.js - MongoDB · Backend database connection and persistence layer
backend/src/db/db.js - ImageKit · External media delivery, transformation, and thumbnail generation
Connections 35
- Server → App setup: starts · Process entry initializes the Express application
- App setup → Routes: mounts · App registers the API route modules
- Routes → Auth API: includes · Authentication endpoints
- Routes → Food API: includes · Food reel and engagement endpoints
- Routes → Partner API: includes · Partner-specific endpoints
- Auth API → Auth logic: delegates · Auth requests are handled by controller logic
- Food API → Food logic: delegates · Food requests are handled by controller logic
- Partner API → Partner logic: delegates · Partner requests are handled by controller logic
- Auth API → Auth guard: protects · Protected auth-adjacent flows use access control
- Food API → Auth guard: protects · Engagement and user actions are guarded
- Partner API → Auth guard: protects · Partner actions require authorization
- Auth logic → User: reads/writes · Creates and authenticates users
- Partner logic → Food partner: reads/writes · Manages partner account data
- Food logic → Food reel: reads/writes · Fetches and updates reel records
- Food logic → Likes: tracks · Persists like state
- Food logic → Saves: tracks · Persists saved reel state
- Partner logic → Food reel: creates · Creates food reel metadata
- Food reel → MongoDB: persists · Mongoose models store data in MongoDB
- Food partner → MongoDB: persists · Mongoose models store data in MongoDB
- User → MongoDB: persists · Mongoose models store data in MongoDB
- Likes → MongoDB: persists · Mongoose models store data in MongoDB
- Saves → MongoDB: persists · Mongoose models store data in MongoDB
- Partner logic → Media store: uploads media · Partner workflows send assets to the storage boundary
- Media store → ImageKit: delivers · Media is hosted and transformed by ImageKit
- Main → App shell: boots · Main entry renders the application shell
- App shell → UI routes: uses · Shell delegates page selection to route config
- UI routes → Auth pages: shows · Authentication screens
- UI routes → Landing pages: shows · Landing and welcome screens
- UI routes → Partner pages: shows · Partner onboarding and creation screens
- UI routes → Reel views: shows · Reel playback and saved content screens
- Auth pages → API client: calls · Auth screens call the shared API client
- Partner pages → API client: calls · Partner screens call the shared API client
- Reel views → API client: calls · Reel views load and update content through the API client
- API client → App setup: requests · Frontend communicates with the Express API
- Food logic → ImageKit: references media · Food payloads include externally hosted media URLs