This is an Express.js application that allows users to create accounts, login, book flights, and sign out. The application uses JWT for user authentication and password hashing for enhanced security.
- User registration and login with JWT authentication --> JWT
- Password hashing for secure storage of user credentials using bcrypt --> bcrypt
- Search and view available flights between source and destination
- Node.js v14.15.0 or higher
- NPM v6.14.8 or higher
- MongoDB v4.4 or higher
git clone https://github.com/prithidevghosh/FlySimple.git
cd Backend
npm install
node index.js
The application requires a MongoDB instance to be set up. You can configure the database connection by setting the following environment variables:
DATABASE_URI = "URI of your mongoDB instance"
JWT_SECRET_KEY ="your own JWT secret key",
SESSION_SECRET_KEY ="your own key to encrypt the session information"
You can set these environment variables in a .env file in the root directory of the application.
Base URL |
---|
https://fly-simple.vercel.app |
Endpoint Name | Method | Purpose |
---|---|---|
/api/user/create |
POST | Create a new user |
/api/user/create-session |
POST | Create a session for user / Logging In User |
/api/user/delete-session |
POST | Deleting session for user / Signing Out User |
/api/flights/find |
POST | Find flights between two airports |
Test the APIs using any tool like Postman