A comprehensive, production-ready restaurant management and online ordering platform. This full-stack application provides seamless ordering experiences for customers while giving restaurant owners powerful tools for operations management, analytics, and business intelligence.
- Node.js 18+
- PostgreSQL database
- Stripe account
# 1. Install dependencies
npm install
# 2. Setup environment variables
cp .env.example .env.local
# Edit .env.local with your database and Stripe keys
# 3. Setup database
npm run db:push
npm run db:seed # Optional: load sample data
# 4. Start development server
npm run devOpen http://localhost:3000 to see the application.
- β User Authentication - Secure signup/signin with email & password
- β Menu Browsing - Browse items by category with detailed descriptions
- β Item Customization - Add options, sizes, toppings with dynamic pricing
- β Shopping Cart - Full cart management with real-time calculations
- β Checkout - Streamlined checkout with delivery info & special notes
- β Multiple Payments - Stripe card payments or Cash on Delivery
- β Order Tracking - Real-time order status updates (PENDING β IN_KITCHEN β READY β COMPLETED)
- β Digital Receipts - Download and print PDF receipts
- β Order History - Complete record of all past orders
- β Real-time KPIs - Today's orders, revenue, AOV, completion time
- β Menu Management - Create/edit categories and items with images
- β Order Management - View, update status, and manage all orders
- β Payment Tracking - Monitor Stripe and COD transactions
- β Expense Tracking - Log expenses by category with receipt storage
- β Advanced Reports - Revenue, profit, and order analytics with CSV export
- β Audit Logs - Full change history for compliance
- β System Settings - Configure restaurant info, taxes, fees, and policies
- β Type-Safe - Full TypeScript implementation
- β
API Documentation - Interactive Swagger/Scalar UI at
/api-docs - β Secure Auth - NextAuth.js with role-based access control
- β Payment Processing - Integrated Stripe with webhooks
- β Database - PostgreSQL with Prisma ORM
- β Responsive UI - Mobile-first design with Tailwind CSS
- β Real-time Updates - React Query for data synchronization
| Category | Technology |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript |
| Styling | Tailwind CSS, Radix UI, Lucide Icons |
| Forms | React Hook Form, Zod validation |
| State | TanStack Query (React Query) |
| Database | PostgreSQL, Prisma ORM |
| Auth | NextAuth.js v4 |
| Payments | Stripe API |
| PDFMake, jsPDF, html2canvas | |
| 3D | Three.js, @react-three/fiber |
| Dev | ESLint, TypeScript Strict Mode |
restaurant-app/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (customer)/ # Customer routes
β β β βββ cart/
β β β βββ checkout/
β β β βββ menu/
β β β βββ orders/
β β β βββ payment/
β β βββ admin/ # Admin dashboard
β β β βββ dashboard/
β β β βββ menu/
β β β βββ orders/
β β β βββ expenses/
β β β βββ reports/
β β β βββ audit/
β β β βββ settings/
β β βββ api/ # RESTful API endpoints
β βββ components/ # React components
β β βββ admin/
β β βββ customer/
β β βββ auth/
β β βββ ui/
β βββ hooks/ # Custom React hooks
β βββ lib/
β β βββ services/ # Business logic
β β βββ validations/ # Zod schemas
β β βββ auth.ts
β βββ types/ # TypeScript types
β βββ contexts/ # React contexts
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Sample data
βββ public/
β βββ openapi.json # API spec
β βββ images/
βββ package.json
npm run dev # Start dev server (http://localhost:3000)
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintnpm run db:generate # Generate Prisma client
npm run db:push # Push schema changes to DB
npm run db:studio # Open Prisma Studio GUI
npm run db:seed # Load sample data
npm run db:reset # Reset DB and reseed (CAUTION!)npm run stripe:listen # Listen for Stripe webhooks locallynpm run clean # Clear build cache
npm run postinstall # Auto-run on npm install- ADMIN - Full system access including dashboard, menu, orders, reports
- STAFF - Limited access (kitchen staff, delivery partners)
- CUSTOMER - Customer ordering functionality only
- π Passwords hashed with bcryptjs
- π Secure session management via NextAuth.js
- π CSRF protection on all forms
- π Role-based access control (RBAC)
- π Input validation with Zod schemas
- π Stripe PCI compliance (no direct card storage)
- Get API keys from Stripe Dashboard
- Set
STRIPE_PUBLIC_KEYandSTRIPE_SECRET_KEYin.env.local - Configure webhook in Stripe Dashboard β Webhooks
- Point webhook to:
https://yourdomain.com/api/stripe/webhook
- Card Payments - Via Stripe for secure online payments
- Cash on Delivery - Traditional payment at delivery
- Refunds - Full refund capability through Stripe
- User - Customers, admins, staff with roles
- Category - Menu categories
- Item - Menu items with pricing
- ItemOptionGroup & ItemOption - Customizations (sizes, toppings, etc.)
- Order - Customer orders with status tracking
- OrderItem & OrderItemOption - Order line items and selections
- Payment - Payment records and transactions
- Coupon - Discount codes and promotions
- Expense - Business expenses by category
- AuditLog - Change tracking for compliance
- Settings - System configuration
See Database Schema Documentation for full details.
- Interactive UI: http://localhost:3000/api-docs
- OpenAPI Spec: http://localhost:3000/public/openapi.json
POST /api/auth/signup - Register new user
POST /api/auth/signin - Login user
POST /api/auth/signout - Logout user
GET /api/menu - Get all menu items
GET /api/menu/[id] - Get item details
GET /api/menu/categories - Get categories
GET /api/cart - Get cart
POST /api/cart/add - Add to cart
DELETE /api/cart/remove - Remove from cart
POST /api/orders - Create order
GET /api/orders - Get order history
GET /api/orders/[id] - Get order details
POST /api/payments/create-intent - Create Stripe payment intent
POST /api/stripe/webhook - Stripe webhook receiver
GET /api/admin/dashboard - Dashboard KPIs
GET /api/admin/orders - All orders
PUT /api/admin/orders/[id] - Update order status
GET /api/admin/reports - Generate reports
GET /api/admin/expenses - Expense list
POST /api/admin/expenses - Create expense
GET /api/admin/audit-logs - Audit trail
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/restaurant_db
# NextAuth.js Authentication
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-random-secret-key
# Stripe Payment Processing
STRIPE_PUBLIC_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=development
# Email (if configured)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-password# Connect your GitHub repository to Vercel
# Automatic deployment on push
# Set environment variables in Vercel dashboard# Build
npm run build
# Set environment variables
export DATABASE_URL=...
export NEXTAUTH_SECRET=...
export STRIPE_SECRET_KEY=...
# Start
npm run start-
Create database model in
prisma/schema.prismanpm run db:push
-
Create API endpoint in
src/app/api/... -
Create custom hook in
src/hooks/ -
Create components in
src/components/ -
Add validation schema in
src/lib/validations/ -
Add types in
src/types/
# Edit schema.prisma
npm run db:push # Apply changes
npm run db:studio # Verify in GUI- π Real-time KPI metrics (orders, revenue, AOV)
- π Payment method breakdown (pie chart)
- π Recent orders feed
- π Daily/weekly/monthly analytics
- π° Revenue and expense tracking
- π― Profit margin calculations
- π Audit trail logging
- βοΈ System settings management
- Visit http://localhost:3000
- Browse menu and add items to cart
- Proceed to checkout
- Use Stripe test card:
4242 4242 4242 4242 - Complete order
- View in admin dashboard at http://localhost:3000/admin
- Login with admin account
- Navigate to Dashboard, Orders, Menu, Reports
- Create/edit menu items
- Update order statuses
- View analytics and reports
- Next.js Documentation
- Prisma Documentation
- NextAuth.js Documentation
- Stripe Documentation
- Tailwind CSS Documentation
- React Hook Form Documentation
# Verify connection string
echo $DATABASE_URL
# Reset database
npm run db:reset# Ensure webhook is running
npm run stripe:listen
# Check webhook signing secret matches
# Dashboard β Developers β Webhooks β Signing secretnpm run clean
npm install
npm run db:generate
npm run buildThis project is provided as-is for restaurant management purposes.
Contributions are welcome! Please feel free to submit pull requests.
For issues and questions, please check the project documentation or create an issue in the repository.
Version: 0.1.0
Last Updated: September 2026
Framework: Next.js 15 + React 19