← Pengyu Jie · back to portfolio

Personal course project · built solo · Oct 2025 – Jan 2026 build · Oct 2026 hardening and verification

Moto Micro Tours

A booking platform that connects motorcycle ride organisers with participants: organisers publish rides and take bookings as riders, participants book a specific rider; a booking goes through approval, a six-hour payment window and a two-sided completion check, and reviews open only at the very end.

I built it alone: Angular front end, ASP.NET Core + EF Core + MySQL back end, SignalR real-time chat (with polling as fallback). The six-hour payment window, the two-sided completion handshake and the review gate are rules the back end enforces, not decoration in the interface. Boundary: payment, refunds and rider payouts are simulated; there is no real payment gateway.

What was built, and when

October 2025 – January 2026 (course build): publishing and discovery, sign-up and approval, the six-hour simulated payment window, real-time chat, two-sided completion and the review gate — the whole booking flow in this page's screenshots was built in this phase.

October 2026 (follow-up maintenance): hardening and verification after a code audit — authorisation on payments and chat groups, seat concurrency control, idempotency-cache scoping, an empty-database start-up fix, and a working automated test suite again (34 tests). Details in sections 03 and 04.

Ride detail page from the participant's view: ride information, two riders' prices and free seats, and the booking button
What a participant sees on a ride: route information, each of the two riders' price and free seats, and the booking entry. Ride list → detail → booking is a stranger's first path.
01

One booking's journey

A booking passes six stops. At each one, only the right role can take the right action — that rule drives all of the engineering behind it.

  1. participant1 · participantPublished · booking requestRide detail page: two riders' prices, free seats and the Book Now button
    After choosing a ride and a rider, the booking form asks for an emergency contact and agreement to the safety rules — the rider needs these before setting off.
  2. motard1 · assigned riderPending · awaiting approvalPending request card on the rider dashboard: participant, date, price and approve/reject buttons
    A request takes no seat; it only lands on the rider's dashboard. Approving or rejecting is up to the assigned rider or the ride organiser.
  3. participant1 · participantApproved · six-hour payment windowBooking detail showing Approved - Payment Required and the highlighted payment deadline
    Approval starts the clock: the page highlights Payment Due = approval time + 6 hours (approved 14:07 → due 20:07). Unpaid by then, the booking lapses. Chat unlocks only after this.
  4. participant1 · participantPaid · one side confirmedCompletion block waiting for the rider's confirmation; no review entry
    The simulated payment takes the seat; after the ride the participant confirms completion first — the page says plainly that it is waiting for the rider. There is no review entry yet.
  5. after both confirmCompleted · reviews openLeave a Review block appears after both sides confirm completion
    Once the rider confirms on their own booking page, a review block appears on the same page. Compare with the previous stop: same view, and the review goes from absent to present.
  6. participant1 · participantCompleted · review submittedReview form: ride rating, rider rating and written review; submit is disabled until something is rated
    The ride and the rider can be rated separately, at least one of them; after submitting, the ride's review count goes from 0 to 1 — the loop is closed.
02

Business rules

The back end enforces all of these; the six stops above show them working for real.

03

Engineering

The Angular front end calls the ASP.NET Core API over a cookie session; SignalR pushes real-time messages; EF Core + MySQL store the business state. A booking's whole life runs on one state machine:

Who can do what

ActionAllowed roles and conditions
Request a bookingSigned-in participant; the ride must be Published and the chosen rider must have a free seat
Approve / rejectThe booking's assigned rider, or the ride organiser
PayOnly the booking's own participant; signed out 401, someone else's booking 403
Confirm completionParticipant and rider each confirm; complete only when both have
RefundAssigned rider or organiser; paid bookings only, and the rider payout is marked failed
Join the chat groupOnly the two sides of the booking; same rule over REST and SignalR
ReviewBoth sides of a booking after the handshake; one per booking per target

Concurrency: two payments racing for the last seat

The booking row and the seat row each carry an optimistic concurrency token maintained by the DbContext. Every update carries the value it read; of two concurrent payments, the later one finds the value changed, the whole transaction rolls back and the payment fails — instead of counting the seat twice. It behaves the same on MySQL, SQLite and the in-memory database, and has its own concurrency test.

Real time with a fallback: SignalR is not the only path

Messages are sent over REST (through the same authorisation as the page) and received over SignalR; joining a chat group checks membership with the same rule as the HTTP-side authorisation handler. The front end falls back to polling when joining fails, so the interface still works without SignalR.

Open the engineering evidence: course build and later hardening

Matches the main branch of the public repository. The commit history separates two phases — the course build from October 2025 to January 2026, and the hardening commits of October 2026; both belong to the GitHub account JayGarland.

Built during the course: sign-up, approval and the six-hour payment window (BookingsController.cs, Services/PaymentService.cs), the two-sided completion handshake, the review gate (ReviewsController.cs), role-based resource authorisation handlers (Authorization/), SignalR chat (Hubs/).

October 2026 hardening (fixes after a code audit): authentication and booking-ownership checks on the payment endpoint (PaymentsController.cs, previously unauthorised); chat-group membership checks (Services/ChatMembershipService.cs, previously any signed-in user could join any chat group); RowVersion concurrency tokens (AppDbContext.cs, where the model comments didn't match the actual configuration); the idempotency cache scoped per user and endpoint and moved after authorisation (Middleware/IdempotencyKeyMiddleware.cs); empty-MySQL start-up fix (Migrations/); a working test suite again (34 tests). Every issue the audit raised is closed or recorded in the repository.

04

Verification and evidence

Every screenshot on this page comes from one end-to-end walkthrough on 16 October 2026: an isolated, empty MySQL 8 database, the app's own migrations and seed data, the seeded demo accounts, and one booking completed only through the interface; the action, role and business state behind each screenshot are recorded in the walkthrough report in the repository.

Limits of the verification

The automated tests run on in-memory SQLite; the MySQL path is covered by that end-to-end walkthrough and one empty-database migration check. No continuous deployment, load testing or full penetration testing was done.

05

Boundaries and status

This is a course project built alone, to show I can build complete software with real business constraints by myself — it is not a live service.

Product, design and engineering: Pengyu Jie. Personal course project, built Oct 2025 – Jan 2026, hardened and verified Oct 2026. Angular · TypeScript · ASP.NET Core · EF Core · MySQL · SignalR.