Full-stack bakery ordering platform with a Next.js frontend, FastAPI backend, PostgreSQL database, admin dashboard, and Dockerized local deployment.
- Displays active bakery products with product detail pages and customer reviews.
- Supports customer cart and checkout flow for standard product orders.
- Supports custom order submissions (cakes / basque cheesecakes) with delivery or pickup details.
- Validates delivery distance through Google Distance Matrix API for delivery orders.
- Sends contact/custom-order notification emails to admin via SMTP.
- Provides admin authentication (email/password from env), admin session cookie, and protected admin APIs.
- Provides admin CRUD for products, order listing, and simple analytics (total orders + total sales).
- Syncs Clerk user lifecycle events via signed Clerk webhook (
user.created,user.updated,user.deleted).
- Stripe or any live payment gateway integration.
- AI chatbot backend integration (frontend chatbot is a demo UI response only).
- Dedicated delivery checker utility/service modules (
backend/app/utils/delivery_checker.pyand service placeholders are empty). - Complete backend test suite for orders/payments (
backend/tests/test_orders.pyandbackend/tests/test_payments.pyare empty).
- Frontend: Next.js 15 (App Router), React 18, TypeScript, Tailwind CSS, Clerk, Framer Motion
- Backend: FastAPI, SQLAlchemy (async), Alembic, PostgreSQL, Pydantic Settings
- Infra: Docker, Docker Compose, Nginx reverse proxy, Render config
- Integrations: Clerk webhooks (Svix signature verification), Google Distance Matrix API, SMTP email (aiosmtplib)
backend/
app/
api/ # Admin + public API routers
core/ # Config + DB session setup
models/ # SQLAlchemy models
schemas/ # Pydantic schemas
utils/ # Email helper + placeholders
alembic/ # DB migrations
frontend/
src/app/ # App Router pages/components
infra/
nginx/nginx.conf # Reverse proxy config
render/render.yaml # Render backend deploy spec
docker-compose*.yml # Local/dev/prod compose variants
- Health
GET /api/health
- Public/customer
GET /api/productsGET /api/products/{product_id}POST /api/ordersPOST /api/custom-ordersGET /api/custom-ordersPOST /api/reviews/uploadPOST /api/reviews/product/{product_id}GET /api/reviews/product/{product_id}POST /api/contact
- Admin (cookie-auth protected except login/logout)
POST /api/admin/loginPOST /api/admin/logoutGET /api/admin/helloGET /api/admin/productsGET /api/admin/products/{product_id}POST /api/admin/productsPUT /api/admin/products/{product_id}DELETE /api/admin/products/{product_id}POST /api/admin/products/uploadGET /api/admin/ordersGET /api/admin/orders/{order_id}POST /api/admin/ordersDELETE /api/admin/orders/{order_id}GET /api/admin/analytics
- Webhooks
POST /webhooks/clerk
products: catalog items with slug, inventory, active/featured flags, timestampsorders+order_items: standard checkout orders and line itemscustom_orders: custom cake/cheesecake request detailsreviews: product reviews with optional uploaded imageusers: Clerk-linked user profiles + admin flag
Use the provided examples:
backend/.env.examplefrontend/.env.example
Important backend variables:
DATABASE_URLSECRET_KEYADMIN_EMAILADMIN_PASSWORDCLERK_SIGNING_SECRETGOOGLE_MAPS_API_KEYSMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,ADMIN_RECEIVER_EMAILCORS_ORIGINS
Important frontend variables:
NEXT_PUBLIC_API_URLNEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEY
- Create env files:
backend/.envfrontend/.env.local
- From repository root:
docker compose -f docker-compose.dev.yml up --build- Services:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:8000 - Nginx:
http://localhost:80
- Frontend:
Backend:
cd backend
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Frontend:
cd frontend
npm install
npm run devinfra/render/render.yamldefines backend deployment on Render with Alembic migration on startup.- Root compose files include dev/prod variants and Nginx reverse proxy setup.
- GitHub workflow (
.github/workflows/deploy.yml) currently installs backend dependencies on push tomain.
- Existing webhook tests:
backend/tests/test_clerk_webhook.py - Placeholder/empty tests:
backend/tests/test_orders.pybackend/tests/test_payments.py