Role | Name | GitHub |
---|---|---|
Mentor | Jaber Kibria | |
Team Member | Md Nazmul Hossain | |
Sujan Roy | ||
Rabbani Islam Refat |
The QR Code-Based Metro Ticketing System is your smart companion for hassle-free metro travel. Say goodbye to long queues and paper tickets β with just a few taps, generate a secure QR code, scan it at the station gates, and youβre on your way.
- QR Code Ticketing: Instantly generate secure QR codes for your journey β no need for paper tickets.
- Automatic Fare Deduction: Automatically records entry and exit stations to calculate and deduct the exact fare.
- Seamless Digital Payments: Add balance using mobile banking, credit/debit cards, or digital wallets.
- Travel & Transaction History: View detailed logs of your trips, fare deductions, and top-ups.
- Multi-Ticket Support: Manage multiple tickets for group or family travel under a single account.
- Offline QR Support: Generate QR codes in advance and use them even when offline.
- Admin Controls: Admin dashboard to manage stations, configure system settings, and monitor overall system activity.
Experience the QR Code-Based Metro Ticketing System in action by visiting our live demo:
-
Home Page
URL: https://dhakametrorailbd.bsite.net/
The landing page where users can register or log in, check fare, generate RapidPass QR codes, purchase QR tickets, add wallet balance, and view recent trips. -
Admin Dashboard
URL: https://dhakametrorailbd.bsite.net/Admin/
The admin dashboard for managing stations, configuring system settings, and monitoring overall system activity.Login Credentials: (
admin@gmail.com
andadmin123
) -
Scanner Interface
URL: https://dhakametrorailbd.bsite.net/System/Scanner
This interface is used by the metro station system to scan and validate QR code tickets in real time.
This project follows Clean Architecture principles and incorporates industry best practices to ensure modularity, testability, and maintainability.
- Presentation Layer (
.Web
): Handles UI rendering and HTTP requests using ASP.NET Core MVC, Razor Views, and APIs. - Application Layer: Contains use-case-specific business logic, service interfaces, and DTOs.
- Domain Layer: Encapsulates core entities, value objects, and domain rules β independent of frameworks or infrastructure concerns.
- Infrastructure Layer: Provides implementations for data access, external integrations, and repository logic.
This project follows well-established industry best practices, including:
- Dependency Injection: Enables loose coupling and improves flexibility and testability.
- Repository Pattern: Abstracts data access logic, making the codebase more maintainable and testable.
- Service Layer Abstraction: Encapsulates business logic and ensures a clear separation of concerns.
- Unit of Work: Maintains database consistency by coordinating transactions across multiple repositories.
Illustrates the main interactions between users and the system.
Describes the system's data model and relationships among entities.
erDiagram
Admin ||--o{ Station : manages
Station ||--o{ StationDistance : relates
Station ||--o{ Trip : entry_exit
User ||--|| Wallet : owns
User ||--o{ Ticket : has
Ticket ||--|| Trip : linked
Wallet ||--o{ Transaction : records
User ||--o{ Trip : makes
Ticket ||--o{ Transaction : pays
User ||--o{ UserToken : authenticates
Admin {
int Id PK
string Email
string PasswordHash
datetime CreatedAt
datetime LastLoginAt
}
Station {
int Id PK
string Name
string Address
decimal Latitude
decimal Longitude
int Order
string Status
datetime CreatedAt
datetime UpdatedAt
}
StationDistance {
int Id PK
int Station1Id FK
int Station2Id FK
decimal Distance
datetime CreatedAt
datetime UpdatedAt
}
SystemSettings {
int Id PK
decimal MinFare
decimal FarePerKm
int RapidPassQrCodeValidityMinutes
int QrTicketValidityMinutes
int MaxTripDurationMinutes
decimal TimeLimitPenaltyFee
datetime CreatedAt
datetime UpdatedAt
}
Ticket {
int Id PK
int UserId FK
enum TicketType
int OriginStationId FK
int DestinationStationId FK
decimal FareAmount
string QRCodeData
datetime CreatedAt
datetime ExpiryTime
enum TicketStatus
string TransactionReference
}
Trip {
int Id PK
int UserId FK
int TicketId FK
int EntryStationId FK
int ExitStationId FK
datetime EntryTime
datetime ExitTime
decimal FareAmount
enum TripStatus
string TransactionReference
}
Transaction {
int Id PK
int WalletId FK
decimal Amount
enum TransactionType
enum PaymentMethod
enum PaymentItem
enum TransactionStatus
string TransactionReference
string Description
datetime CreatedAt
datetime UpdatedAt
}
Wallet {
int Id PK
int UserId FK
decimal Balance
datetime CreatedAt
datetime UpdatedAt
}
User {
int Id PK
string FullName
string Email
string PhoneNumber
string NID
string PasswordHash
bool IsEmailVerified
datetime CreatedAt
datetime UpdatedAt
}
UserToken {
int Id PK
string Email
string Token
enum TokenType
datetime ExpiryDate
bool IsUsed
}
![]() |
![]() |
|
The deployment environment must satisfy the following prerequisites:
- .NET 8.0 SDK or later
- SQL Server
- Redis
- Visual Studio / Visual Studio Code
-
Clone the repository:
git clone https://github.com/Learnathon-By-Geeky-Solutions/netninjas cd netninjas
-
Configuration Settings
Edit the
appsettings.json
file located at:
QRCodeBasedMetroTicketingSystem/QRCodeBasedMetroTicketingSystem.Web/appsettings.json
with the following settings:{ "ConnectionStrings": { "DefaultConnection": "your_sql_server_connection_string", "RedisConnectionString": "your_redis_connection_string" }, "AdminSettings": { "DefaultEmail": "admin@gmail.com", "DefaultPassword": "admin123" }, "EmailSettings": { "SmtpServer": "your_smtp_server", "SmtpPort": your_smtp_port, "SmtpUsername": "your_smtp_username", "SmtpPassword": "your_smtp_password" }, "JwtSettings": { "SecretKey": "your_jwt_secret_key" }, "QRCodeSecretKey": "your_qr_code_secret_key" }
-
Database Setup:
Run the Entity Framework Core migration to create the database schema.
-
Using Command Prompt / Terminal:
dotnet ef database update
-
Or, using Visual Studio (Package Manager Console):
Update-Database
π‘ Ensure that the Default Project in the Package Manager Console is set to
QRCodeBasedMetroTicketingSystem.Infrastructure
-
-
Build and Run the Application
Now you are ready to build and run the project:
-
Using Command Prompt / Terminal:
dotnet build dotnet run
-
Or, using Visual Studio:
- Press
Ctrl + F5
to build and run without debugging - Or press
F5
to run with debugging
- Press
Once the application is running, open your browser and navigate to:
https://localhost:7157
π Update the URL above if your application is configured to run on a different port.
-
Once the application is running, you can access the following interfaces:
-
Home Page
URL: https://localhost:7157/
This is the landing page for users to explore and interact with the system. -
Admin Dashboard
URL: https://localhost:7157/Admin/
Use the default admin credentials defined in yourappsettings.json
underAdminSettings
. -
Scanner Interface
URL: https://localhost:7157/System/Scanner
This interface allows scanning and validating QR-based metro tickets.
π‘ Replace
localhost:7157
with your actual domain or deployed URL when in a non-local environment.