This project is a Railway Management API built using Flask. The API provides various endpoints to manage users, trains, tickets, and employees. It also includes a Docker file for easy setup and deployment.
-
User Management
- Insert a new user
- Search user by ID or email
- List all users
- List active users
-
Train Management
- List all trains
- Search trains from one station to another
- Check train capacity
-
Ticket Management
- Book a ticket
- Check available tickets
- List sold tickets by date
- Get total sell between dates
- Get highest sold tickets between dates
-
Employee Management
- List all employees
- Search employee by ID
-
Wallet Management
- Create or update user wallets
POST /api/insertUser
- Insert a new userGET /api/users
- List all usersGET /api/active_users
- List active usersGET /api/search_user?name=<User Name>
- Search user by NameGET /api/search_user_by_email?email=<email>
- Search user by emailGET /api/trains
- List all trainsGET /api/search_trains?from=<from_station>&to=<to_station>
- Search trains from one station to anotherGET /api/train_capacity?train_id=<train_id>
- Check train capacityPOST /api/book_ticket
- Book a ticketGET /api/check_available_tickets?departure_station_id=<station_id>&arrival_station_id=<station_id>
- Check available ticketsGET /api/sold_tickets_by_date?date=<date>
- List sold tickets by dateGET /api/total_sell_between_dates?start_date=<start_date>&end_date=<end_date>
- Get total sell between datesGET /api/highest_sold_tickets?start_date=<start_date>&end_date=<end_date>
- Get highest sold tickets between datesGET /api/list_employees
- List all employeesGET /api/search_employee_by_id?id=<id>
- Search employee by IDPOST /api/wallets
- Create or update user wallet
- Docker
-
Clone the repository:
git clone https://github.com/your-username/railway-management-api.git cd railway-management-api
-
Build the Docker image:
docker build -t railway-system .
-
Run the Docker container:
docker run -p 8000:8000 railway-system