Engineering ProjectsAndroid ProjectsBsc-ITDiplomaIOS ProjectsIT ProjectsMsc-IT Projects

Mobile Ticket Booking System Project – Travel with M-Ticket

Introduction

M-Ticket is not just a mobile application; it’s a game-changer in the world of local train ticket booking in Mumbai. This comprehensive guide aims to delve into the various features and benefits of the M-Ticket app, simplifying your train travel experience.

Modules & Functionality

The M-Ticket application comprises three primary modules:

  • Registration: The initial step that involves entering basic personal details to create a user profile.
  • Ticket Checker: Validates the e-tickets and ensures their authenticity.
  • Login: Serves as the gateway to various in-app features, detailed below.

Internal Functions within the Login Module

  • Check Time Table: Enables users to view local train timetables between two stations.
  • Purchase Ticket: Facilitates the booking of tickets with just a few clicks.
  • Show Ticket: Displays the most recently purchased ticket for the user.
  • Refill Account: Offers an easy method to recharge the account using a 14-digit code.
  • Check Balance: Keeps users informed about the remaining balance in their account.

Key Features

  • User-Friendly Interface: Intuitive design that provides a smooth user experience.
  • Modular Design: Allows users to install only the necessary modules on their device.
  • Effortless Recharge: Just like mobile recharge, refill your M-Ticket account with a 14-digit code.
  • Dual-Line Booking: Supports ticket booking for both Western and Central lines.
  • Client-Server Architecture: A single servlet can serve requests from multiple clients, making the app scalable.
  • Eco-Friendly: Emphasizes the use of e-tickets, contributing to a greener environment.

Conclusion

The M-Ticket app is revolutionizing the way people in Mumbai interact with their local train system. From user-friendly features to eco-friendly practices, the app is designed to make your local train journeys as hassle-free as possible.

Sample Code

from flask import Flask, request, jsonify

app = Flask(__name__)

# Simulated database
users = {}
tickets = {}
balances = {}

@app.route('/register', methods=['POST'])
def register():
    username = request.json.get('username')
    password = request.json.get('password')
    if username in users:
        return jsonify({"error": "Username already exists"}), 400
    users[username] = password
    balances[username] = 0
    return jsonify({"success": "User registered"}), 200

@app.route('/login', methods=['POST'])
def login():
    username = request.json.get('username')
    password = request.json.get('password')
    if username in users and users[username] == password:
        return jsonify({"success": "Logged in"}), 200
    return jsonify({"error": "Invalid username or password"}), 400

@app.route('/purchase_ticket', methods=['POST'])
def purchase_ticket():
    username = request.json.get('username')
    ticket_price = 50  # Sample ticket price
    
    if balances[username] >= ticket_price:
        balances[username] -= ticket_price
        tickets[username] = "Valid Ticket"
        return jsonify({"success": "Ticket purchased"}), 200
    else:
        return jsonify({"error": "Insufficient balance"}), 400

@app.route('/show_ticket', methods=['GET'])
def show_ticket():
    username = request.args.get('username')
    return jsonify({"ticket": tickets.get(username, "No ticket purchased")}), 200

@app.route('/refill_account', methods=['POST'])
def refill_account():
    username = request.json.get('username')
    refill_amount = request.json.get('refill_amount')
    balances[username] += refill_amount
    return jsonify({"success": f"Account refilled with {refill_amount}"}), 200

@app.route('/check_balance', methods=['GET'])
def check_balance():
    username = request.args.get('username')
    return jsonify({"balance": balances.get(username, 0)}), 200

if __name__ == '__main__':
    app.run(debug=True)
Click to rate this post!
[Total: 0 Average: 0]

Download Mobile Ticket Booking System Project – Travel with M-Ticket PDF


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button