StayFinder is a full-stack web application inspired by Airbnb, designed to allow users to list and book properties for short-term or long-term stays. This project demonstrates a functional prototype with a modern React frontend, a Node.js/Express backend, and a PostgreSQL database.
- Frontend: React.js with React Router, CSS Modules for styling, and JWT-based authentication.
- Backend: Node.js with Express framework, RESTful API endpoints for user authentication, listings, and bookings.
- Database: PostgreSQL with Sequelize ORM, including models for Users, Listings, and Bookings.
- Authentication: JWT-based secure login and role-based access control (guest, host).
- Features:
- Property listing and search with filters (location, price).
- Detailed listing pages with image galleries and descriptions.
- User registration and login with role management.
- Host dashboard for managing listings.
- Booking system with reservation creation.
- Deployment: Dockerized setup with separate containers for frontend, backend, and database, orchestrated via Docker Compose.
- React.js
- Node.js
- Express.js
- PostgreSQL
- Sequelize ORM
- JWT for authentication
- Docker & Docker Compose
- Nginx (for serving React frontend in production)
git clone https://github.com/dhingralakshya/StayFinder.git
cd StayFinder
Create a .env file in the server directory with the following variables:
jwtPrivateKey=your_jwt_secret
DB_PORT=5432
DB_NAME=stayfinderDB
DB_USER=your_db_user
DB_PASSWORD=your_db_pass
DB_HOST=localhost
IMAGEKIT_PUBLIC_KEY=public_key_imageKit
IMAGEKIT_PRIVATE_KEY=private_key_imageKit
IMAGEKIT_URL_ENDPOINT=url_endpoint
Create a .env file in the client directory with the following variables:
REACT_APP_API_URL=http://localhost:4000
From the root directory, run:
docker-compose up --build
Backend
- Navigate to the server directory and install dependencies:
cd server
npm install
- Run migrations and seeders:
npx sequelize-cli db:migrate
npx sequelize-cli db:seed:all
- Start the backend server:
nodemon server.js or node src/server.js
Frontend
- Navigate to the client directory and install dependencies:
cd client
npm install
- Start the React development server:
npm start
- Ensure your backend server is running before starting the frontend to avoid API errors.
- For production deployment, the React app is served via Nginx in the Docker setup.
- Passwords in seed data are bcrypt hashed for security.
- To enable image uploads, you must add your own ImageKit API keys to the
.env
file in the server directory. Without these, you cannot use image upload feature, but you can still view seeded images.