IITKart is a comprehensive campus e-commerce and delivery platform designed to connect Customers, Vendors, and Riders (Delivery Partners) within the campus ecosystem. It features real-time order tracking, email OTP verification, and a dedicated Super Admin dashboard.
- Frontend: React, Vite, TypeScript, Tailwind CSS
- Backend: Node.js, Express.js, TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT & Email OTP Verification (Nodemailer)
Follow these steps to get the project running locally on your system.
- Node.js (v16 or higher)
- PostgreSQL (Running locally or via a cloud provider like Supabase/Neon)
- Git
git clone <repository-url>
cd IITKartNavigate to the backend directory:
cd Backend1
npm installAssuming you have PostgreSQL installed natively on your system, you can instantly create the required database by logging into the PostgreSQL terminal.
Open your system terminal and log into the Postgres prompt:
psql postgresOnce inside the postgres=# prompt, paste and execute these specific SQL commands:
CREATE USER postgres WITH PASSWORD 'postgres';
CREATE DATABASE iitkart;
GRANT ALL PRIVILEGES ON DATABASE iitkart TO postgres;
\qNote: Depending on your OS schema, you might need to use
sudo -u postgres psqlto access the terminal initially. If you don't wish to install Postgres locally, a free cloud database URI from Neon.tech acts identically.
Create a .env file inside the Backend1 directory and add the following:
# Server
PORT=5001
NODE_ENV="development"
# Database (From Step 3.1)
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/iitkart?schema=public"
# Authentication
JWT_SECRET="your-super-secret-jwt-key-at-least-64-chars"
JWT_EXPIRES_IN="7d"
REFRESH_TOKEN_SECRET="your-super-secret-refresh-token-key-at-least-32-chars"
REFRESH_TOKEN_EXPIRES_IN="30d"
#Server
FRONTEND_URL="http://localhost:5173"
# Razorpay (For Payment Gateway Testing)
RAZORPAY_KEY_ID="rzp_test_SVxBVQr7WSDn2H"
RAZORPAY_KEY_SECRET="mLgswSvPia09zuHiYctH3VCb"
# Email / OTP Verification (Nodemailer)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-16-letter-google-app-password"
FROM_EMAIL="your-email@gmail.com"Note: To test the actual Email OTP flow yourself, you must provide a valid Gmail App Password in
SMTP_PASSsecurely.
Push the Prisma schema to your newly created PostgreSQL database to instantly generate all the necessary tables:
npx prisma db pushnpm run devThe backend will run on
http://localhost:5001. Upon startup, it automatically seeds the database with a default Super Admin account.
Create a .env file inside the frontend directory and add the following:
VITE_API_URL=http://localhost:5001/apiOpen a new terminal window and navigate to the frontend directory:
cd frontend
npm installStart the frontend:
npm run devThe frontend will run on
http://localhost:5173.
Here is how you can completely test the platform's core features:
The platform automatically provisions a Super Admin account on backend startup. You do not need to manually seed the database.
- Go to:
http://localhost:5173/ - Email:
admin@iitk.ac.in - Password:
admin@123
This dashboard allows you to view system analytics, monitor all users, vendors, and manage banned accounts.
We have implemented a secure Email OTP verification system.
- Click Create Account on the login page.
- Register as a Customer, Vendor, or Rider.
- You will be redirected to an OTP screen. An email containing a 6-digit OTP will be sent to the registered email address.
- Enter the OTP to successfully finalize the account creation and log in.
- Click Forgot Password? on the login screen.
- Enter your registered email.
- Retrieve the OTP from your email inbox and enter it.
- Set a new password and try logging in inside the app.
- Customer: Can browse products, add items to the cart, place orders, and raise complaints.
- Vendor: Has a dedicated dashboard to manage products, view incoming orders, update order status (Accepted -> Ready), and view delivery issues raised by riders.
- Rider (Courier): Can view available orders ready for pickup, accept delivery jobs, update delivery status, and flag issues (like "Customer Unavailable").
- Address already in use (EADDRINUSE): If you get a port 5001 error, make sure no other background node processes are running.
- Email OTPs not sending: Ensure your Google Account has 2-Step Verification enabled and you have generated a strict "App Password" (16 characters) for your
.envfile, as normal Gmail passwords will be rejected by Google's SMTP servers.