How ealanisln/ready-set works
Project type and purpose
• This is a full-stack, multi-tenant delivery service web platform built on Next.js.
• It provides both a public “site” for clients, drivers, vendors, and a protected “admin” console; it handles user registration, authentication, dynamic deliveries (same-day, on-demand, catering), file uploads, blog/CMS, payments, and notifications.
File structure
• src/app/
• (site) subtree: all publicly available pages (marketing, auth UI, client/driver/vendor dashboards, order-status, payment, blog).
• (backend) subtree: the Next.js-rendered admin UI under /admin.
• /api/*: Next.js API route handlers for auth, user management, orders, dispatch, file uploads/downloads, form-submissions, subscriptions, etc.
• prisma/: ORM schema and migrations for PostgreSQL.
• sanity/: Headless CMS setup for blog/posts.
• lib/ and utils/: business logic (email, uploads, error handling, notifications).
• scripts/: DB backup & sync tasks.
• stripe/: pricing data for payments.
• Dockerfile, docker-compose.yml: containerization for local/dev environment.
README for additional insights
• Confirms tech stack:
• Frontend & API: Next.js
• Database: PostgreSQL + Prisma
• UI library: Shadcn components
• Highlights features: multi-role user management, varied delivery options, email notifications, blog, payments.
a. Main components
• Client Web App (Next.js React UI for public site)
• Admin Web App (Next.js React UI for staff under /admin)
• Next.js Server (SSR/SSG + API routes)
• PostgreSQL Database via Prisma ORM
• Sanity Headless CMS
• File Storage subsystem (UploadThing or S3 abstraction)
• Email Service (SMTP or external provider)
• Payment Gateway (Stripe)
• Background/cron scripts for DB backup & sync
• External analytics (Google Analytics, MetriCool)
b. Relationships & interactions
• Browsers ⇄ Next.js Frontend
• Frontend UI → Next.js API routes → Prisma → PostgreSQL
• Next.js API routes → Sanity SDK for blog content → Sanity datastore
• Next.js API routes → UploadThing library → file storage
• Next.js API routes → Email service (via lib/email-service)
• Next.js API routes → Stripe (payment intents, webhooks)
• Cron scripts ↔ PostgreSQL for backups/sync
c. Architectural patterns & principles
• Monolithic Next.js app separating site vs. admin via filesystem routing (App Router).
• Layered architecture: UI → API layer → data access (Prisma) → persistence.
• Headless CMS decoupling blog content.
• Infrastructure as code (Docker + Docker Compose).
• Strong type safety (TypeScript throughout).
d. Key technologies/frameworks
• Next.js App Router
• Prisma ORM & migrations
• PostgreSQL
• Sanity (headless CMS)
• UploadThing (file uploads)
• Stripe (payments)
• Shadcn/UI (component library)
Detail
• Every “api/*” group (auth, orders, files, dispatch, form submissions).
• Sanity client under /sanity/lib as part of the CMS integration.
• Scripts container communicating to the same PostgreSQL instance for backups.
• Distinguish between public site traffic and protected admin traffic in the UI layer.
• Where middleware/authMiddleware applies to the API layer.