Skip to content

Commit

Permalink
Merge branch 'apu52:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhikaMalpani1702 authored Jul 17, 2024
2 parents f22d58f + afba26b commit a13d5a0
Show file tree
Hide file tree
Showing 42 changed files with 4,069 additions and 189 deletions.
11 changes: 11 additions & 0 deletions .vscode/easycode.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/
dist/
vendor/
cache/
.*/
*.min.*
*.test.*
*.spec.*
*.bundle.*
*.bundle-min.*
*.log
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

110 changes: 110 additions & 0 deletions Licensing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Licensing Page</title>

<style>
body {
font-family: 'Lato', sans-serif;
background: linear-gradient(to bottom, #080f21, #06255b);
color: #ffffff;
margin: 0;
padding: 0;
}

.container {
max-width: 70%;
margin: 50px auto;
padding: 20px;
border-radius: 10px;
}

.container .title {
font-size: 4.3em;
color: #13b8e6;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin-bottom: 20px;
font-weight: 700;
text-align: center;
}

.container .section-title {
text-align: left;
font-size: 2em;
color: #0dcaf0;
margin-top: 20px;
}

.container .license-text {
font-size: 1.2em;
line-height: 1.6;
color: #f0f0f0;
margin-bottom: 20px;
text-align: left;
}

.container hr {
width: 50%;
color: #d56fa1;
opacity: 0.3;
margin: 20px auto;
}

@media (max-width: 768px) {
.container .title {
font-size: 2em;
}

.container .section-title {
font-size: 1.5em;
}

.container .license-text {
font-size: 1em;
}
}

.copyright-footer {
display: flex;
justify-content: center;
margin-top: 25px;
font-size: 17px;
color: rgb(185, 185, 185);
}

</style>
</head>
<body>
<a href="index.html">
<img src="./img/Screenshot 2024-01-23 003448.png" style="width: 130px; border-radius: 6px; margin-top: 20px; margin-left: 20px;">
</a>
<div class="container">
<h1 class="title">Licensing Page</h1>
<div class="license-text">
<h2 class="section-title">MIT License</h2>
<p>Copyright (c) 2023 Arpan Chowdhury</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</p>
</div>
<hr>
<footer class="copyright-footer">
<p>&copy; 2023 Arpan Chowdhury. All rights reserved.</p>
</footer>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ Show some ❤️&nbsp; by giving <img src="https://imgur.com/o7ncZFp.jpg" height
</tr>
</table>

<table>
<tr>
<td align="center"><a href="https://github.com/itsekta"><img src="img/Ekta.jfif" width=130px height=130px /></a></br> <h4 style="color:red;">Ekta Chaudhary</h4>
<a href="https://www.linkedin.com/in/ekta-software-engineer/"><img src="https://img.icons8.com/fluency/2x/linkedin.png" width="32px" height="32px"></img></a>
</td>

</tr>
</table>

<table>
<tr>
<td align="center"><a href="https://github.com/Ghanshyam89"><img src="img/GhanshyamNewPic.jpg" width=130px height=130px /></a></br> <h4 style="color:red;">Ghanshyam Prajapati</h4>
Expand Down Expand Up @@ -237,6 +246,10 @@ Show some ❤️&nbsp; by giving <img src="https://imgur.com/o7ncZFp.jpg" height
<img src="https://github.com/shruti-sen2004/Travel_Website/assets/115914670/d544fd3b-aed2-4a05-a2f8-0b7a2ff9014f" width="700" height= "250" />
</p>

<p align ="center">
<img src="https://api.vaunt.dev/v1/github/entities/apu52/repositories/Travel_Website/contributors?format=svg&limit=54" width="700" height= "250" />
</p>

<a href="https://github.com/apu52/Travel_Website/graphs/contributors">
<img align="center" src="https://contrib.rocks/image?max=100&repo=apu52/Travel_Website" />
</a>
Expand Down
Binary file added Thank You.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions Thank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thank You</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
.container {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Thank You</h1>
<img src="./t.png" alt="Thank">
</div>
</body>
</html>

4 changes: 4 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.env
combined.log
src/config/config.json
93 changes: 93 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
## Backend Module - Travel Booking API

This is the backend module for a travel booking API. It utilizes MongoDB for data storage and Express.js for server-side development.

### Environment Variables

The following environment variables are required and should be defined in a `.env` file:

* `PORT`: The port on which the server will listen (default: 5000)
* `DATABASE_URL`: The MongoDB connection string
* `JWT_SECRET_KEY`: The secret key used for signing JSON Web Tokens (JWT)
* `TOKEN_EXP`: The expiration time for JWTs (e.g., "1h" for 1 hour)

**Example .env file:**

```
PORT=5000
DATABASE_URL="mongodb+srv://username:[email protected]/?appName=Cluster0"
JWT_SECRET_KEY="authorizationAndAuthentication"
TOKEN_EXP="1h"
```

**How to create a `.env` file:**

1. Create a file named `.env` in the root directory of your project.
2. Add the environment variables as key-value pairs on separate lines.
3. **Do not** commit the `.env` file to your version control system (e.g., Git).

### Dependencies

This project uses the following dependencies:

* express: Web framework for building server-side applications
* mongoose: Object Document Mapper (ODM) for MongoDB
* http-status-codes: Provides convenient HTTP status code handling
* bcryptjs: Password hashing library
* jsonwebtoken: Library for generating and verifying JWTs

**Installation:**

```bash
cd backend
npm install
```

### Starting the Server

Start the development server with the following command:

```bash
npm run dev
```

This will start the server on the port specified in the `PORT` environment variable (default: 5000).

### API Endpoints

Here's a breakdown of the API endpoints available in this module:

**1. Locations Routes (`/locations`):**

* **GET /locations** (Public): Retrieves all locations from the database.
* **GET /locations/:id** (Public): Retrieves a specific location by its ID.
* **POST /locations/create** (**Authorization Required - Admin Role**): Creates a new location. Requires the following request body:
* `img` (String): URL of the location image.
* `locationName` (String): Name of the location.
* `locationMapLink` (String): Link to the location on a map service.
* `price` (Number): Price per night for the location.
* `rating` (Number): Average rating of the location (optional).
* `description` (String): Description of the location (optional).
* `climateInfo` (String): Information about the location's climate (optional).
* `transportationType` (Array of Strings): Types of transportation available to reach the location (optional).
* `thingsToDo` (Array of Strings): Things to do around the location (optional).
* **PUT /locations/:id** (**Authorization Required - Admin Role**): Updates an existing location by its ID. Requires the same request body format as `POST /locations/create`.
* **DELETE /locations/:id** (**Authorization Required - Admin Role**): Deletes a location by its ID.

**2. User Routes (`/auth`):**

* **POST /auth/signup** (Public): Creates a new user account. Requires the following request body:
* `name` (String): User's full name.
* `email` (String): User's email address.
* `password` (String): User's password.
* `role` (String - optional): User's role (default: "Customer"). Can be "Admin" for admin users.
* **POST /auth/login** (Public): Logs a user in and returns an access token. Requires the following request body:
* `email` (String): User's email address.
* `password` (String): User's password.
* **GET /auth/logout** (**Authorization Required**): Logs the currently authenticated user out.

**3. Trip Booking Routes (`/trip`):**

* **POST /trip/book** (**Authorization Required**): Books a location for the currently authenticated user. Requires the following request body:
* `id` (String): ID of the location to be booked.
* `checkin` (Date): Check-in date
Loading

0 comments on commit a13d5a0

Please sign in to comment.