Skip to content

SiddharthKumar268/Apna__Adda

Repository files navigation

๐Ÿก Apna Adda

Your Place, Your People, Your Home

Node.js Express MongoDB jQuery

India's most trusted full-stack house rent & buy listing platform ๐Ÿ˜๏ธ

๐Ÿš€ Quick Start | โœจ Features | ๐Ÿ“ธ Gallery | ๐Ÿ—บ๏ธ API Routes | ๐Ÿ”ฎ Roadmap


Apna Adda Banner


๐ŸŒŸ Vision

"Ghar ki talash, ab ho gayi aasan" โ€” Making house hunting simple, secure, and Indian.

Apna Adda is more than just a property listing platformโ€”it's your trusted companion in finding the perfect home. Built with Indian sensibilities at its core, we understand that a home isn't just four walls; it's where memories are made and dreams take shape.

Why Apna Adda?

  • ๐Ÿ  Comprehensive Listings โ€“ Authority plots, freehold properties, apartments, industrial plots
  • ๐Ÿ”’ Verified Owners โ€“ Aadhaar verification & ownership document authentication
  • ๐Ÿ’ฌ AI Assistant โ€“ Chat with our intelligent bot for instant property recommendations
  • ๐Ÿ“ฑ Mobile-First Design โ€“ Beautiful, responsive interface that works everywhere
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Made for India โ€“ Supports Indian property types, documents, and payment preferences

โœจ Features Overview

๐Ÿ‘ค User Management

  • Secure Authentication with bcrypt password hashing
  • Session Management using Express + MongoDB
  • Profile Updates including password changes
  • Multi-Role System: Users, Tenants, Admins
  • Document Upload for KYC verification
  • Privacy First approach with data encryption

๐Ÿค– AI-Powered Features

  • Apna Adda Chat Assistant for property queries
  • Smart Recommendations based on preferences
  • Natural Language Search for easy discovery
  • Auto-Complete for locations and property types
  • Intelligent Filtering by price, area, amenities
  • Predictive Text throughout the platform

๐Ÿ˜๏ธ Property Listings

  • Multiple Categories:
    • Authority Plots
    • Freehold Properties
    • Industrial Plots
    • Flats & Apartments
  • Rich Media Support with image uploads
  • Detailed Specifications (area, price, location)
  • Real-Time Updates to listing database
  • Wishlist & Favorites functionality

๐Ÿ‘จโ€๐Ÿ’ผ Admin & Owner Portal

  • Verified Registration with Aadhaar
  • Ownership Paper Upload for authenticity
  • Listing Management (add/edit/delete)
  • Tenant Applications review system
  • Analytics Dashboard with insights
  • Document Verification tools

๐Ÿ  Tenant Features

  • Easy Application with photo upload
  • Aadhaar Integration for quick verification
  • Custom Offer System (negotiate prices)
  • Lease Duration flexibility
  • Application Tracking in real-time
  • Direct Owner Contact after approval

๐Ÿ” Security & Trust

  • Encrypted Passwords using bcrypt
  • Session Security with HttpOnly cookies
  • Input Sanitization against XSS/SQL injection
  • File Upload Validation (type, size limits)
  • CORS Protection for API security
  • Rate Limiting to prevent abuse

๐Ÿ—๏ธ System Architecture

graph TB
    A[๐Ÿ‘ค Client Browser] --> B{Express Server}
    B --> C[๐Ÿ” Auth Middleware]
    C --> D[๐Ÿ“Š MongoDB Database]
    
    B --> E[๐Ÿค– AI Chat API]
    B --> F[๐Ÿ“ Multer File Handler]
    F --> G[๐Ÿ’พ Local Storage]
    
    D --> H[(Users Collection)]
    D --> I[(Tenants Collection)]
    D --> J[(Admins Collection)]
    D --> K[(Listings Collection)]
    D --> L[(Sessions Store)]
    
    B --> M[๐Ÿ“„ JSON Data Files]
    M --> N[Authority Plots]
    M --> O[Freehold Properties]
    M --> P[Industrial Plots]
    M --> Q[Apartments]
    
    style B fill:#667eea,stroke:#764ba2,stroke-width:3px,color:#fff
    style D fill:#f093fb,stroke:#f5576c,stroke-width:3px,color:#fff
    style E fill:#4facfe,stroke:#00f2fe,stroke-width:3px,color:#fff
Loading

๐Ÿ’ป Tech Stack Deep Dive

Backend Technologies

Technology Purpose Why We Chose It
Node.js Runtime Environment Non-blocking I/O, perfect for real-time apps
Express Web Framework Minimalist, flexible, vast middleware ecosystem
MongoDB Database Schema flexibility, JSON-like documents
Mongoose ODM Elegant schema modeling, validation
Multer File Uploads Easy multipart/form-data handling
bcrypt Password Hashing Industry-standard security

Frontend Stack

// Clean, modern frontend built with:
โœ… HTML5 โ€” Semantic markup
โœ… CSS3 โ€” Custom properties, Flexbox, Grid, Animations
โœ… JavaScript (ES6+) โ€” Modern async/await, modules
โœ… jQuery โ€” AJAX calls, DOM manipulation
โœ… Responsive Design โ€” Mobile-first approach

Project Structure

ApnaAdda/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ server.js                    # Express app entry point
โ”œโ”€โ”€ ๐Ÿ“ .env                         # Environment configuration
โ”œโ”€โ”€ ๐Ÿ“ package.json                 # Dependencies
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ models/
โ”‚   โ”œโ”€โ”€ User.js                     # User schema & model
โ”‚   โ”œโ”€โ”€ Tenant.js                   # Tenant registration model
โ”‚   โ”œโ”€โ”€ Admin.js                    # Admin/owner model
โ”‚   โ””โ”€โ”€ Listing.js                  # Property listing model
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ routes/
โ”‚   โ”œโ”€โ”€ auth.js                     # User auth routes
โ”‚   โ”œโ”€โ”€ admin.js                    # Admin management routes
โ”‚   โ”œโ”€โ”€ listings.js                 # Property CRUD routes
โ”‚   โ””โ”€โ”€ tenant.js                   # Tenant application routes
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ middleware/
โ”‚   โ”œโ”€โ”€ authMiddleware.js           # Session validation
โ”‚   โ””โ”€โ”€ uploadMiddleware.js         # Multer configuration
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ public/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ css/
โ”‚   โ”‚   โ””โ”€โ”€ style.css              # Indian-inspired styling
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ js/
โ”‚   โ”‚   โ””โ”€โ”€ main.js                # Client-side logic
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ images/                 # Static assets
โ”‚   โ”œโ”€โ”€ Homepage.html              # Landing page
โ”‚   โ”œโ”€โ”€ login.html                 # User login
โ”‚   โ”œโ”€โ”€ register.html              # User signup
โ”‚   โ”œโ”€โ”€ admin.html                 # Admin dashboard
โ”‚   โ””โ”€โ”€ success.html               # Confirmation page
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ uploads/
โ”‚   โ”œโ”€โ”€ tenant/                    # Tenant photos
โ”‚   โ””โ”€โ”€ ownership_papers/          # Admin documents
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ data/
โ”‚   โ”œโ”€โ”€ authority-plots.json       # Authority plot listings
โ”‚   โ”œโ”€โ”€ freehold-property.json     # Freehold listings
โ”‚   โ”œโ”€โ”€ industrial-plots.json      # Industrial listings
โ”‚   โ””โ”€โ”€ flats-apartments.json      # Apartment listings
โ”‚
โ””โ”€โ”€ README.md

๐Ÿ—บ๏ธ API Routes

Authentication Routes

