Skip to content

About

Campus food delivery PWA for VIT-AP University students — order from campus canteens with real-time order tracking, Firebase Auth, and an admin dashboard. Built with Next.js 16, TypeScript, and Firestore, installable offline on iOS & Android.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

VIT-AP Eats Logo

🍛 VIT-AP Eats

The campus food delivery platform built for VIT-AP University students.

Order from your favourite canteen, track in real-time, straight to your hostel.


Next.js Firebase Vercel TypeScript PWA License


✨ Key Features

Feature Details
🚀 Progressive Web App Installable on iOS & Android, works offline
🔥 Firebase Real-time Firestore onSnapshot for live order tracking
🔐 Firebase Auth Email/Password + Google SSO, role-based routing
👑 Admin Dashboard Full order management with WhatsApp confirmation
🍽️ Menu Management Toggle item availability, grouped by category
📊 Live Analytics Real-time revenue chart and top dishes from Firestore
🛵 Order Tracking Live status updates from restaurant → delivered
💬 WhatsApp Integration One-tap customer chat from admin order view
📱 Responsive Design Mobile-first glassmorphism UI

🏗️ Architecture

┌─────────────────────────────────────────────────────────┐
│                    VITAP Eats Stack                     │
│                                                         │
│  ┌──────────────────────────────────────────────────┐  │
│  │          Next.js 16 (App Router / Turbopack)     │  │
│  │   Deployed on ▲ Vercel (Edge Network)            │  │
│  │                                                  │  │
│  │  ┌─────────────┐  ┌─────────────┐               │  │
│  │  │  Customer   │  │   Admin /   │               │  │
│  │  │    Pages    │  │   Partner   │               │  │
│  │  └──────┬──────┘  └──────┬──────┘               │  │
│  │         │                │                      │  │
│  │         ▼                ▼                      │  │
│  │  ┌─────────────────────────────────────────┐    │  │
│  │  │       Firebase Client SDK (Browser)     │    │  │
│  │  │  ┌────────────┐  ┌────────────────────┐ │    │  │
│  │  │  │  Firebase  │  │  Cloud Firestore   │ │    │  │
│  │  │  │    Auth    │  │  (Real-time DB)    │ │    │  │
│  │  │  └────────────┘  └────────────────────┘ │    │  │
│  │  └─────────────────────────────────────────┘    │  │
│  └──────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘

Data Flow

User Action  →  React Component  →  lib/db/*.ts (Firestore SDK)
                                          │
                     ┌────────────────────┘
                     ▼
              Cloud Firestore
                     │
              onSnapshot listener  →  Real-time UI update

Firestore Collections

Collection Description
users User profiles & roles (customer, partner, admin)
restaurants Restaurant info, hours, cuisine
menu_items Dishes with price, category, availability
orders Order docs with real-time status

🖥️ Pages & Roles

Route Role Description
/ Customer Home: restaurant listing
/restaurant/[slug] Customer Menu, add to cart
/cart Customer Cart review + coupon
/checkout Customer Place order
/order/[id] Customer Live order tracking
/orders Customer Order history
/login, /signup All Firebase Auth
/forgot-password All Password reset email
/admin Admin Orders, Menu, Insights, Users
/partner Partner Delivery dashboard
/partner/earnings Partner Payout history

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Firebase project (Firestore + Authentication enabled)
  • Vercel account (for deployment)
  • Git

1. Clone the Repository

git clone https://github.com/ankit-sengupta05/VIT-AP-Eats.git
cd VIT-AP-Eats/vitap-eats

2. Install Dependencies

npm install

3. Configure Firebase

Create a Firebase project at console.firebase.google.com, then:

  1. Enable Authentication → Email/Password + Google
  2. Enable Firestore Database → Start in production mode
  3. Copy your project config keys

Create .env.local in vitap-eats/:

NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX

4. Firestore Security Rules

In Firebase Console → Firestore → Rules, paste:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    // Users can only read/write their own profile
    match /users/{uid} {
      allow read, write: if request.auth != null && request.auth.uid == uid;
      allow read: if request.auth.token.role == "admin";
    }

    // Restaurants — public read, admin write
    match /restaurants/{id} {
      allow read: if true;
      allow write: if request.auth.token.role == "admin";
    }

    // Menu items — public read, admin/partner write
    match /menu_items/{id} {
      allow read: if true;
      allow write: if request.auth != null;
    }

    // Orders — authenticated users only
    match /orders/{id} {
      allow read: if request.auth != null &&
        (resource.data.userId == request.auth.uid ||
         request.auth.token.role in ["admin", "partner"]);
      allow create: if request.auth != null;
      allow update: if request.auth != null;
    }
  }
}

5. Set Admin Role (Custom Claims)

For the admin panel to work, set a custom claim on your admin user via Firebase Admin SDK or Cloud Functions:

// Run once via Firebase Admin SDK
admin.auth().setCustomUserClaims(adminUid, { role: 'admin' });

6. Run Locally

npm run dev

App runs at http://localhost:3000 🚀


📦 Deployment (Vercel)

The app auto-deploys to Vercel on every push to main via the CI/CD pipeline in .github/workflows/deploy.yml.

Manual Deploy

npm install -g vercel
vercel --prod

Environment Variables on Vercel

Add all NEXT_PUBLIC_FIREBASE_* variables in: Vercel Dashboard → Project → Settings → Environment Variables


📁 Project Structure

vitap-eats/
├── app/
│   ├── (customer)/        # Customer-facing routes
│   │   ├── page.tsx       # Home / restaurant listing
│   │   ├── restaurant/    # Restaurant menu page
│   │   ├── cart/          # Cart & checkout flow
│   │   ├── orders/        # Order history
│   │   └── order/[id]/    # Live order tracking
│   ├── admin/             # Admin dashboard (Orders, Menu, Insights)
│   ├── partner/           # Delivery partner dashboard
│   └── login/signup/      # Auth pages
│
├── lib/
│   ├── firebase.ts        # Firebase app initialization
│   ├── db/
│   │   ├── orders.ts      # Firestore order CRUD + subscriptions
│   │   ├── restaurants.ts # Restaurant + menu queries
│   │   ├── users.ts       # User profile management
│   │   └── items.ts       # Menu item management
│   ├── hooks.ts           # React Query hooks
│   └── store/cart.ts      # Zustand cart store
│
├── components/
│   ├── customer/          # CustomerHeader, RestaurantCard
│   └── ui/                # Reusable UI primitives
│
└── .github/workflows/
    └── deploy.yml         # Vercel CI/CD pipeline

🔧 Scripts

Command Action
npm run dev Start dev server (Turbopack)
npm run build Production build
npm run lint ESLint check

🤝 Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feat/amazing-feature
  3. Commit your changes: git commit -m 'feat: add amazing feature'
  4. Push: git push origin feat/amazing-feature
  5. Open a Pull Request

👨‍💻 Author

Ankit Sengupta GitHub: @ankit-sengupta05


Made with ❤️ for VIT-AP University

⭐ Star this repo if you found it helpful!

About

Campus food delivery PWA for VIT-AP University students — order from campus canteens with real-time order tracking, Firebase Auth, and an admin dashboard. Built with Next.js 16, TypeScript, and Firestore, installable offline on iOS & Android.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages