A modern, full-stack web application for finding rooms and roommates. Built with React, TypeScript, Node.js, and PostgreSQL.
- User Authentication - Secure JWT-based authentication
- Room Listings - Create, browse, and manage room listings
- Advanced Search - Filter by location, price, amenities, and more
- Real-time Chat - Instant messaging between users
- Interactive Maps - Google Maps integration for location services
- Image Upload - Cloudinary integration for image processing
- Responsive Design - Mobile-first, responsive UI
- Offline Support - PWA features with offline functionality
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- React Query for data fetching and caching
- Zustand for state management
- React Hook Form with Zod validation
- Socket.io Client for real-time features
- Node.js with Express and TypeScript
- PostgreSQL with Prisma ORM
- Redis for caching and sessions
- Socket.io for real-time communication
- JWT for authentication
- Cloudinary for image processing
- Rate limiting and security middleware
- Turborepo for monorepo management
- Docker Compose for development environment
- ESLint & Prettier for code quality
- TypeScript throughout the stack
web/
├── apps/
│ ├── frontend/ # React application
│ └── backend/ # Node.js API server
├── packages/
│ ├── types/ # Shared TypeScript types
│ └── utils/ # Shared utility functions
├── docker-compose.yml # Development services
└── package.json # Workspace configuration
- Node.js 18+ and npm
- Docker and Docker Compose
- Git
-
Clone the repository
git clone <repository-url> cd RentMeRoom/web
-
Install dependencies
npm install
-
Start development services
docker-compose up -d
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Set up the database
cd apps/backend npm run db:push npm run db:seed -
Start development servers
# From the root web directory npm run dev
This will start:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Database Admin: http://localhost:8080
- Frontend development:
cd apps/frontend && npm run dev - Backend development:
cd apps/backend && npm run dev - Run all services:
npm run dev(from root) - Build all packages:
npm run build - Run tests:
npm run test - Lint code:
npm run lint
The application uses PostgreSQL with Prisma ORM. Key models include:
- User - User accounts and authentication
- UserProfile - Extended user information
- RoomListing - Room listings with details
- ChatConversation - Chat conversations
- ChatMessage - Individual messages
# Generate Prisma client
npm run db:generate
# Push schema changes
npm run db:push
# Create and run migrations
npm run db:migrate
# Seed database with sample data
npm run db:seed
# Reset database
npm run db:resetCopy .env.example to .env and configure:
- Database: PostgreSQL connection string
- Redis: Redis connection for caching
- JWT: Secrets for token generation
- Cloudinary: Image upload service
- Google Maps: API key for maps
- Email: SMTP configuration for notifications
GET /health- Health checkPOST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/listings- Get room listingsPOST /api/listings- Create room listingGET /api/users/profile- Get user profile
The project includes comprehensive testing:
- Unit Tests - Component and function testing
- Integration Tests - API endpoint testing
- Property-Based Tests - Universal property validation
- E2E Tests - Full user journey testing
Run tests with:
npm run testnpm run build- Set up production database (PostgreSQL)
- Set up Redis instance
- Configure environment variables
- Set up Cloudinary account
- Get Google Maps API key
- Frontend: Vercel, Netlify, or any static hosting
- Backend: Railway, Heroku, DigitalOcean, or AWS
- Database: Railway, Supabase, or managed PostgreSQL
This project is designed for learning full-stack development:
- React & TypeScript - Modern frontend development
- Node.js & Express - Backend API development
- PostgreSQL & Prisma - Database design and ORM
- Real-time Features - WebSocket implementation
- Authentication - JWT and security best practices
- Testing - Comprehensive testing strategies
- DevOps - Docker, CI/CD, and deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new features
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the troubleshooting guide
- Search existing issues
- Create a new issue with detailed information
Happy coding! 🎉