Method Endpoint Description Request Body Response
POST /register Register new user {Username, Email, Password} User object + session
POST /login User login {Email, Password} Session token
GET /session-info Get current user - User details
GET /logout Logout user - Success message

Admin Routes

Method Endpoint Description Request Body Response
POST /admin/register Admin signup with docs {name, email, password, aadhaar} + files Admin object
POST /admin/login-admin Admin authentication {email, password} Session token
GET /admin/session-info-admin Get admin session - Admin details
GET /admin/logout-admin Admin logout - Success message

Tenant Routes

Method Endpoint Description Request Body Response
POST /submit-details Register as tenant Form data + photo Tenant application

Listing Routes

Method Endpoint Description Query Params Response
GET /api/listings Fetch all listings ?type=rent&city=delhi Array of listings
POST /add-listing Create new listing {city, title, type, rent, area} + image Created listing
GET /authority-plots Get authority plots - Array of plots
GET /freehold-property Get freehold listings - Array of properties
GET /industrial-plots Get industrial plots - Array of plots
GET /flats-apartments Get apartments - Array of flats

AI Chat Route

Method Endpoint Description Request Body Response
POST /api/chat Chat with AI assistant {message: "3BHK in Mumbai"} AI recommendations

Data Management Routes

Method Endpoint Description Response
GET /load-data Load JSON to MongoDB Success count
GET /load-authority-plots Sync authority plots Loaded items
GET /load-freehold-property Sync freehold data Loaded items
GET /load-industrial-plots Sync industrial plots Loaded items
GET /load-flats-apartments Sync apartments Loaded items

๐Ÿ—„๏ธ Database Schemas

User Schema

const UserSchema = new mongoose.Schema({
  Username: { 
    type: String, 
    required: true,
    trim: true,
    minlength: 3 
  },
  Email: { 
    type: String, 
    required: true, 
    unique: true,
    lowercase: true,
    validate: {
      validator: function(v) {
        return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(v);
      }
    }
  },
  Password: { 
    type: String, 
    required: true,
    minlength: 6
  },
  createdAt: { type: Date, default: Date.now },
  updatedAt: { type: Date, default: Date.now }
}, { timestamps: true });

Tenant Schema

const TenantSchema = new mongoose.Schema({
  tenantName: { type: String, required: true, trim: true },
  age: { type: Number, required: true, min: 18 },
  email: { type: String, required: true, lowercase: true },
  phone: { 
    type: String, 
    required: true,
    validate: {
      validator: function(v) {
        return /^[6-9]\d{9}$/.test(v); // Indian mobile number
      }
    }
  },
  numPeople: { type: Number, required: true, min: 1 },
  propertySelected: { type: String, required: true },
  listedAmount: { type: Number, required: true },
  readyToPay: { type: Number, required: true },
  leaseTime: { 
    type: String, 
    enum: ['1 month', '3 months', '6 months', '1 year', '2 years'],
    required: true 
  },
  aadhaar: { 
    type: String, 
    required: true,
    validate: {
      validator: function(v) {
        return /^\d{12}$/.test(v); // 12-digit Aadhaar
      }
    }
  },
  photo: { type: String, required: true },
  status: { 
    type: String, 
    enum: ['pending', 'approved', 'rejected'],
    default: 'pending'
  }
}, { timestamps: true });

Admin Schema

const AdminSchema = new mongoose.Schema({
  name: { type: String, required: true, trim: true },
  email: { 
    type: String, 
    required: true, 
    unique: true,
    lowercase: true
  },
  passwordHash: { type: String, required: true },
  aadhaar: { 
    type: String, 
    required: true, 
    unique: true,
    validate: {
      validator: function(v) {
        return /^\d{12}$/.test(v);
      }
    }
  },
  ownershipPaperFileName: { type: String, required: true },
  isVerified: { type: Boolean, default: false },
  createdAt: { type: Date, default: Date.now }
});

Listing Schema

