Tsuki Line is a comprehensive Railway Management System built with Python. It features a modern GUI, automated email notifications, and real-time route visualization. The project follows a aesthetic anime themes
⚠️ Originally developed as a Class 12 Computer Science project, this grew beyond the syllabus scope due to its GUI-based architecture — so it was rebuilt as a passion project instead. Visuals are purely experimental and for fun, so dont take it seriously.
- User Authentication: Secure Sign-up and Login system integrated with MySQL.
- Ticket Booking: Supports both Express and Local train reservations.
- Dynamic Seat Management: Real-time availability tracking with support for waiting lists.
- Automated Ticketing: Generates a custom-designed digital ticket and emails it to the user using SMTP.
- Live Route Mapping: Uses Selenium WebDriver to fetch and display live Google Maps routes between stations.
- Multimedia Integration: Background music and interactive UI elements powered by
pygameandcustomtkinter.
- Language: Python 3.x
- Frontend:
customtkinter,Pillow(PIL) - Backend: MySQL (via
mysql-connector-python) - Automation: Selenium (Chrome Driver)
- Utilities:
smtplib(Email),pygame(Audio),python-dotenv(Security)
Before running the app, ensure you have the following installed:
- MySQL Server
- Google Chrome (for Selenium route fetching)
- Required Python libraries:
pip install customtkinter pillow mysql-connector-python tkcalendar pygame selenium python-dotenvFollow these steps to get the Tsuki Line environment running on your local machine.
You must have MySQL installed. Create a database named TSUKI_LINE and initialize the required tables.
- Database Name:
TSUKI_LINE - Core Tables:
USER,TRAIN_SCHEDULE,COST,EXPRESS_BOOKING, andLOCAL_BOOK. - Ensure your local MySQL server is running before launching the application.
- You shoud enter data manually through mysql in
TRAIN_SCHEDULEandCOST
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| USER_ID | int | NO | PRI | NULL | auto_increment |
| Email_ID | varchar(50) | YES | NULL | ||
| PASSWORD | varchar(20) | YES | NULL | ||
| NAME | varchar(30) | YES | NULL | ||
| AGE | int | YES | NULL | ||
| GEN | varchar(1) | YES | NULL |
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| BOOKING_NO | int | NO | PRI | NULL | auto_increment |
| USER_ID | int | YES | NULL | ||
| TRAIN | varchar(30) | YES | NULL | ||
| DATE | date | YES | NULL | ||
| BOOKING_DATE | date | YES | NULL | ||
| PNR | bigint | YES | NULL | ||
| STATUS | varchar(15) | YES | NULL | ||
| SEAT | varchar(5) | YES | NULL |
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| BOOKING_ID | int | NO | PRI | NULL | auto_increment |
| FROMS | varchar(20) | YES | NULL | ||
| TOS | varchar(20) | YES | NULL | ||
| USER_ID | int | YES | NULL | ||
| PNR | bigint | YES | NULL |
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| TRAIN_NO | int | NO | PRI | NULL | |
| TRAIN_NAME | varchar(30) | YES | NULL | ||
| FROM | varchar(15) | YES | NULL | ||
| TO | varchar(15) | YES | NULL | ||
| DEPARTURE_TIME | time | YES | NULL | ||
| ARRIVAL_TIME | time | YES | NULL | ||
| MON | tinyint(1) | YES | 1 | ||
| TUE | tinyint(1) | YES | 1 | ||
| WED | tinyint(1) | YES | 1 | ||
| THU | tinyint(1) | YES | 1 | ||
| FRI | tinyint(1) | YES | 1 | ||
| SAT | tinyint(1) | YES | 1 | ||
| SUN | tinyint(1) | YES | 1 |
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| TRAIN_NO | int | NO | PRI | NULL | |
| GN | int | YES | NULL | ||
| SL | int | YES | NULL | ||
| 1A | int | YES | NULL | ||
| 2A | int | YES | NULL | ||
| 3A | int | YES | NULL | ||
| 3E | int | YES | NULL | ||
| CC | int | YES | NULL |
To protect your sensitive credentials (like your database password and Gmail App key), this project uses a .env file.
- Create a file named
.envin the root directory. - Add the following lines and replace the placeholders with your actual data:
MYSQL_PASSWORD=your_actual_mysql_password
GMAIL_APP_PASSWORD=your_16_digit_gmail_app_keyThe GUI relies on specific external assets to render correctly. Ensure your file structure looks like this:
/Holy Grail/: This directory must contain all UI images (logos, backgrounds, and buttons).song.mp3: Place your background music file directly in the root directory.Tsuki line.py: The main execution script.
Install the necessary dependencies using pip:
pip install customtkinter pillow mysql-connector-python tkcalendar pygame selenium python-dotenvThe application uses customtkinter to achieve a sleek, dark-themed interface.



