Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

79 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CampusRun

Intra-Campus Delivery Platform for NIT Kurukshetra

By students, for students β€” Get anything delivered inside campus instantly.

React TypeScript Node.js PostgreSQL Prisma Cloudflare R2 Razorpay MIT License


🧠 What is CampusRun?

CampusRun is a full-stack, peer-to-peer delivery platform built exclusively for students at NIT Kurukshetra. It connects students who need items delivered (Amazon parcels from the gate, groceries from the market, food from shops) with fellow students willing to deliver them β€” all within the campus boundary.

Think of it as Dunzo/Swiggy Genie, but hyper-local to a single college campus, built and run entirely by students.

πŸ’‘ The Problem

  • Walking to the main gate in 45Β°C heat to collect an Amazon parcel
  • No one available to pick up groceries from the campus market
  • No organized, trusted way to get things delivered hostel-to-hostel

βœ… The Solution

CampusRun provides a marketplace where:

  • Customers post delivery requests with pickup/drop details and pricing
  • Deliverers (verified students) accept and fulfill orders
  • Real-time GPS tracking keeps everyone informed
  • In-app chat enables negotiation and coordination
  • UPI payments are handled securely via Razorpay

⚑ Key Features

Feature Description
πŸ” College Email Auth Only @nitkkr.ac.in emails can register, with OTP verification via Brevo + Fast2SMS
πŸ€– AI ID Verification Gemini AI verifies uploaded college ID cards for deliverer authentication
πŸ—ΊοΈ Live GPS Tracking Real-time Leaflet map tracking of deliverers across campus
πŸ’¬ In-App Chat Real-time messaging between customer and deliverer with image sharing
πŸ’³ Razorpay Payments Platform fee collection via Razorpay; deliverer payouts via UPI
πŸ“¦ Smart Pricing Weight-based dynamic pricing with location-aware estimates
☁️ Cloud Storage Document uploads stored on Cloudflare R2 (S3-compatible)
πŸŒ“ Dark/Light Mode System-aware theme with manual toggle
⭐ Rating System Post-delivery rating and feedback for deliverers
πŸ›‘οΈ Security First Helmet, rate limiting, bcrypt, JWT auth, input validation with Zod

πŸ—οΈ Tech Stack

Frontend

Technology Purpose
React 18 + TypeScript UI framework
Vite Build tool & dev server
TailwindCSS Utility-first styling
shadcn/ui + Radix UI Component library
Framer Motion Animations
React Router v6 Client-side routing
TanStack React Query Server state management
Leaflet + React-Leaflet Interactive maps
Zod + React Hook Form Form validation

Backend

Technology Purpose
Node.js + Express API server
TypeScript Type safety
Prisma ORM Database access
PostgreSQL (Neon) Production database
Cloudflare R2 File/document storage
Razorpay SDK Payment processing
Google Gemini AI ID card verification
Brevo + Fast2SMS Email/SMS notifications
Helmet + express-rate-limit Security middleware
bcryptjs + JWT Authentication

πŸ“ Project Structure

