The backend built for Trip Sage with Node.js, Express.js, MongoDB, and GROQ API, providing a robust and scalable infrastructure for handling API requests, data storage, and business logic.
- RESTful API: Provides endpoints for managing users, itineraries
- Authentication: Secure user authentication and authorization using JWT.
http://localhost:9000
/
: Landing pageapi/signup
: Let's you signupapi/continue
: Continue without loginapi/getPlaces
: get the itineraries
Signup Curl
curl --location 'https://personal-travel-backend.onrender.com/api/auth/signup' \
--header 'Content-Type: application/json' \
--data '{
"email": "email",
"password": "password"
}'
Login Curl
curl --location 'https://personal-travel-backend.onrender.com/api/auth/signup' \
--header 'Content-Type: application/json' \
--data '{
"email": "email",
"password": "password"
}'
getPlaces Curl
curl --location 'http://localhost:9000/api/getPlaces' \
--header 'Authorization: Bearer $token from login signup or continue' \
--header 'Content-Type: application/json' \
--data '{
"destinationCountry": "India",
"budget": "5000",
"travelStyle": "relaxing",
"interestsNew": "nature",
"accommodationType": "hotel",
"transportationType": "public transportation",
"activityType": "outdoor",
"cuisineType": "local",
"tripDuration": "5",
"language": "English"
}'
- Node.js and npm (or yarn)
- MongoDB installed and running locally or on a cloud provider like MongoDB Atlas
-
Clone the repository:
git clone https://github.com/Rohit-554/personal_travel_backend.git
-
Install the dependencies:
npm install # or yarn install
-
Set up environment variables: Create a
.env
file in the root directory with the following variables:MONGODB_URI=YourMongoDbUri JWT_SECRET=generateinyourpc GROQ_API_KEY=GroqApiKey PORT=9000
-
Start the development server:
npm run dev # or yarn dev
-
The server should now be running at
http://localhost:9000
.
To run the tests, use:
npm server.js
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License
Made with ♥ -- Thankyou for Visiting