Skip to content

ritu713/book_a_hotel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setting Up the Booking App

Prerequisites

Node.js on you local system. Clone this repo onto your system before you begin.

Backend Configuration

Environment Files: Navigate to the backend folder and create two files: .env and .env.e2e. Add the following contents to both files:

MONGODB_CONNECTION_STRING=

JWT_SECRET_KEY= FRONTEND_URL=

CLOUDINARY_CLOUD_NAME=

CLOUDINARY_API_KEY=

CLOUDINARY_API_SECRET=

STRIPE_API_KEY=

Frontend Configuration

Navigate to the frontend folder and create a file: .env:

VITE_API_BASE_URL=

VITE_STRIPE_PUB_KEY=

VITE_API_BASE_URL: The VITE_API_BASE_URL should point to the URL where your backend application is running (http://localhost:3000)

MongoDB Setup:

Create a new cluster and follow the instructions to set up a new database. Once set up, obtain your MongoDB connection string and add it to the MONGODB_CONNECTION_STRING variable in your .env files. For the .env.e2e setup see "running automated tests" below

Cloudinary Setup:

Create an account at Cloudinary. Navigate to your dashboard to find your cloud name, API key, and API secret. Add these details to the respective CLOUDINARY_* variables in your .env files.

Stripe Setup:

Sign up for a Stripe account at Stripe. Find your API keys in the Stripe dashboard. Add your Stripe API key to the STRIPE_API_KEY variable in your .env files. JWT_SECRET_KEY:

This just needs to be any long, random string. You can google "secret key generator". Frontend URL:

The FRONTEND_URL should point to the URL where your frontend application is running (typically http://localhost:3000 if you're running it locally). Frontend Configuration Environment Files: Navigate to the frontend folder and create a file: .env:

VITE_API_BASE_URL= VITE_STRIPE_PUB_KEY= VITE_API_BASE_URLL:

The VITE_API_BASE_URL should point to the URL where your backend application is running (typically http://localhost:7000 if you're running it locally).

Running the Application

Backend:

Navigate to the backend directory. Install dependencies: npm install. Start the server: npm start.

Frontend:

Open a new terminal and navigate to the frontend directory. Install dependencies: npm install. Start the frontend application: npm run dev. The application should now be running on http://localhost:5173 but verify this in your command line terminal

About

A website you can add, or book hotels from. Similar to booking.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages