A modern, full-stack marketplace application built specifically for college students, featuring AI-powered price suggestions, real-time auctions, lost & found, and comprehensive admin controls.
- Email OTP Verification: Secure registration with email verification (only @gcet.ac.in emails)
- AI Price Prediction: Machine learning-powered price suggestions using Random Forest
- Real-time Chat: Socket.io powered instant messaging between buyers and sellers
- Product Marketplace: Buy and sell campus essentials with image uploads
- Admin Verification System: Products require admin approval before going live
- Wishlist: Save favorite items for later
- Notifications: Real-time notifications for bids, messages, and updates
- Live Auctions: Create and participate in real-time bidding with countdown timers
- Lost & Found: Report lost items or claim found items with image support
- Progressive Web App (PWA): Install on mobile devices, works offline
- Mobile-First Design: Light glass theme optimized for mobile devices
- Campus-Specific Categories: 📚 Books, 📐 Engineering Tools, 📱 Gadgets, and more
- Product Approval System: Review and approve/reject product listings
- User Management: View all registered users
- Admin Dashboard: Comprehensive overview of platform activity
- Node.js + Express.js (Port 3000)
- MongoDB with Mongoose ODM
- Socket.io for real-time communication
- Nodemailer for OTP email delivery
- Multer for file uploads
- bcryptjs for password hashing
- Python + Flask (Port 5000)
- scikit-learn Random Forest Regressor
- pandas + numpy for data processing
- joblib for model persistence
- EJS templating engine
- Bootstrap 5 with light glass theme
- Socket.io Client for real-time features
- Service Worker for PWA functionality
- Vanilla JavaScript for dynamic interactions
campus-olx/
├── backend/
│ ├── server.js # Main Node.js server
│ ├── models/
│ │ ├── User.js # User schema with admin role
│ │ ├── Product.js # Product schema with status
│ │ ├── Auction.js # Auction schema with bids
│ │ ├── LostFound.js # Lost & Found schema
│ │ ├── Chat.js # Chat schema
│ │ ├── Notification.js # Notification schema
│ │ ├── Wishlist.js # Wishlist schema
│ │ └── OTP.js # OTP schema with TTL
│ ├── create-admin.js # Admin creation utility
│ ├── set-admin.js # Set user as admin
│ ├── package.json # Node dependencies
│ ├── .env # Environment variables (not in git)
│ └── .env.example # Environment template
├── frontend/
│ ├── views/ # EJS templates
│ │ ├── layout.ejs # Main layout
│ │ ├── mobile-layout.ejs # Mobile PWA layout
│ │ ├── index.ejs # Landing page
│ │ ├── login.ejs # Login page
│ │ ├── register.ejs # Registration with OTP
│ │ ├── dashboard.ejs # Product listings
│ │ ├── admin-dashboard.ejs # Admin panel
│ │ ├── auctions.ejs # Live auctions
│ │ ├── lost-found.ejs # Lost & Found
│ │ ├── post-ad.ejs # Post product form
│ │ ├── product-detail.ejs # Product details
│ │ ├── chat.ejs # Real-time chat
│ │ ├── wishlist.ejs # Saved items
│ │ └── notifications.ejs # Notifications
│ └── public/
│ ├── css/
│ │ ├── style.css # Base styles
│ │ ├── mobile-light-glass.css # Mobile theme
│ │ └── enhancements.css # Additional styles
│ ├── manifest.json # PWA manifest
│ ├── sw.js # Service worker
│ └── uploads/ # Product images
├── ai_service/
│ ├── train_model.py # ML model training script
│ ├── app.py # Flask API server
│ ├── requirements.txt # Python dependencies
│ ├── model.pkl # Trained model (generated)
│ └── label_encoder.pkl # Category encoder (generated)
├── start.bat # Windows startup script
├── README.md
└── SETUP_GUIDE.md
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- MongoDB (running locally or MongoDB Atlas)
cd campus-olx/backend
npm installCopy the example environment file and edit with your settings:
cd backend
cp .env.example .envEdit backend/.env file:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/campus-olx
SESSION_SECRET=your-secret-key-change-this
EMAIL_USER=your-email@gcet.ac.in
EMAIL_PASS=your-app-specific-password
AI_SERVICE_URL=http://localhost:5000Gmail Setup for Email OTP:
- Enable 2-Factor Authentication in your Google Account
- Go to Google Account → Security → App Passwords
- Generate an App-Specific Password for "Mail"
- Use that 16-character password in
EMAIL_PASS
cd ai_service
pip install -r requirements.txt
python train_model.pyThis will generate synthetic data and train the Random Forest model, saving model.pkl.
Terminal 1 - Start MongoDB (if running locally):
mongodTerminal 2 - Start Flask AI Service:
cd ai_service
python app.pyTerminal 3 - Start Node.js Server:
cd backend
npm start- Open browser to
http://localhost:3000 - Register with a
@gcet.ac.inemail - Verify your email with the OTP sent to your inbox
- Login and start browsing or posting items
- Use the AI price suggestion when posting items
- Chat with sellers in real-time
- Participate in live auctions
- Report lost items or claim found items
To create an admin account:
cd backend
node create-admin.js
# Or set existing user as admin:
node set-admin.jsAdmin email: 12302040501009@gcet.ac.in (default)
The AI model uses the following formula for training data:
Resale Price = Original Price × (0.95 ^ Age in Months) × Condition Factor
Where:
- Condition Factor: 1=0.5, 2=0.65, 3=0.8, 4=0.9, 5=1.0
- Model: Random Forest Regressor with 100 estimators
- User enters email ending with
@gcet.ac.inand password - Clicks "Send Verification Code"
- Receives 6-digit OTP via email
- Enters OTP and clicks "Verify Code"
- Registration button becomes enabled
- Completes registration
OTPs automatically expire after 5 minutes using MongoDB TTL index.
- Password hashing with bcryptjs
- Session-based authentication
- Email domain validation (@gcet.ac.in only)
- TTL-based OTP expiration
- File upload validation (type and size)
POST /api/send-otp- Send OTP to emailPOST /api/verify-otp- Verify OTP codePOST /api/register- Register new userPOST /api/login- Login userGET /logout- Logout user
POST /api/products- Create product listingGET /api/my-products- Get user's productsPUT /api/products/:id- Update productDELETE /api/products/:id- Delete productPOST /api/get-price- Get AI price prediction
POST /api/auctions- Create auctionGET /api/auctions- Get active auctionsGET /api/auctions/:id- Get auction detailsPOST /api/auctions/:id/bid- Place bidPOST /api/auctions/:id/watch- Watch/unwatch auction
POST /api/lost-found- Report lost/found itemGET /api/lost-found- Get all itemsPOST /api/lost-found/:id/claim- Claim item
GET /api/admin/products- Get all products (pending/approved/rejected)PUT /api/admin/products/:id/approve- Approve productPUT /api/admin/products/:id/reject- Reject productGET /api/admin/users- Get all users
POST /api/wishlist/:productId- Add to wishlistDELETE /api/wishlist/:productId- Remove from wishlistGET /api/notifications- Get user notificationsPUT /api/notifications/:id/read- Mark as read
POST /predict- Predict resale priceGET /categories- Get valid categoriesGET /- Health check
- Light glass theme with gradient accents
- Mobile-first responsive design
- Glassmorphism effects with backdrop blur
- Smooth animations and transitions
- Progressive Web App (PWA) support
- Offline functionality
- Real-time auction countdown timers
- Image carousels for product galleries
- Real-time message updates
- Toast notifications
- Loading states for async operations
- Admin dashboard with approval workflow
- Password hashing with bcryptjs
- Session-based authentication
- Email domain validation (@gcet.ac.in only)
- TTL-based OTP expiration (5 minutes)
- File upload validation (type and size)
- Admin role-based access control
- Product approval system
- Content Security Policy (CSP) compliant
- Install on mobile devices
- Offline page caching
- App manifest with icons
- Service worker for offline support
- Mobile-optimized layouts
- Touch-friendly interface
Make sure to set these in your production environment:
MONGODB_URI- Your MongoDB connection stringSESSION_SECRET- Strong random secretEMAIL_USER- Your email for OTPEMAIL_PASS- App-specific passwordAI_SERVICE_URL- URL of your AI service
- Backend: Heroku, Railway, Render
- Database: MongoDB Atlas
- AI Service: PythonAnywhere, Heroku
- Static Files: Cloudinary, AWS S3
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Landing Page
- Product Listings
- Live Auctions
- Admin Dashboard
- Mobile PWA View
- Chat Interface
- Built as a college mini project
- AI model trained using scikit-learn
- UI inspired by modern glassmorphism design trends
For support, email your-email@gcet.ac.in or open an issue in the repository.
Made with ❤️ for campus students