campusrun/
β”œβ”€β”€ backend/                   # Express API Server
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── schema.prisma      # Database schema (User, Order, Message, VerificationToken)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.ts           # Server entry point
β”‚   β”‚   β”œβ”€β”€ db.ts              # Prisma client instance
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.routes.ts     # Signup, Login, OTP, Password Reset
β”‚   β”‚   β”‚   β”œβ”€β”€ orders.routes.ts   # CRUD orders, accept, track, rate
β”‚   β”‚   β”‚   └── profile.routes.ts  # Profile view/edit, deliverer verification
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.middleware.ts  # JWT verification guard
β”‚   β”‚   β”‚   └── upload.middleware.ts # Multer + S3/R2 file uploads
β”‚   β”‚   └── utils/
β”‚   β”‚       β”œβ”€β”€ mail.ts            # Gmail SMTP transporter
β”‚   β”‚       └── notifications.ts   # Brevo email + Fast2SMS APIs
β”‚   β”œβ”€β”€ Dockerfile             # Container config for deployment
β”‚   └── .env.example           # Required environment variables
β”‚
β”œβ”€β”€ src/                       # React Frontend
β”‚   β”œβ”€β”€ App.tsx                # Root component with routing
β”‚   β”œβ”€β”€ main.tsx               # Entry point
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Index.tsx          # Landing page / Dashboard
β”‚   β”‚   β”œβ”€β”€ Auth.tsx           # Login, Signup, OTP verification
β”‚   β”‚   β”œβ”€β”€ PlaceOrder.tsx     # Order creation form
β”‚   β”‚   β”œβ”€β”€ Deliver.tsx        # Deliverer marketplace
β”‚   β”‚   β”œβ”€β”€ Track.tsx          # Live order tracking with map
β”‚   β”‚   β”œβ”€β”€ Profile.tsx        # User profile management
β”‚   β”‚   └── NotFound.tsx       # 404 page
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx         # Navigation bar
β”‚   β”‚   β”œβ”€β”€ Footer.tsx         # Footer
β”‚   β”‚   β”œβ”€β”€ Layout.tsx         # Page layout wrapper
β”‚   β”‚   β”œβ”€β”€ OrderChat.tsx      # In-app messaging component
β”‚   β”‚   └── ui/               # shadcn/ui component library
β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   └── AuthContext.tsx    # Authentication state provider
β”‚   └── apiClient.ts          # Axios/fetch API wrapper
β”‚
β”œβ”€β”€ .env.example               # Frontend env template
β”œβ”€β”€ vercel.json                # Vercel SPA rewrite config
β”œβ”€β”€ tailwind.config.ts         # TailwindCSS configuration
β”œβ”€β”€ vite.config.ts             # Vite build configuration
└── package.json               # Frontend dependencies

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 18.x
  • npm β‰₯ 9.x
  • PostgreSQL database (or a free Neon account)
  • Cloudflare R2 bucket (optional, falls back to local disk)

1. Clone the repository

git clone https://github.com/codexbeats/CampusRun---NIT-KKR.git
cd CampusRun---NIT-KKR

2. Setup Backend

cd backend
npm install
cp .env.example .env
# Fill in your environment variables in .env
npx prisma db push    # Create database tables
npm run dev            # Starts on http://localhost:4000

3. Setup Frontend

# From root directory
npm install
cp .env.example .env
# Verify VITE_API_URL points to your backend
npm run dev            # Starts on http://localhost:5173

4. Open in Browser

Navigate to http://localhost:5173 β€” you should see the CampusRun landing page!


πŸ”Œ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/signup Register with college email
POST /api/auth/login Login with credentials
POST /api/auth/send-verification-otps Send email + phone OTPs
POST /api/auth/verify-otps Verify email + phone OTPs
POST /api/auth/forgot-password Request password reset OTP
POST /api/auth/verify-reset-otp Verify reset OTP
POST /api/auth/reset-password Reset password with OTP

Orders

Method Endpoint Description
POST /api/orders Create a new delivery order
GET /api/orders List all available orders
GET /api/orders/my Get user's own orders
POST /api/orders/:id/accept Accept a delivery request
PATCH /api/orders/:id/status Update order status
PATCH /api/orders/:id/location Update deliverer GPS location
POST /api/orders/:id/rate Rate a completed delivery

Profile

Method Endpoint Description
GET /api/profile Get current user profile
PATCH /api/profile Update profile details
POST /api/profile/verify-deliverer Upload ID for AI verification

🀝 Contributing

We welcome contributions! Whether it's bug fixes, new features, or documentation improvements β€” every contribution counts.

Please read our Contributing Guide before submitting a PR.

Quick Start for Contributors

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

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘€ Author

Built with ❀️ by @codexbeats at NIT Kurukshetra.


⚑ CampusRun β€” Delivery, Reimagined for Campus Life

Releases

Packages

Contributors

Languages