Terminal seat reservation, schedules, and ticket confirmation CLI.
Tick off requirements as you build to track real-time completion.
Follow this chronological guide to build the project from scratch.
Create routes and bookings database tables with unique seat constraints.
import sqlite3
def init_bus_db():
with sqlite3.connect("bus.db") as conn:
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS routes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
origin TEXT NOT NULL,
destination TEXT NOT NULL,
fare REAL NOT NULL
)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS bookings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
route_id INTEGER NOT NULL,
seat_num INTEGER NOT NULL,
passenger TEXT NOT NULL,
FOREIGN KEY(route_id) REFERENCES routes(id),
UNIQUE(route_id, seat_num)
)
""")
conn.commit()Real issues students hit during development and how to troubleshoot them fast.
Continue building your skills with similar projects.
Sleek weather dashboard using OpenWeather API with geolocation, 5-day forecast, and dynamic weather themes.
Personal budget tracker with transaction log, category breakdown, and Chart.js pie charts.
Movie discovery app with TMDB API, trending lists, search, and detail modals.