Skip to content

vishnukothakapu/easy-stay-mern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EasyStay - Rental Booking Platform

File Structure

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

Setup Instructions

Backend Setup

  1. Navigate to the backend folder:
    cd backend
  2. Install dependencies:
    npm install
  3. Create a .env file in the backend/ directory and configure the following variables:
    MONGO_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
  4. Start the server:
    npm start
    The backend server will run on http://localhost:3030.

Frontend Setup

  1. Navigate to the frontend folder:
    cd frontend
  2. Install dependencies:
    npm install
  3. Create a .env file in the frontend/ directory and configure the following variable:
    VITE_API_URL=http://localhost:3030
  4. Start the development server:
    npm run dev
    The frontend application will run on http://localhost:5173.

API Endpoints

Authentication

  • 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.

Hotel Management

  • 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.

Bookings

  • POST /bookings - Create a new booking.
  • GET /bookings - Retrieve all bookings for the logged-in user.

About

Backend is not deployed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages