Skip to content

nipun3011/RailwayAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRCTC FastAPI Project

Setup

  1. Clone the repository.
  2. Install dependencies: pip install -r requirements.txt.
  3. Set up the MySQL database and update the .env file with your database credentials.
  4. Run the application: uvicorn app.main:app --reload.

API Endpoints

  • POST /register: Register a regular user.
  • POST /register/admin: Register an admin user (protected by admin API key).
  • POST /login: Login and get an access token.
  • POST /trains: Add a new train (Admin only).
  • PUT /trains/{train_id}/seats: Update train seats (Admin only).
  • GET /trains: Get all trains between two stations.
  • POST /book: Book a seat on a train.
  • GET /bookings/{booking_id}: Get specific booking details.

About

A railway🚅 booking system built with FastAPI with role-based access control🔏, MySQL and SQLAlchemy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages