How iamadityaraj02/quick-bite works
Project Type and Purpose
• Quick Bite is a full-stack, microservices-based QR ordering system using clean architecture.
• It spans multiple frontends (customer, admin, staff, kitchen), a suite of backend services (API Gateway, order processor, notification), shared/domain packages, and AWS infrastructure.
File Structure
• apps/ – Contains Next.js “App Router” frontends:
– web/ (customer site)
– implicitly admin/ and staff/ under web/app (monorepo uses a single Next.js app with route groups)
• packages/ – Monorepo packages:
– core/ (domain entities, use cases, ports)
– shared/ (utilities, types)
– ui/ (reusable React components)
• services/ – Independent Node.js services (Fastify + TS + Zod):
– api-gateway/
– order-processor/
– notification/
• infrastructure/terraform/ – IaC definitions for AWS (RDS, S3, SQS, Lambda, API Gateway, CloudFront).
• docker-compose.yml & Makefile – local development orchestration.
• turbo.json – TurboRepo configuration.
README for Insights
• Confirms Clean Architecture layers: Presentation, Application (use cases/DTOs/validators), Domain (entities/value-objects).
• Lists AWS services and tech stack.
• Describes feature set (QR ordering, real-time updates, RBAC).
Main Components
A. Presentation Layer (Client Apps)
– Customer Web (Next.js @ port 3000)
– Admin Panel (Next.js @ 3001)
– Staff / Kitchen Interfaces (Next.js route groups)
B. API Layer
– API Gateway service (Fastify)
– Auth, menu, orders, admin routes
C. Business Logic Layer (Application & Domain)
– core package (use-cases, entities)
– shared package
D. Backend Services
– Order Processor (consumes new-order events from SQS)
– Notification Service (publishes real-time updates via WebSocket or push)
E. Data Stores & Infrastructure (AWS)
– AWS RDS (PostgreSQL via Drizzle ORM)
– Redis (cache & sessions)
– AWS S3 (file storage)
– AWS SQS (order queue)
– AWS Lambda (serverless deploys)
– AWS API Gateway (managed HTTP endpoint)
– AWS CloudFront (CDN for web assets)
Relationships & Data Flows
1. User → Next.js Frontend → calls API Gateway (HTTPS)
2. API Gateway →
• Drizzle ORM → RDS (Postgres)
• Redis for session/cache
• Publishes order events to SQS
3. Order Processor → pulls from SQS → executes create-order use case → updates DB → publishes status updates
4. Notification Service → subscribes to status events (could be via SNS or direct SQS) → pushes real-time updates to frontends (WebSocket or polling)
5. Admin & Staff UIs → call admin routes on API Gateway → perform CRUD on menu/orders
Architectural Patterns & Principles
• Clean Architecture (layered onion):
– Outer: Presentation (Next.js + React)
– Middle: Application (use cases, DTOs)
– Inner: Domain (entities, value objects)
• Microservices: independent “api-gateway”, “order-processor”, “notification” services
• Monorepo with TurboRepo: shared packages (core, ui, shared)
• Infrastructure as Code: Terraform (infrastructure/terraform)
• CI/CD via Makefile and scripts
Elements
• Clear labels: component name + tech (e.g., “API Gateway (Fastify + TypeScript)”)
Final Touches & Detail
• Call out route handlers in api-gateway (auth, menu, orders, admin).
• Local development stack (Docker Compose) at the bottom, connected to local databases.
• Terraform folder → maps to AWS resources in the cloud group.