const ListingSchema = new mongoose.Schema({
  city: { 
    type: String, 
    required: true,
    index: true 
  },
  title: { type: String, required: true },
  type: { 
    type: String, 
    enum: ['rent', 'buy', 'lease'],
    required: true 
  },
  category: {
    type: String,
    enum: ['authority-plot', 'freehold', 'industrial', 'apartment'],
    required: true
  },
  rent: { type: Number, required: true, min: 0 },
  dateAdded: { type: Date, default: Date.now },
  area: { type: String, required: true },
  image: { type: String },
  amenities: [String],
  ownerId: { 
    type: mongoose.Schema.Types.ObjectId, 
    ref: 'Admin' 
  },
  views: { type: Number, default: 0 },
  isActive: { type: Boolean, default: true }
}, { timestamps: true });

๐Ÿš€ Quick Setup

Prerequisites

๐Ÿ“ฆ Node.js 14.x or higher
๐Ÿ—„๏ธ MongoDB 4.x or higher (local or Atlas)
๐Ÿ’ป npm or yarn package manager
๐ŸŒ Modern web browser

Installation Steps

# 1๏ธโƒฃ Clone the repository
git clone https://github.com/SiddharthKumar241/ApnaAdda.git
cd ApnaAdda

# 2๏ธโƒฃ Install dependencies
npm install

# 3๏ธโƒฃ Create environment file
cat > .env << EOL
PORT=3000
MONGO_URI=mongodb://localhost:27017/apnaadda
SESSION_SECRET=your_super_secret_key_here_change_in_production
NODE_ENV=development
EOL

# 4๏ธโƒฃ Create upload directories
mkdir -p uploads/tenant uploads/ownership_papers

# 5๏ธโƒฃ Start MongoDB (if local)
mongod --dbpath /data/db

# 6๏ธโƒฃ Run the application
npm start

# 7๏ธโƒฃ Open in browser
# Navigate to: http://localhost:3000

Environment Variables

# .env configuration
PORT=3000                                    # Server port
MONGO_URI=mongodb://localhost:27017/apnaadda # MongoDB connection
SESSION_SECRET=change_this_in_production     # Session encryption key
NODE_ENV=development                         # Environment mode
CLOUDINARY_URL=cloudinary://...              # Optional: Cloud storage
AI_API_KEY=your_openai_key                   # Optional: AI chat feature

๐Ÿ“ธ Screenshots Gallery

๐Ÿ  Landing Page

Homepage

Beautiful, welcoming homepage with featured listings


๐Ÿ“ User Registration

Register

Simple, secure registration process


๐Ÿ” Login Interface

Login

Clean login with session management


๐Ÿ˜๏ธ Property Listings

Listings

Browse categorized properties with filters


๐Ÿ“‹ Property Details

Details

Comprehensive property information


๐Ÿ‘จโ€๐Ÿ’ผ Admin Dashboard

Admin Panel

Powerful admin controls for listing management


๐Ÿ“„ Tenant Application

Tenant Form

Easy tenant registration with document upload


โœ… Success Confirmation

Success Page

Clear confirmation after successful actions


๐Ÿค– AI Chat Assistant

How It Works

The Apna Adda AI assistant uses natural language processing to help users find properties:

// Example chat interactions:

User: "I need a 2BHK flat in Mumbai under 25000"
AI:   "Found 12 properties matching your criteria..."

User: "Show me properties with parking"
AI:   "Here are 8 apartments with parking facilities..."

User: "What documents do I need for renting?"
AI:   "You'll need: Aadhaar card, recent photos, 
       income proof, and previous address proof..."

Auto-Complete Features

// Smart suggestions as you type:

Input: "Mum..."  โ†’  Suggestions: Mumbai, Mumfordganj
Input: "2BH..."  โ†’  Suggestions: 2BHK, 2BHK Apartment
Input: "Authority..." โ†’ Suggestions: Authority Plot, Authority Approved

๐Ÿ” Security Features

Password Security

