CU Market is a full-stack, production-grade campus marketplace built exclusively for Chandigarh University students. Only users with a verified @cuchd.in email can register and participate. The platform enables students to list items for sale or barter, negotiate trades with automated cash-value computation, chat in real time, and stay updated with push notifications β all within a beautiful, mobile-first Progressive Web App.
π Authentication & Access Control
University-exclusive registration β only @cuchd.in emails are accepted
OTP Email Verification via secure, stylized HTML emails (Gmail SMTP with Nodemailer)
JWT session management with secure Bcrypt password hashing
Forgot/Reset password flow with tokenized email links
Admin Dashboard for platform-wide user & listing management
Rate limiting on auth endpoints to prevent brute-force attacks
π Marketplace & Listings
Browse, search & filter products across categories (Electronics, Books, Vehicles, Clothing, etc.)
Create rich listings with multi-image uploads powered by Cloudinary
Lazy-loaded images with smooth skeleton placeholders for fast perceived performance
Item detail pages with seller info, pricing, condition tags, and trade/buy CTAs
π Trade & Barter System
Propose trades as alternatives to cash-only transactions
Automatic cash offer computation based on listed item values
Trade status tracking β pending, accepted, rejected, completed
Dedicated Trade Dashboard to manage all incoming/outgoing negotiations
π¬ Real-Time Chat (Socket.io)
Instant messaging powered by Socket.io for zero-latency communication
Real-time unread badges and message previews
Message persistence stored in MongoDB for full chat history
Community broadcast β request an item you need and notify the campus
Offer system β sellers can respond to requests by offering their listed items
Direct fulfillment β seamlessly bridge requests to the trade/chat system
π± Native Android App (Jetpack Compose)
Standalone Android APK available for direct download
Native Android UI built from scratch using modern Jetpack Compose
Digital Asset Links configured for secure cryptographic app verification
Native Push Notifications utilizing Chrome's notification delegation
Auto-updating β app stays in sync with web deployments instantly
π§ Developer Contact System
Authenticated contact form β only logged-in students can reach the developer
Auto-injected student data (Name, UID, Email) in every message for verification
No-reply SMTP delivery from the site's official Gmail account
Anti-spam headers and plain-text fallbacks for reliable inbox delivery
Post-trade rating system allowing buyers and sellers to rate each other
Trust building through visible community feedback on user profiles
Mobile-first responsive design using Tailwind CSS with custom design tokens
Custom branded splash screen with animated logo
Smooth micro-animations (fade-in, scale-in, slide-up transitions)
Dark mode sections with gradient overlays and glassmorphism accents
Google Fonts (Inter) for premium, modern typography
Custom SVG logo branding across Navbar, Footer, Login, Signup, and PWA icons
Technology
Purpose
React 18
Component-based UI framework
Vite 5
Next-gen build tool & dev server
Tailwind CSS 3
Utility-first CSS styling
Zustand 4
Lightweight global state management
React Router 6
Client-side routing & navigation
React Hook Form + Zod
Form handling with schema validation
Lucide React
Beautiful, consistent icon system
Vite PWA Plugin
Service Worker & manifest generation
Jetpack Compose
Native Android UI Toolkit
Technology
Purpose
Node.js
Server-side JavaScript runtime
Express 4
Minimal, flexible web framework
MongoDB Atlas
Cloud-hosted NoSQL database
Mongoose 8
Elegant ODM for MongoDB
JWT
Stateless authentication tokens
Bcrypt.js
Secure password hashing
Nodemailer
SMTP email delivery (Gmail)
Cloudinary
Cloud image storage & optimization
Multer
Multipart file upload middleware
Web Push
Server-side push notification dispatch
Express Rate Limit
API abuse & brute-force prevention
Service
Purpose
Vercel
Frontend hosting & CI/CD
MongoDB Atlas
Managed database cluster
Cloudinary
Image CDN & transformation
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT (React + Vite) β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β Zustand β β Router β β Forms β β PWA β β
β β Store β β v6 β β + Zod β β Worker β β
β βββββββ¬βββββ βββββββ¬βββββ βββββββ¬βββββ ββββββ¬βββββ β
β ββββββββββββββββΌβββββββββββββΌβββββββββββββ β
β β β β
β βββββββΌβββββββββββββΌβββββββ β
β β API Client (Axios) β β
β βββββββββββββ¬ββββββββββββββ β
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β HTTPS / REST
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β SERVER (Express.js) β
β ββββββββββββββ ββββββββββββββ ββββββββββββββββββββββ β
β β Auth MW β β Rate Limitβ β Multer + Cloudinaryβ β
β β (JWT) β β Middleware β β Upload Pipeline β β
β βββββββ¬βββββββ βββββββ¬βββββββ βββββββ¬βββββββββββββββ β
β ββββββββββββββββββΌβββββββββββββββ β
β β β
β ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ β
β β REST API Routes β β
β β /auth Β· /items Β· /trades Β· /conversations β β
β β /ratings Β· /push Β· /upload Β· /admin Β· /contact β β
β ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ β
β β MongoDB Atlas (Mongoose ODM) β β
β β Users Β· Items Β· Trades Β· Conversations β β
β β Messages Β· Ratings Β· PushSubscriptions β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββ βββββββββββββββββββββββββββββββ β
β β Nodemailer SMTPβ β Web Push (VAPID Keys) β β
β β β Gmail β β β Browser Notifications β β
β βββββββββββββββββββ βββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Layer
Implementation
Password Storage
Bcrypt hashing with automatic salt rounds
Session Tokens
JWT with configurable expiration, validated on every protected route
Email Verification
SHA-256 hashed tokens with 1-hour TTL stored in MongoDB
Rate Limiting
3 verification attempts/hour, throttled login/signup endpoints
CORS Protection
Whitelisted frontend origins only
File Uploads
Server-side validation via Multer before Cloudinary forwarding
Data Privacy
UIDs and emails hidden from public API responses
No-Reply Emails
replyTo set to inactive address preventing unauthorized replies
Service Worker Safety
Graceful getRegistration() probing to avoid UI deadlocks in restricted contexts
Route
Page
Auth Required
Description
/
Home
β
Landing page with hero, features, and categories
/marketplace
Marketplace
β
Browse, search, and filter all listings
/items/:id
Item Detail
β
Full item page with images, seller info, trade CTA
/login
Login
β
Sign in with branded logo
/signup
Signup
β
Register with @cuchd.in email verification
/verify-email
Email Verification
β
Token-based email verification handler
/forgot-password
Forgot Password
β
Request a password reset link
/reset-password
Reset Password
β
Set a new password via tokenized link
/create-listing
Create Listing
β
Multi-image upload with category & pricing
/profile
Profile
β
View/edit profile, manage your listings
/trades
Trade Dashboard
β
Full negotiation dashboard with status tracking
/chat
Chat
β
Real-time messaging with trade context
/admin
Admin Dashboard
β
Platform-wide user & listing management
/contact
Developer Contact
β
Authenticated feedback form with auto-injected student data
Requirement
Minimum Version
Node.js
v16.0+
npm
v8.0+
MongoDB Atlas
Free tier (M0) or local instance
Google Account
For Gmail SMTP App Password
Cloudinary Account
Free tier for image uploads
Git
Any recent version
git clone https://github.com/Pratik-kr21/cu-marketplace.git
cd cu-marketplace
# Frontend dependencies (from root)
npm install
# Backend dependencies
cd server
npm install
cd ..
3. Configure Environment Variables
Create the required .env files as described in the Environment Variables section below.
Open two terminal windows:
# Terminal 1 β Backend Server
cd server
node index.js
# β Runs at http://localhost:4000
# Terminal 2 β Frontend Client
npm run dev
# β Runs at http://localhost:5173
π Environment Variables
Frontend β .env (root directory)
VITE_API_URL = http://localhost:4000
PORT = 4000
MONGODB_URI = mongodb+srv://<user>:<password>@<cluster>.mongodb.net/<dbname>?retryWrites=true&w=majority
JWT_SECRET = your_super_secret_jwt_key
# Frontend URL (CORS & Email Links)
VITE_FRONTEND_URL = http://localhost:5173
# Gmail SMTP (Nodemailer)
EMAIL_USER = your_email@gmail.com
EMAIL_PASS = your_16_char_app_password
# Cloudinary
CLOUDINARY_CLOUD_NAME = your_cloud_name
CLOUDINARY_API_KEY = your_api_key
CLOUDINARY_API_SECRET = your_api_secret
π How to Set Up Gmail App Password
Log into your Google Account
Go to Security β Enable 2-Step Verification
Search for App Passwords in account settings
Generate a new App Password (e.g., name it CU Market)
Copy the 16-character code (remove spaces) β paste as EMAIL_PASS
π‘ Dev Bypass: If EMAIL_PASS is missing, the server will print a verification link directly in the terminal for local testing!
π How to Set Up MongoDB Atlas
Create a free cluster at MongoDB Atlas
Create a Database User with a strong password
Whitelist your IP in Network Access (use 0.0.0.0/0 for development)
Copy the connection string and paste as MONGODB_URI
cu-marketplace/
βββ public/ # Static assets, PWA manifest, favicons, logo SVGs
βββ index.html # App entry point with SEO meta tags
β
βββ src/ # ββ React Frontend ββ
β βββ components/
β β βββ auth/ # ProtectedRoute wrapper
β β βββ layout/ # Navbar, Footer
β β βββ marketplace/ # ItemGrid, ItemCard
β β βββ ui/ # Button, Input, Modal, Badge, Avatar,
β β # InstallPWA, NotificationBell, LazyImage
β βββ lib/
β β βββ api.js # Axios HTTP client with JWT interceptors
β β βββ imageUpload.js # Cloudinary upload utilities
β β βββ pushNotifications.js # Web Push subscription management
β β βββ validators.js # Zod schemas for form validation
β βββ pages/
β β βββ Home.jsx # Landing page with hero & features
β β βββ Marketplace.jsx # Browsable product grid with filters
β β βββ ItemDetail.jsx # Full item view with trade actions
β β βββ CreateListing.jsx # Multi-image listing creation form
β β βββ Login.jsx # Branded sign-in page
β β βββ Signup.jsx # University registration form
β β βββ VerifyEmail.jsx # Email token verification
β β βββ ForgotPassword.jsx # Password reset request
β β βββ ResetPassword.jsx # New password submission
β β βββ Profile.jsx # User profile & listing management
β β βββ TradeDashboard.jsx # Trade negotiation hub
β β βββ Chat.jsx # Real-time messaging
β β βββ AdminDashboard.jsx # Admin controls panel
β β βββ DeveloperContact.jsx # Authenticated feedback form
β βββ store/
β β βββ authStore.js # Zustand auth state & JWT persistence
β βββ App.jsx # Root component with routing & splash screen
β βββ main.jsx # React DOM entry point
β
βββ server/ # ββ Express Backend ββ
βββ config/
β βββ db.js # MongoDB Atlas connection
βββ controllers/
β βββ authController.js # Register, login, verify, reset password
β βββ itemController.js # CRUD item operations
βββ middleware/
β βββ auth.js # JWT verification middleware
β βββ upload.js # Multer + Cloudinary pipeline
βββ models/
β βββ User.js # Student schema (name, UID, email, password)
β βββ Item.js # Listing schema (title, price, images, category)
β βββ Trade.js # Trade schema (buyer, seller, status, offers)
β βββ Conversation.js # Chat thread schema
β βββ Message.js # Individual message schema
β βββ Rating.js # Post-trade rating schema
β βββ PushSubscription.js # Web push subscription storage
βββ routes/
β βββ auth.js # /api/auth endpoints
β βββ items.js # /api/items CRUD
β βββ trades.js # /api/trades negotiation
β βββ conversations.js # /api/conversations messaging
β βββ ratings.js # /api/ratings feedback
β βββ push.js # /api/push subscription management
β βββ upload.js # /api/upload image handling
β βββ admin.js # /api/admin management
β βββ contact.js # /api/contact developer feedback
βββ utils/
β βββ email.js # Nodemailer SMTP transporter
β βββ cloudinary.js # Cloudinary SDK configuration
βββ index.js # Express server entry point
βββ vapid.json # VAPID keys for Web Push
Pratik Kumar
Β© 2026 CU Market Β· Designed & Developed by Pratik Kumar Β· All Rights Reserved