Railway Management System is a web application built with Flask, a lightweight Python web framework. It provides functionalities similar to IRCTC, allowing users to check train availability, book seats, and manage bookings. The application also includes role-based access control, with separate privileges for administrators and regular users.
- User registration and authentication
- Role-based access control (admin and regular user roles)
- Adding new trains with source and destination
- Checking seat availability between stations
- Booking seats on trains
- Viewing booking details for users
- Python Flask: Web framework for building the application
- SQLAlchemy: Python SQL toolkit and Object-Relational Mapping (ORM) library
- Flask-JWT-Extended: JWT token-based authentication
- MySQL: Relational database management system
- HTML/CSS: Frontend for user interface
- JavaScript (optional): For dynamic frontend interactions
- Clone the repository:
git clone https://github.com/yourusername/railway-management-system.git
- Install dependencies:
pip install -r requirements.txt
-
Set up MySQL database:
- Create a MySQL database and note down the connection URI.
- Update the
SQLALCHEMY_DATABASE_URI
inconfig.py
with your MySQL connection URI.
-
Run the application:
python run.py
- Access the application in your web browser at http://localhost:5000.
config.py
: Contains configuration settings for the application, including database URI, secret keys, and environment-specific options.app.py
: Main entry point of the application. Creates the Flask app instance and initializes database connections.models.py
: Defines SQLAlchemy models for database tables.routes.py
: Contains route definitions for handling HTTP requests and serving web pages.auth.py
: Includes authentication-related functionality, such as user registration, login, and JWT token generation.utils.py
: Utility functions used throughout the application.run.py
: Script to run the Flask application.