// Password hashing with bcrypt (10 salt rounds)
const hashedPassword = await bcrypt.hash(plainPassword, 10);

// Password verification
const isValid = await bcrypt.compare(inputPassword, hashedPassword);

Session Security

// Secure session configuration
app.use(session({
  secret: process.env.SESSION_SECRET,
  resave: false,
  saveUninitialized: false,
  cookie: {
    httpOnly: true,      // Prevents XSS attacks
    secure: true,        // HTTPS only in production
    maxAge: 24*60*60*1000 // 24 hour session
  },
  store: MongoStore.create({ mongoUrl: process.env.MONGO_URI })
}));

File Upload Validation

// Multer configuration with security
const upload = multer({
  storage: diskStorage,
  limits: { fileSize: 5 * 1024 * 1024 }, // 5MB max
  fileFilter: (req, file, cb) => {
    const allowedTypes = ['image/jpeg', 'image/png', 'image/jpg'];
    if (allowedTypes.includes(file.mimetype)) {
      cb(null, true);
    } else {
      cb(new Error('Invalid file type. Only JPEG/PNG allowed.'));
    }
  }
});

๐Ÿ”ฎ Development Roadmap

Phase 1: MVP โœ… Completed

  • User authentication system
  • Admin/owner registration with verification
  • Tenant application system
  • Property listing CRUD operations
  • Multiple property categories
  • Document upload functionality
  • Session management

Phase 2: Enhanced Features ๐Ÿšง In Progress

  • ๐Ÿ” Advanced Search with filters (price, location, amenities)
  • โค๏ธ Wishlist & Favorites for users
  • ๐Ÿ“ง Email Notifications for applications
  • ๐Ÿ—บ๏ธ Google Maps Integration for property locations
  • โ˜๏ธ Cloud Storage (Cloudinary) for images
  • ๐Ÿ“ฑ Responsive Mobile UI improvements
  • ๐ŸŽจ Dark Mode theme toggle

Phase 3: Social & Interactive ๐Ÿ“… Planned - Q3 2025

  • ๐Ÿ’ฌ In-App Messaging between tenants and owners
  • โญ Rating & Review System for properties
  • ๐Ÿ“Š Analytics Dashboard for admins
  • ๐Ÿ”” Real-Time Notifications using WebSockets
  • ๐Ÿ“… Booking Calendar for property visits
  • ๐Ÿ’ณ Payment Gateway integration (Razorpay/Stripe)
  • ๐Ÿ† Verified Badge for trusted owners

Phase 4: Advanced Platform ๐Ÿ“… Planned - Q1 2026

  • ๐Ÿ“ฑ Native Mobile Apps (iOS & Android)
  • ๐Ÿค– Advanced AI Recommendations using ML
  • ๐ŸŒ Multi-Language Support (Hindi, Tamil, Bengali)
  • ๐Ÿ”— Social Login (Google, Facebook, Apple)
  • ๐Ÿ“ˆ Price Trend Analytics for localities
  • ๐ŸŽฅ Virtual Tours with 360ยฐ photos
  • ๐Ÿ”’ Blockchain for document verification

๐ŸŽ Bonus Features Ideas

For Users

  • ๐Ÿ“ง Email verification with OTP
  • ๐Ÿ”” Browser push notifications for new listings
  • ๐Ÿ’พ Save search preferences
  • ๐Ÿ“Š Compare up to 3 properties side-by-side
  • ๐ŸŽฏ Set price alerts for desired areas

For Owners/Admins

  • ๐Ÿ“ˆ View analytics (views, inquiries, conversions)
  • ๐Ÿค– Auto-response templates for common queries
  • ๐Ÿ“ธ Bulk image upload for properties
  • ๐Ÿ“ Property performance reports
  • ๐Ÿ’ผ Portfolio management for multiple properties

