Tram Ticket App

A digital ticketing system for tram services that allows users to:

  • Create an account
  • Purchase tram tickets
  • View purchased tickets
  • Generate QR codes for ticket validation
  • Scan and verify tickets

Project Structure

├── backend/
│   ├── database/
│   │   ├── migrations.ts    # Database schema
│   │   └── queries.ts       # Database operations
│   ├── routes/
│   │   ├── auth.ts          # Authentication routes
│   │   ├── tickets.ts       # Ticket management routes
│   │   └── verification.ts  # Ticket verification routes
│   └── index.ts             # Main API entry point
├── frontend/
│   ├── components/
│   │   ├── Auth.tsx         # Login/Register components
│   │   ├── TicketList.tsx   # Display purchased tickets
│   │   ├── TicketPurchase.tsx # Purchase new tickets
│   │   ├── TicketScanner.tsx # Scan tickets for verification
│   │   └── TicketView.tsx   # Display individual ticket with QR
│   ├── index.html           # Main HTML template
│   └── index.tsx            # Frontend entry point
└── shared/
    └── types.ts             # Shared type definitions

Features

  • User Authentication: Register and login functionality
  • Ticket Purchase: Buy tickets with different validity periods
  • Ticket Management: View purchased tickets and their status
  • QR Code Generation: Generate unique QR codes for each ticket
  • Ticket Verification: Scan QR codes to verify ticket validity
  • Admin Functions: Verify tickets and view usage statistics

Technologies

  • Backend: Hono.js API framework with SQLite database
  • Frontend: React with Tailwind CSS
  • QR Code: QR code generation and scanning libraries
  • Authentication: JWT-based authentication