This is a Next.js 14 (App Router) application for a food delivery service.
Users can authenticate using Google or a magic link (powered by Brevo), order food, and make secure payments through Stripe.
The app is written in TypeScript with a responsive design using Tailwind CSS.
The backend uses Prisma as the ORM with a PostgreSQL database.
- Prerequisites
- Installation
- Upload Images to Cloudinary
- Set up Prisma & Seed the database
- Running the Development Server
- Building for Production
- Running the Production Server
- Technologies Used
- Live Demo ๐
Before you begin, ensure you have met the following requirements:
- Node.js
- PostgreSQL database provider (e.g., hosted by neon.com)
- Stripe account for payment processing
- Brevo account for magic link authentication
- Cloudinary account for image hosting
- Clone the repository:
git clone [email protected]:SiegfriedBz/next_app__restaurant.git
cd next_app__restaurant
- Install dependencies:
npm install
- Set up environment variables:
Create a .env file in the root directory and add the following environment variables
# Contact Information
PHONE_NUMBER=
MAIL_CONTACT=
# Database Configuration
# PostgreSQL database connection string
DATABASE_URL="postgresql://..."
# NextAuth Configuration
NEXT_PUBLIC_NEXTAUTH_URL=
NEXTAUTH_SECRET=
# NextAuth - Google Provider
# Google OAuth client ID and secret
GOOGLE_CLIENT_ID=
GOOGLE_SECRET_ID=
# Cloudinary Configuration
# Cloudinary cloud name
CLOUDINARY_CLOUD_NAME=
# Cloudinary application name for seeding images
CLOUDINARY_APP_NAME="MyApp"
# Cloudinary API key and secret
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
# Stripe Configuration
# Stripe API keys (get them from https://dashboard.stripe.com/apikeys)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
# Brevo Mail API
# API key for Brevo email service
BREVO_API_KEY=
- Ensure you have images in the
./seed/data/images
folder. - Run the following command to upload the images:
npm run seed:cloudinary
Initialize Prisma:
npx prisma init
Generate Prisma Client:
npx prisma generate
Seed the database:
npm run seed:db
To start the development server, run:
npm run dev
To build the project for production, run:
npm run build
After building the project, you can start the production server with:
npm start
- Framework: React, Next.js 14 (App Router)
- TypeScript: Provides type safety and improved development experience.
- Cloudinary: : Image hosting service.
- react-query: Library for managing server-state in React applications
- Styling: Tailwind CSS, responsive design
- ORM: Prisma
- DB: PostgreSQL
- Authentication: NextAuth.js with Google Provider and Brevo for magic link.
- Stripe
Visit the live demo of MioZio deployed on Vercel PostgreSQL DB hosted on neon.com