project-root/
├── backend/
│ ├── models/
│ │ ├── User.js
│ │ ├── Place.js
│ │ └── Booking.js
│ ├── uploads/
│ │ ├── profile_pics/
│ │ └── hotel photos
│ ├── .env
│ ├── index.js
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── App.js
│ │ └── index.js
│ ├── tailwind.config.js
│ ├── package.json
│ └── .env
├── README.md
└── package.json
- Navigate to the backend folder:
cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackend/directory and configure the following variables:MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
- Start the server:
The backend server will run on
npm start
http://localhost:3030.
- Navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Create a
.envfile in thefrontend/directory and configure the following variable:VITE_API_URL=http://localhost:3030
- Start the development server:
The frontend application will run on
npm run dev
http://localhost:5173.
- POST
/register- Register a new user. - POST
/login- Log in a user. - GET
/profile- Get the logged-in user's profile. - PUT
/profile- Update the logged-in user's profile. - POST
/logout- Log out the current user.
- POST
/places- Add a new hotel listing. - GET
/places- Retrieve all hotel listings. - GET
/places/:id- Retrieve details of a specific hotel. - PUT
/places/:id- Update hotel details.
- POST
/bookings- Create a new booking. - GET
/bookings- Retrieve all bookings for the logged-in user.