Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saif-gitreps/flask-airline
A backend application for managing a ticket system using Flask.py with User activities like booking and checking flights. Admin activities like managing flights on the platform. Databases used is MongoDB with Mongoengine as model framework
https://github.com/saif-gitreps/flask-airline
flask mongoengine session-auth
Last synced: 7 days ago
JSON representation
A backend application for managing a ticket system using Flask.py with User activities like booking and checking flights. Admin activities like managing flights on the platform. Databases used is MongoDB with Mongoengine as model framework
- Host: GitHub
- URL: https://github.com/saif-gitreps/flask-airline
- Owner: saif-gitreps
- Created: 2024-02-17T15:13:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-01T11:04:16.000Z (12 months ago)
- Last Synced: 2024-12-22T10:22:56.640Z (2 months ago)
- Topics: flask, mongoengine, session-auth
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Airline System Backend Server
This backend server is built using Flask, MongoDB, and mongoengine, following the MVC (Model-View-Controller) pattern.
### Installation
1. Clone the repository from GitHub:
```bash
git clone
```2. Install dependencies using pip:
```bash
pip install -r requirements.txt
```### Configuration
1. Create a `.env` file in the root directory with the following environment variables:
```plaintext
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=
MONGODB_URI=
```### Running the Server
To run the server, execute the following command:
```bash
flask run
```By default, the server will run on `http://localhost:5000`.
### Endpoints
#### Authentication and User operation (Admin and Customer)
- `/api/v1/login`:
- POST: to login an existing customer.
- `/api/v1/signup`:
- POST: create a new account for a customer.
- `/api/v1/logout`:
- POST: removes session and logs out all types of user.
- `/api/v1/login/admin`:
- POST: to login an existing admin.
- `/api/v1/login`:
- POST: create a new account for an admin.#### Flight Routes Operation
- `/api/v1/flights/search`:
- GET: Search for flights by date, to or from.
- `/api/v1/flights/`:
- GET: Get all the flights status(Admin operation).
- `/api/v1/flights/`: :
- POST: Add a flight (Admin operation).
- `/api/v1/flights/`:
- GET: Get the status of a particular flight (Admin operation).
- `/api/v1/flights/`:
- DELETE: Delete a flight (Admin operation).#### Booking Operations
- `/api/v1/book`:
- GET: Get all the bookings made by the customer.
- `/api/v1/book/`:
- POST: Book a flight.### Models
The application uses the following models:
1. **User Model**: Represents users of the system.
2. **Flight Model**: Represents flight information.
3. **Booking Model**: Represents a booking made by a customer.### Folder Structure
- `app.py`: Main Flask application file.
- `controllers/`: Contains controller logic.
- `models/`: Contains data models.
- `routes/`: Contains all the routes for the endpoints### Dependencies
- **Flask**: Micro web framework for Python.
- **mongoengine**: Object-Document Mapper (ODM) for working with MongoDB in Python.
- **PyMongo**: Python driver for MongoDB.