A full-stack house rent/buy listing platform built with Node.js, Express, and MongoDB, empowering users, tenants, and admins to manage listings, documents, and accounts—designed with Indian-inspired warmth.
- Register, login, logout with session support
- Profile updates & password change (optional)
- Secure session, input sanitization, password hashing
- Upload user photo (image)
- Form validations and Aadhaar storage
- Register & login with Aadhaar verification and ownership paper upload
- Manage listing data via MongoDB & JSON files
- Pre-load categories: authority plots, freehold, industrial, apartments
- Add listing to category JSON
- Node.js + Express for server
- MongoDB with Mongoose
- express-session + connect-mongo for sessions
- Multer for file uploads
- dotenv, cors, bcrypt
-
Install dependencies
npm install
-
Configure environment Create a
.env
file:PORT=3000 MONGO_URI=your_mongo_uri SESSION_SECRET=your_secret_key
-
Run project
node server.js
Method | Route | Description |
---|---|---|
POST | /register |
Register a normal user |
POST | /login |
User login |
GET | /session-info |
Get user session info |
GET | /logout |
Logout user |
POST | /admin/register |
Admin signup with Aadhaar and ownership paper upload |
POST | /admin/login-admin |
Admin login |
GET | /admin/logout-admin |
Admin logout |
GET | /admin/session-info-admin |
Get admin session info |
POST | /submit-details |
Tenant registration with photo upload |
GET | /api/listings |
Fetch all listings (MongoDB) |
GET | /load-data |
Load data.json to MongoDB if empty |
POST | /add-listing |
Add a listing to JSON category file |
GET | /load-authority-plots |
Load authority plots into DB |
GET | /load-freehold-property |
Load freehold property listings into DB |
GET | /load-industrial-plots |
Load industrial plots into DB |
GET | /load-flats-apartments |
Load flats/apartments into DB |
GET | /authority-plots |
Fetch DB authority plots |
GET | /freehold-property |
Fetch DB freehold listings |
GET | /industrial-plots |
Fetch DB industrial plots |
GET | /flats-apartments |
Fetch DB flats & apartments |
POST | /api/chat |
Chat with Apna Adda AI assistant |
const UserSchema = new mongoose.Schema({
Username: String,
Email: String,
Password: String,
}, { timestamps: true });
const TenantSchema = new mongoose.Schema({
tenantName: { type: String, required: true },
age: { type: Number, required: true },
email: { type: String, required: true },
phone: { type: String, required: true },
numPeople: { type: Number, required: true },
propertySelected: { type: String, required: true },
listedAmount: { type: Number, required: true },
readyToPay: { type: Number, required: true },
leaseTime: { type: String, required: true },
aadhaar: { type: String, required: true },
photo: { type: String, required: true },
}, { timestamps: true });
const ListingSchema = new mongoose.Schema({
city: String,
title: String,
type: String,
rent: Number,
dateAdded: String,
area: String,
image: String,
});
const AdminSchema = new mongoose.Schema({
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
passwordHash: { type: String, required: true },
aadhaar: { type: String, required: true, unique: true },
ownershipPaperFileName: { type: String, required: true },
createdAt: { type: Date, default: Date.now }
});
/public
/css
style.css # Desi inspired styling
/js
main.js # jQuery + AJAX logic
/images # Static assets
Homepage.html
login.html
register.html
admin.html
sucess.html
🖼️ Screenshots Gallery A glimpse into Apna Adda’s user experience — from login to listings!
- Passwords securely hashed with bcrypt
- Sessions managed by
express-session
+connect-mongo
- File uploads:
/uploads/tenant/
→ tenant photo/uploads/ownership_papers/
→ admin Aadhaar ownership paper
- Inputs sanitized
- Auth middleware for protecting routes
Phase | Features |
---|---|
1 (MVP) | User/admin/tenant auth with upload, property listing add/view |
2 | Edit/delete listings, filters & search, image upload to cloud |
3 | Messaging system, wishlist, map integration |
4 | Reviews, booking calendar, analytics, mobile app support |
- Email verification
- Social login (Google, Facebook)
- PWA support
- SEO friendly listing URLs
- Dark mode toggle
Siddharth Goutam Kumar
Connect via Email / GitHub / LinkedIn