Skip to content

About

Full-stack campus ordering platform with realtime operations, payments, notifications, authentication, and admin workflows.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Campus Eats

Sreyas Logo

Stars Forks Issues MIT React Express MongoDB Convex

AI-powered, secure, and real-time canteen management for colleges.
Modern, scalable, and open-source. Give us a ⭐ if you like it!


Features

  • Student & Admin authentication (JWT)
  • Browse menu, place orders, live order status
  • QR code for order pickup/verification
  • Admin panel for menu management (Excel upload)
  • Realtime updates & business logic via Convex
  • Responsive UI; works great on mobile

Tech Stack

Frontend: React, React Router, Axios, react-qr-code
Backend: Node.js, Express, MongoDB, Mongoose
Serverless / Realtime: Convex (functions, data, subscriptions)
Auth: JWT, bcryptjs
File Uploads: Multer, Excel import (ExcelJS)

The backend is powered by Express and Convex. No React API is used here; all business logic and data flows are handled server-side.


Architecture

college-canteen-app/
├─ backend/
│  ├─ src/                     # Express API (controllers, routes, models)
│  ├─ convex/                  # Convex functions (serverless)
│  │  ├─ _generated/           # Convex generated types (do not edit)
│  │  ├─ schema.js             # Convex schema
│  │  ├─ auth.js               # Auth helpers (Convex)
│  │  ├─ admin.js              # Admin-side Convex functions
│  │  ├─ menu.js               # Menu queries/mutations
│  │  ├─ orderManagement.js    # Order lifecycle & business logic
│  │  ├─ notifications.js      # Realtime notifications
│  │  ├─ payment.js            # Payment intents & status hooks
│  │  ├─ user.js               # User profile helpers
│  │  ├─ addAdmin.js           # One-off admin seeding script
│  │  ├─ README.md
│  │  └─ tsconfig.json
│  ├─ scripts/                 # Seed/migration utilities
│  └─ package.json
├─ frontend/
│  ├─ src/                     # React app
│  │  ├─ components/           # Reusable UI components
│  │  ├─ pages/                # Page components
│  │  ├─ context/              # React context providers
│  │  ├─ assets/               # Images, screenshots
│  │  └─ convex/               # Convex client integration
│  └─ package.json
└─ README.md

Screenshots

  • Login
    Login Page

  • Register
    Register Page

  • Menu
    Menu Page

  • Sample QR
    Sample QR Code


Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • Convex account & credentials (sign up at convex.dev)
  • Create a Convex project and obtain deployment credentials before forking

1) Clone

git clone <your-repo-url>
cd college-canteen-app

2) Install dependencies

cd backend && npm install
cd ../frontend && npm install

3) Configure environment variables

Copy .env.example to .env in backend and set:

MONGODB_URI=<your-mongodb-uri>
JWT_SECRET=<strong-secret>

For Convex: Run npx convex dev and follow the setup to authenticate with your Convex account and create/link a deployment.

4) Seed (optional, creates an admin & sample data)

cd backend
npm run data:import
# Default admin: admin@canteen.com / Admin@123

5) Run dev servers

# Backend (Convex serverless functions) - this starts everything you need
cd backend
npx convex dev

# Frontend (in a separate terminal)
cd frontend
npm start

Open http://localhost:3000

Note: npx convex dev handles all backend functionality. No separate Express server needed.


Configuration

  • Convex: Make sure your backend/convex/schema.js and functions match your data model. Run npx convex dev from backend if you develop Convex locally.
  • Excel Upload: Admin panel supports menu upload via Excel (see sample in frontend/src/assets if provided).
  • JWT Expiry: Adjust in backend auth middleware as needed.

Scripts

Backend

  • npx convex dev — Start Convex local dev server (serverless functions)
  • npm run data:import — Seed admin & sample data
  • npm run data:destroy — Wipe seeded data (danger!)

Frontend

  • npm start — React dev server
  • npm run build — Production build

Data & Admin

  • Default Admin (after seeding): Email: admin@canteen.com Password: Admin@123

  • QR Codes: Orders include QR payloads; staff can scan to validate pickup.


Backups & Cleanup

  • The codebase has been streamlined to focus on Convex serverless functions and React frontend.
  • All business logic is now centralized in the backend/convex/ folder for better maintainability.
  • Legacy REST API code has been removed in favor of Convex's real-time capabilities.

Development tip: Use orderManagement.js for all order-related business logic. The addAdmin.js script can be run once to seed admin users.


Contributing

We welcome contributions!

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

See CONTRIBUTING.md for guidelines.


License

MIT


Credits

Built for Sreyas Institute of Engineering and Technology.

About

Full-stack campus ordering platform with realtime operations, payments, notifications, authentication, and admin workflows.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages