Skip to content

Instantly share code, notes, and snippets.

@risuvoo
Last active March 5, 2026 07:12
Show Gist options
  • Select an option

  • Save risuvoo/ab0c4d65f4c81c673627ddbd79ee37a5 to your computer and use it in GitHub Desktop.

Select an option

Save risuvoo/ab0c4d65f4c81c673627ddbd79ee37a5 to your computer and use it in GitHub Desktop.
Interact With Agent

✅ Done

(Completed features will appear here.)


🔄 In Progress

(Keep the one you are building here now)


Feature List

Authentication

  • Register
  • Login
  • Get current user

Users

  • Create user
  • User profile management
  • User role (customer / provider / admin)

Providers

  • Provider profile
  • Get all providers
  • Get provider details with menu

Categories

  • Create category
  • Get categories
  • Update category
  • Delete category

Meals

  • Create meal
  • Update meal
  • Delete meal
  • Get all meals
  • Get meal details
  • Filter meals (cuisine, dietary preference, price)

Cart

  • Add meal to cart
  • View cart
  • Remove meal from cart

Orders

  • Create order
  • Get customer orders
  • Get order details
  • Track order status

Order Status

  • PLACED
  • PREPARING
  • READY
  • DELIVERED
  • CANCELLED

Reviews

  • Create review
  • Get meal reviews

Provider Orders

  • View incoming orders
  • Update order status

Admin

  • Get all users
  • Update user status (suspend / activate)
  • View all orders
  • Manage categories

Pages & Routes

⚠️ Note: These routes are examples. You may add, edit, or remove routes based on your
implementation needs. All images should be optional, but if a person need image, only allow url
string.

Public Routes

Route Page Description
/ Home Hero, categories, featured
/meals Browse Meals List with filters
/meals/:id Meal Details Info, add to cart
/providers/:id Provider Menu, info
/login Login Login form
/register Register Registration form

Customer Routes (Private)

Route Page Description
/cart Cart View cart items
/checkout Checkout Delivery address
/orders My Orders Order history
/orders/:id Order Details Items, status
/profile Profile Edit info

Provider Routes (Private)

Route Page Description
/provider/dashboard Dashboard Orders, stats
/provider/menu Menu Manage meals
/provider/orders Orders Update status

Admin Routes (Private)

Route Page Description
/admin Dashboard Statistics
/admin/users Users Manage users
/admin/orders Orders All orders
/admin/categories Categories Manage categories

Database Tables

Design schema for the following tables:

● Users - Store user information and authentication details
● ProviderProfiles - Provider/restaurant-specific information (linked to Users)
● Categories - Food categories (cuisine types)
● Meals - Menu items offered by providers
● Orders - Customer orders with items and status
● Reviews - Customer reviews for meals

💡 Think about what fields each table needs based on the features above.

API Endpoints

⚠️ Note: These endpoints are examples. You may add, edit, or remove endpoints based on
your implementation needs.

Authentication

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login user
GET /api/auth/me Get current user

Meals & Providers (Public)

Method Endpoint Description
GET /api/meals Get all meals with filters
GET /api/meals/:id Get meal details
GET /api/providers Get all providers
GET /api/providers/:id Get provider with menu

Orders

Method Endpoint Description
POST /api/orders Create new order
GET /api/orders Get user's orders
GET /api/orders/:id Get order details

Provider Management

Method Endpoint Description
POST /api/provider/meals Add meal to menu
PUT /api/provider/meals/:id Update meal
DELETE /api/provider/meals/:id Remove meal
PATCH /api/provider/orders/:id Update order status

Admin

Method Endpoint Description
GET /api/admin/users Get all users
PATCH /api/admin/users/:id Update user status

Project Overview

FoodHub is a full-stack web application for meal ordering. Customers can browse menus from various food providers, place orders, and track delivery status. Providers can manage their menus and fulfill orders. Admins oversee the platform and manage all users.

Tech Stack

  • Framework: Node.js + Express (REST API)
  • Database: Postgres + Prisma
  • Language: Typescript
  • Authentication: better-auth
  • Email: nodemailer
  • Validation: Yup

Environment Variables (.env)

DATABASE_URL=
PORT=
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=
APP_URL=
SMTP_USER=
SMTP_PASS=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

Roles

  • Role 1: Customer Description: Users who order meals Permission: Browse menus, place orders, track status, leave reviews
  • Role 2: Provider Description: Food vendors/restaurant Permission: Manage menu, view orders, update order status
  • Role 3: Admin Description: Platform moderators Permission: Manage all users, oversee orders, moderate content
  • Role Note: Users select their role during registration. Admin accounts should be seeded in the database.

Feature Requirements

Public Features:
● Browse all available meals and providers
● Filter meals by cuisine, dietary preferences, and price
● View provider profiles with menus

Customer Features:
● Register and login as customer
● Add meals to cart
● Place orders with delivery address (Cash on Delivery)
● Track order status
● Leave reviews after ordering
● Manage profile

Provider Features:
● Register and login as provider
● Add, edit, and remove menu items
● View incoming orders
● Update order status

Admin Features:
● View all users (customers and providers)
● Manage user status (suspend/activate)
● View all orders
● Manage categories

Important Notes (Image)

  • Only allow image fields as URL strings (no file uploads)

GitHub Commit Types (Conventional Commits)

feat(Scope): Add a new feature to the project. fix(Scope): Fix a bug in the code. chore: Maintenance tasks that do not affect application functionality. docs: Changes related to documentation only. style: Code style changes (formatting, spaces, semicolons). No logic change. refactor(Scope): Rewrite or improve code without changing functionality. perf(Scope): Performance improvements. test(Scope): Add or update tests. build: Changes affecting build system or dependencies. ci: Changes related to CI/CD pipelines. revert: Revert a previous commit.

FoodHub — Progress Log


Log

[Date: 05/03/2024]

Done today:

Next session:


Current Blockers

  • No blocker yet

Questions to Resolve

  • No question and query yet

Before Writing Code

  1. Always read docs/instructions.md for project conventions
  2. Always check docs/features.md to understand what's done and what's next
  3. Follow my another example project (example-project) folder Structure Strictly
  4. Understand the feature requirements before starting implementation
  5. Check existing modules to avoid duplicate logic
  6. Ensure the feature follows the project architecture and coding standards

Convention

  • Module Pattern
  • files and folder lowercase
  • functions and variable camelCase
  • Types/Interfaces: PascalCase with I prefix for interfaces (e.g., IPost)
  • Modules Files Name Pattern example.model.ts, example.service.ts, example.controller.ts, example.route.ts
  • Keep controller, service, route, validation, and types separated
  • Avoid writing business logic inside controllers
  • Use clear and descriptive naming for modules and files

While Coding

  • Use TypeScript always — no plain .js files
  • file, folder, variable and function should be meaningful name
  • Follow module-based structure strictly
  • Controllers should only handle request and response
  • All business logic must be inside service layer
  • Use Yup for request validation
  • Validate request body, params, and query before processing
  • Use Prisma Client for all database operations
  • Avoid raw SQL queries unless absolutely necessary
  • Implement proper error handling using centralized error handler
  • Keep functions small and reusable
  • Avoid code duplication
  • Use async/await instead of promise chains
  • Use consistent API response structure
  • Add comments when logic is complex

Testing

  • Test every API endpoint after implementation
  • Test success and failure cases
  • Verify validation errors work correctly
  • Check role-based access for protected routes
  • Ensure database operations behave correctly
  • Confirm API response structure is consistent

After Completion

  • Ensure the feature works end-to-end
  • Verify all validations are applied
  • Confirm role permissions are enforced properly
  • Update docs/features.md to mark the feature as completed
  • Mark it as with - [x] in docs/features.md
  • Remove any unused code
  • Ensure code follows naming conventions
  • Run the project and confirm there are no TypeScript errors
  • Test the API once again before considering the task complete
  • Every Single API need github commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment