A modern food delivery platform built with Next.js 15, featuring restaurant menus, shopping cart functionality, and order management.
- Restaurant Discovery: Browse available restaurants with their details
- Menu Management: View restaurant menus organized by categories
- Shopping Cart: Add/remove products, adjust quantities, and manage cart state
- Order Processing: Complete orders with customer information and consumption method
- Order Tracking: View order history and status by CPF (Brazilian ID)
- Responsive Design: Mobile-first approach with modern UI components
- Consumption Methods: Choose between Takeaway and Dine-in options
- Customer Information: Collect name and CPF for order tracking
- Order Status: Track orders through PENDING → IN_PREPARATION → FINISHED states
- Real-time Updates: Automatic page revalidation after order creation
- Next.js 15 - React framework with App Router
- React 19 - Latest React version with modern features
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Beautiful icon library
- Prisma - Type-safe database ORM
- PostgreSQL - Relational database
- Next.js Server Actions - Server-side operations
- React Context - Cart state management
- React Hook Form - Form handling and validation
- Zod - Schema validation
- React Number Format - Input formatting
- Class Variance Authority - Component variant management
- Tailwind Merge - Utility class merging
- Vaul - Drawer component library
- Sonner - Toast notifications
- ESLint - Code linting
- Prettier - Code formatting
- PostCSS - CSS processing
The application uses a relational database with the following main entities:
- Restaurant: Basic restaurant information (name, slug, description, images)
- MenuCategory: Food categories for organizing products
- Product: Individual menu items with pricing and ingredients
- Order: Customer orders with status tracking
- OrderProduct: Junction table for order-product relationships
- Node.js 18+
- PostgreSQL database
- Git
-
Clone the repository
git clone <repository-url> cd fsw-delivery
-
Install dependencies
npm install # or pnpm install
-
Environment Setup Create a
.env
file with your database connection:DATABASE_URL="postgresql://username:password@localhost:5432/fsw_delivery"
-
Database Setup
# Generate Prisma client npx prisma generate # Run migrations npx prisma migrate dev # Seed database (optional) npx prisma db seed
-
Start Development Server
npm run dev # or pnpm dev
Open http://localhost:3000 in your browser.
src/
├── app/ # Next.js App Router
│ ├── [slug]/ # Dynamic restaurant routes
│ │ ├── menu/ # Restaurant menu pages
│ │ ├── orders/ # Order management
│ │ └── components/ # Restaurant-specific components
│ ├── components/ # Shared UI components
│ ├── data/ # Data fetching functions
│ ├── helpers/ # Utility functions (CPF validation, etc.)
│ └── lib/ # Database and utility configurations
npm run dev
- Start development servernpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLintnpm run postinstall
- Generate Prisma clientpnpm dev
- Start development serverpnpm build
- Build for productionpnpm start
- Start production serverpnpm lint
- Run ESLintpnpm postinstall
- Generate Prisma client
- Context-based state management
- Add/remove products
- Quantity adjustment
- Real-time total calculation
- Server actions for order creation
- CPF validation and formatting
- Order status tracking
- Consumption method selection
- Prisma ORM for type-safe queries
- Cascade deletion for data integrity
- Efficient relationship queries
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Giovanni Cruz - CRZ Web
Made with ❤️ by CRZ