Full-stack workshop operations and customer self-booking platform rebuilt from C++ into a live containerized system with dual portals, MySQL 8 locks, and automated invoicing.
ASP.NET Core 9 · React 19 · EF Core 9 · MySQL 8 · Docker · CI
Live production platform: Deployed at torquepro.software with HTTPS reverse proxy, dual portals, and MySQL 8 persistence.
Click screenshot to inspect
Rebuilding a C++ console app into a live web platform
The first version of TorquePro proved the workshop data model in a single-machine C++ console app, but real automotive workshops need customers booking from their own phones while service advisors, mechanics, and admins coordinate bays, spare parts, and invoicing concurrently.
TorquePro V2 is a ground-up rebuild deployed live at torquepro.software. Customers reserve 30-minute MYT slots and track 4-stage repair progress at /, while staff operate scheduling, SKU inventory, payment settlements, and audit logs behind hardened session auth at /staff.
2Isolated portals (/ & /staff)
5Clean Architecture layers
30mLocked MYT live slot intervals
4Docker services + CI quality gates
Core engineering pillars
Concurrency-safe scheduling
Shared MySQL GET_LOCK advisory locks serialize slot bookings, mechanic assignments, and stock mutations so concurrent requests cannot double-book bays.
Defense-in-depth & Anti-IDOR
Server-revokable HttpOnly SameSite=Strict session cookies, CSRF validation, 5-attempt FOR UPDATE lockout, and server-side ownership checks.
Atomic parts & auto-invoicing
Completing a job commits SKU inventory deductions, generates itemized INV-YYYY-00001 invoices, records DuitNow/Card/Cash payments, and logs JSON diffs.
One live booking, from portal to invoice
Scroll through all four operational stages to trace how a service booking travels across both portals on torquepro.software — or toggle either interactive simulator inside the console monitor.
01Isolated customer portal gateway
Public · /
Drivers enter through a dedicated customer portal separated cleanly from internal workshop routes, with self-registration and zero localStorage token exposure.
Routes public self-service cleanly at torquepro.software/
Customers pick available 30-minute MYT service slots, follow live 4-stage repair progress, see their assigned mechanic, inspect itemized parts, and print PDF receipts.
Real-time bay availability queried from GET /api/portal/availability
4-stage progress bar: Needs Review → Confirmed → In Progress → Completed
Transparent labour + spare parts breakdown with printable PDF receipts
03Hardened internal staff gateway
Internal · /staff
Staff and administrators sign in on a separate hardened route protected by revokable WorkshopSessions cookies, CSRF protection, and database-locked brute-force limits.
HttpOnly + SameSite=Strict cookies with server-side revocation
Completing jobs auto-issues INV-YYYY-00001 and commits SKU deductions
Captures DuitNow QR, Cash, Card, or Bank Transfer settlements with full audit trail
Customer Portal01 / 04
Customer Portal Sign In (/)
Dedicated public gateway at torquepro.software/ separated from internal operations, with self-registration and anti-IDOR ownership checks.
30-minute MYT slot availability
GET /api/portal/availability · 08:30–17:30 MYT
--- MYSQL GET_LOCK SERIALIZATION LOG ---
Click any free slot to reserve a bay, or hit "Simulate 2-user race" to watch MySQL GET_LOCK prevent double-booking.
Job #BK-1042 · Perodua Myvi (MCB 4821)
Step stages, toggle SKU parts, and settle invoice.
Stage: Needs Review
Labour (RM 100) + PartsRM 280.00
--- ATOMIC AUDIT & INVOICE LOG ---
Advance job to "4. Completed" to auto-generate INV-2026-00018, then record payment to unlock the PDF receipt.
Five decoupled layers, one domain core
Every request from torquepro.software crosses strict Clean Architecture boundaries before reaching MySQL 8 locks. Select any node below to trace live dependencies and inspect its runtime guarantees.
domain-core (Application & Domain Core)
Framework-independent business rules enforcing 30-minute MYT slot eligibility, 4-stage job transitions, spare parts price snapshotting, and automated invoice totals.
PaymentCapture (DuitNow QR | Card | Cash | Transfer)
AuditDiffBuilder (Append-Only JSON Diff)
Live workshop telemetry at a glance
The staff dashboard at torquepro.software/staff aggregates real-time Malaysian Time (MYT) bay load, monthly collected revenue, unpaid invoice balances, and low-stock SKU alerts. Inspect the interactive 7-day chart below — or flip to the live production dashboard capture.
WORKSHOP OPERATIONS TELEMETRY · 7-DAY MYT
RM 520Collected this month
RM 185Outstanding balance
7Total tracked appointments
2Low-stock SKU alerts
2
Today
2
Thu
1
Fri
0
Sat
0
Sun
0
Mon
0
Tue
Needs Attention queue: 1 review request · 1 awaiting mechanic · 1 unpaid invoice · 2 low-stock SKUsActive roster: 3 mechanics · 5 active SKUs tracked · Malaysia Time (MYT)
Inside the full-stack engine
Inspect how security hardening, MySQL concurrency control, atomic inventory invoicing, and automated CI quality gates hold together in production.
Defense-in-depth sessions & ownership checks
Instead of exposing JWTs in localStorage, TorquePro issues server-revokable WorkshopSessions cookies (HttpOnly, SameSite=Strict), performs constant-time dummy password hashing, locks brute-force attempts via SELECT ... FOR UPDATE, and verifies customer record ownership on every endpoint.
Isolated internal route (/staff)Separated from public customer sign-in with logged auth attempts and CSRF validation.
SECURITY PIPELINE · ASP.NET CORE 9
1. Reverse Proxy (Nginx same-origin HTTPS)
└─ Zero cross-origin credential leaks
2. Rate Limiter (60 req/min per client)
└─ Protects /api/auth/* & booking endpoints
3. Auth Handler + SELECT ... FOR UPDATE
├─ Constant-time dummy hash on unknown user
├─ 5 failed attempts -> temporary account lock
└─ Issues HttpOnly, SameSite=Strict cookie
4. Anti-IDOR Ownership Guard
└─ Every /api/portal/* query scopes WHERE CustomerId = Session.UserId
Concurrency-safe 30-minute MYT slot serialization
Application-level slot checks race when two drivers click the final bay simultaneously. TorquePro acquires a shared MySQL GET_LOCK advisory lock before checking bay capacity, vehicle overlap, and mechanic availability — ensuring only one transaction commits while the other receives a clean 409 Conflict.
TRANSACTION FLOW · MYSQL 8 ADVISORY LOCK
BEGIN TRANSACTION;
SELECT GET_LOCK('torquepro:booking:2026-11-25', 5);
-- 1. Verify MYT operating window (08:30–17:30)
-- 2. Verify bay capacity < MaxConcurrentBays
-- 3. Verify vehicle has zero overlapping slots
-- 4. Verify assigned mechanic is free
INSERT INTO Appointments (...);
SELECT RELEASE_LOCK('torquepro:booking:2026-11-25');
COMMIT;
VERIFIED RACE OUTCOMES · INTEGRATION SUITE
Test: ConcurrentBooking_LastAvailableBay_ReturnsSingleSuccess
Request A (POST /api/portal/bookings · 10:00 MYT)
└─ Acquires lock first -> 201 Created (BK-1042)
Request B (POST /api/portal/bookings · 10:00 MYT)
└─ Waits on lock, re-reads bay count (full)
└─ Rejects cleanly -> 409 Conflict (Slot unavailable)
Result: 0 double-booked mechanics · 0 vehicle overlaps
Atomic spare parts deductions, auto-invoicing & audit trail
Moving a booking to Completed atomically decrements attached SKU stock, snapshots unit prices into an itemized INV-YYYY-00001 invoice (Labour + Parts), accepts partial or full settlements (DuitNow QR, Cash, Card, Transfer), unlocks printable PDF receipts, and appends a JSON diff to the admin audit log.
Live customer receipt viewShows assigned mechanic, labour subtotal, SKU parts used, and printable receipt access.
ATOMIC COMPLETION & AUDIT LEDGER
On Job Status -> Completed:
1. Reserve & deduct SpareParts.StockQty atomically
2. Snapshot Labour + Parts line items (immutable prices)
3. Generate sequential InvoiceNumber: INV-2026-00018
4. Append AuditLog entry:
{
"actor": "Ahmad Faizal (Admin)",
"entity": "Appointment#101",
"diff": { "status": ["InProgress", "Completed"] }
}
5. Payment recorded (DuitNow QR / Card / Cash)
-> Printable PDF receipt unlocked on /portal
Four-container Docker Compose stack & CI quality gates
TorquePro deploys reproducibly as four isolated Docker services with readiness health probes and an automated GitHub Actions pipeline running unit tests, real MySQL 8 integration suites, and headless Playwright end-to-end checks.
DOCKER COMPOSE TOPOLOGY · PRODUCTION
services:
db: MySQL 8.0 (persistent volume + healthcheck)
migrate: One-shot EF Core 9 --migrate runner (exits 0)
api: ASP.NET Core 9 HTTP API (/health/ready probe)
web: React 19 static build behind Nginx reverse proxy
Live Edge: HTTPS reverse proxy -> https://torquepro.software
AUTOMATED CI PIPELINE · GITHUB ACTIONS
Gate 01 dotnet test (xUnit Domain & Application unit tests)
Gate 02 WebApplicationFactory against real MySQL 8 container
├─ Advisory lock race & conflict assertions
└─ Anti-IDOR & session revocation assertions
Gate 03 npm run build (Vite 8 + TypeScript + Tailwind 4)
Gate 04 Playwright E2E across customer & staff portals
From C++ console to live platform
Comparing the original Workshop I C++ console build against the live containerized platform now running at torquepro.software.
Dimension
TorquePro v1 (Workshop I)
TorquePro V2 (Live at torquepro.software)
Stack & Architecture
Single C++ console app connected directly to local MySQL (XAMPP)
Clean Architecture across ASP.NET Core 9, React 19, EF Core 9, and MySQL 8
Access & Security
Shared console menu with direct credential queries