A full-stack web application for listing properties, finding apartments, and matching with compatible roommates. Built with modern web technologies for a seamless user experience.
- Property Listings: Create, view, search, and filter properties
- Image Upload: Upload multiple property images (stored on Cloudinary)
- Advanced Search: Filter by location, price range, apartment type, bedrooms, bathrooms
- Pagination: Browse through properties with pagination
- Property Details: Detailed view with image gallery, amenities, and contact information
- Auto-Approval: Properties are automatically approved upon submission
- Contact Information: Direct contact with property owners via phone/email
- Profile Creation: Create detailed roommate profiles
- Compatibility Algorithm: Smart matching based on:
- Budget similarity (30%)
- Location match (25%)
- Gender preference (15%)
- Cleanliness level (15%)
- Lifestyle compatibility (10%)
- Smoking/pets compatibility (5%)
- Match Scoring: Get compatibility scores (0-100) for potential roommates
- Profile Management: Update and manage your roommate profile
- Instant Messaging: Real-time chat using Socket.io
- Conversation Threads: Organized message history
- Read Receipts: Know when messages are read
- Online Status: See who's online
- Typing Indicators: See when someone is typing
- Unread Counts: Track unread messages
- User Registration: Sign up with email verification
- Secure Login: JWT-based authentication
- Password Reset: Forgot password functionality
- Email Verification: Verify email addresses
- Protected Routes: Secure API endpoints
- Token Refresh: Automatic token refresh mechanism
- HTML5, CSS3, JavaScript (ES6+)
- Vanilla JS (No frameworks - lightweight and fast)
- Fetch API for HTTP requests
- Socket.io Client for real-time messaging
- Toast Notifications for user feedback
- Responsive Design for all devices
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database with Mongoose ODM
- JWT - Authentication tokens
- Socket.io - Real-time communication
- Cloudinary - Image storage and optimization
- Multer - File upload handling
- Nodemailer - Email service
- bcryptjs - Password hashing
- express-validator - Input validation
roompal/
├── backend/ # Backend API
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # Business logic
│ │ ├── middleware/ # Custom middleware
│ │ ├── models/ # Database models
│ │ ├── routes/ # API routes
│ │ ├── services/ # Service layer
│ │ ├── socket/ # Socket.io handlers
│ │ └── utils/ # Utility functions
│ ├── package.json
│ └── README.md
│
├── assets/ # Frontend assets
│ ├── scripts/ # JavaScript files
│ │ ├── api.js # API service layer
│ │ ├── toast.js # Toast notifications
│ │ ├── propertyDetails.js
│ │ ├── listProperty.js
│ │ └── ...
│ ├── styles/ # CSS files
│ └── images/ # Image assets
│
├── reg-users/ # Registered user pages
│ ├── homepage/ # Homepage, property details, my properties
│ ├── list-a-house/ # Property listing form
│ ├── roommate/ # Roommate matching pages
│ ├── message/ # Messaging interface
│ └── ...
│
├── auth/ # Authentication pages
│ ├── verify-email/ # Email verification
│ ├── forget-password.html
│ └── ...
│
├── admin/ # Admin dashboard pages
│ ├── houses/ # Property management
│ └── admin-roomate-listing/
│
├── landing-pages/ # Public landing pages
├── index.html # Landing page
├── login.html # Login page
├── register.html # Registration page
└── README.md # This file
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
- Cloudinary Account (for image uploads)
- Email Service (Gmail, SendGrid, etc.)
-
Navigate to backend directory
cd backend -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envwith your configuration:PORT=5002 MONGODB_URI=mongodb://localhost:27017/roompal JWT_SECRET=your-secret-key CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-api-key CLOUDINARY_API_SECRET=your-api-secret EMAIL_USER=your-email@gmail.com EMAIL_PASSWORD=your-app-password FRONTEND_URL=https://dev-sayo.github.io
-
Start the backend server
npm run dev
Server will run on
http://localhost:5002
-
Open the project
- The frontend is static HTML/CSS/JS
- No build process required
- Serve using any static file server
-
Using Node.js http-server
npm install -g http-server http-server -p 3000
-
Using VS Code Live Server
- Install "Live Server" extension
- Right-click on
index.html→ "Open with Live Server"
-
Access the application
- Open
http://localhost:3000in your browser (for local development) - Production: https://dev-sayo.github.io/roompal/
- Open
- Landing Page (
index.html) - Homepage with property listings - Login (
login.html) - User login - Register (
register.html) - User registration
- Homepage (
reg-users/homepage/home.html) - Browse properties - Property Details (
reg-users/homepage/property-details.html) - View property details - List a House (
reg-users/list-a-house/list-a-house.html) - Create property listing - My Properties (
reg-users/homepage/my-properties.html) - Manage your listings - Find Roommate (
reg-users/roommate/roommate.html) - Roommate matching - Messages (
reg-users/message/in-app-message.html) - Real-time messaging
- Admin Dashboard (
admin/admin-home/admin-home.html) - Property Management (
admin/houses/houses.html) - Roommate Listings (
admin/admin-roomate-listing/ad-roommies-listing.html)
Production: https://roompal-wrgn.onrender.com/api
Development: http://localhost:5002/api
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/verify-email- Verify emailPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset passwordGET /api/auth/me- Get current user
GET /api/properties- Get all properties (with filters)GET /api/properties/:id- Get single propertyPOST /api/properties- Create propertyPUT /api/properties/:id- Update propertyDELETE /api/properties/:id- Delete propertyGET /api/properties/my/properties- Get user's properties
POST /api/roommates/profile- Create/update profileGET /api/roommates/me- Get my profileGET /api/roommates- Get all active profilesGET /api/roommates/matches- Get compatibility matches
GET /api/messages/conversations- Get conversationsGET /api/messages/:conversationId- Get messagesPOST /api/messages- Send messagePUT /api/messages/:id/read- Mark as read
See backend/README.md for detailed API documentation.
- Centralized API communication (
assets/scripts/api.js) - Automatic token attachment
- Error handling
- Response parsing
- Success, error, info, and warning toasts
- Auto-dismiss with animations
- Global toast system
- Dynamic property listings
- Image gallery with thumbnails
- Search and filter functionality
- Pagination support
- Loading states and empty states
- Multi-step form support (converted to single-page)
- File upload with preview
- Input validation
- Auto-formatting (phone numbers)
- Form submission with loading states
- JWT Authentication: Secure token-based auth
- Password Hashing: bcrypt with salt rounds
- Input Validation: Server and client-side validation
- CORS: Configured for frontend communication
- Rate Limiting: Prevents abuse
- File Upload Validation: Image type and size checks
- XSS Protection: Input sanitization
{
"express": "^4.x",
"mongoose": "^7.x",
"jsonwebtoken": "^9.x",
"bcryptjs": "^2.x",
"nodemailer": "^6.x",
"multer": "^1.x",
"cloudinary": "^1.x",
"socket.io": "^4.x",
"express-validator": "^7.x",
"helmet": "^7.x",
"cors": "^2.x"
}- Vanilla JavaScript (no dependencies)
- Socket.io Client (for real-time messaging)
- Fetch API (native browser API)
- Open browser DevTools (F12)
- Check Console for errors
- Test all user flows:
- Registration → Email verification → Login
- Property listing → View details
- Roommate profile creation → View matches
- Send messages → Real-time updates
- Frontend: https://dev-sayo.github.io/roompal/
- Backend API: https://roompal-wrgn.onrender.com/api
- Set up MongoDB Atlas or production MongoDB
- Configure environment variables:
FRONTEND_URL=https://dev-sayo.github.ioMONGODB_URI=your-production-mongodb-uri- Other required environment variables
- Set up Cloudinary production account
- Configure email service
- Deploy to Render, Heroku, Railway, or similar platform
- The frontend is deployed on GitHub Pages
- All API calls automatically detect production environment
- No additional configuration needed - URLs are environment-aware
- Backend README:
backend/README.md- Complete backend documentation - Property Module:
backend/PROPERTY_MODULE.md- Property features - Roommate Module:
backend/ROOMMATE_MODULE.md- Matching algorithm - Messaging Module:
backend/MESSAGING_MODULE.md- Real-time messaging - Testing Guide:
backend/TESTING_GUIDE.md- API testing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
ISC
For issues, questions, or contributions, please contact the development team.