Technical Enhancements

  • โšก PWA support for offline access
  • ๐Ÿ” SEO-friendly URLs for each listing
  • ๐ŸŽจ Customizable themes
  • ๐ŸŒ™ Dark mode with user preference save
  • ๐Ÿš€ Redis caching for faster load times
  • ๐Ÿ“Š Google Analytics integration

๐Ÿงช Testing

API Testing with Postman/Thunder Client

// Sample test cases:

โœ… POST /register
   Body: { Username: "test", Email: "test@gmail.com", Password: "123456" }
   Expected: 201 Created + user object

โœ… POST /login
   Body: { Email: "test@gmail.com", Password: "123456" }
   Expected: 200 OK + session cookie

โœ… GET /api/listings?city=Delhi&type=rent
   Expected: Array of Delhi rental properties

โœ… POST /submit-details (with file upload)
   Expected: 201 Created + tenant application object

Manual Testing Checklist

User Flow:
 โ˜ Register new account
 โ˜ Login successfully
 โ˜ View session info
 โ˜ Browse listings
 โ˜ Filter by category
 โ˜ Apply as tenant
 โ˜ Logout

Admin Flow:
 โ˜ Register with Aadhaar + documents
 โ˜ Admin login
 โ˜ Add new listing
 โ˜ View tenant applications
 โ˜ Admin logout

Security:
 โ˜ Cannot access protected routes without login
 โ˜ Passwords are hashed in database
 โ˜ Session expires after logout
 โ˜ File uploads validated properly

๐Ÿค Contributing

We welcome contributions from developers who believe in making housing accessible! ๐Ÿก

How to Contribute

# 1. Fork the repository
# 2. Create your feature branch
git checkout -b feature/amazing-feature

# 3. Commit your changes
git commit -m "Add: Amazing new feature description"

# 4. Push to the branch
git push origin feature/amazing-feature

# 5. Open a Pull Request

Contribution Guidelines

  • ๐Ÿ› Bug Reports: Create detailed issue with steps to reproduce
  • โœจ Feature Requests: Describe the feature and its benefits
  • ๐Ÿ’ป Code Contributions: Follow existing code style, add comments
  • ๐Ÿ“– Documentation: Help improve README, add code comments
  • ๐ŸŽจ UI/UX: Design improvements always welcome

Code Style

// Follow these conventions:
โœ… Use camelCase for variables: propertyId, userName
โœ… Use PascalCase for models: User, Tenant, Listing
โœ… Add comments for complex logic
โœ… Use async/await over callbacks
โœ… Handle errors properly with try-catch
โœ… Validate all user inputs

๐Ÿ‘จโ€๐Ÿ’ป Developer

Siddharth Goutam Kumar

Information Technology Student @ VIT

GitHub Email LinkedIn


๐Ÿ“œ License

This project is licensed under the MIT License.

Copyright (c) 2025 Siddharth Goutam Kumar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software.

See the LICENSE file for complete terms.


๐Ÿ™ Acknowledgments

Inspiration

  • Housing.com & 99acres for inspiring the UI/UX
  • Indian Real Estate community for insights
  • Open Source Community for amazing tools

Technologies

  • MongoDB Atlas for cloud database hosting
  • Express.js team for the robust framework
  • Node.js community for the ecosystem

Special Thanks

  • Beta testers from VIT who provided feedback
  • Stack Overflow community for debugging help
  • GitHub for hosting and version control

Built with ๐Ÿก and endless cups of chai ๐Ÿต

"Ghar ki talash, ab ho gayi aasan" ๐Ÿ˜๏ธ

โญ Star this repo if Apna Adda helped you find your dream home!

โฌ† Back to Top


Need Help? Have Questions? Let's Connect!

๐Ÿ› Report Bug | ๐Ÿ’ก Request Feature | ๐Ÿค Contribute


Making house hunting in India simple, secure, and accessible for everyone ๐Ÿ‡ฎ๐Ÿ‡ณ

Releases

No releases published

Packages

No packages published