Skip to content

Repository files navigation

ReservationEngine

A seat reservation system built with .NET Aspire. It provides a Blazor web frontend for browsing and reserving seats, backed by an API service that persists reservations in PostgreSQL.

Solution structure

  • ReservationEngine.AppHost — the Aspire orchestrator; wires up Postgres, Redis, and the two apps below for local development.
  • ReservationEngine.ApiService — minimal API exposing seat availability and reservation endpoints, backed by EF Core over PostgreSQL.
  • ReservationEngine.Web — Blazor Server frontend for viewing and reserving seats, using Redis for output caching.
  • ReservationEngine.ServiceDefaults — shared Aspire service defaults (health checks, telemetry, resilience) referenced by both apps.
  • ReservationEngine.Tests — integration tests built on the Aspire testing harness.

Prerequisites

  • .NET 10 SDK
  • Docker (or another OCI-compatible container runtime), used by Aspire to run Postgres and Redis locally

Running the app

Start the whole solution via the AppHost, which provisions Postgres and Redis in containers and launches both apps:

dotnet run --project ReservationEngine.AppHost

This opens the Aspire dashboard, from which you can reach the web frontend and API service and inspect logs, traces, and metrics.

API

Auth is handled by ASP.NET Core Identity, backed by PostgreSQL. Endpoints marked Admin require a bearer token for a user with the Admin role; Auth requires a bearer token for any signed-in user. Get a token from POST /api/auth/login. Everything else is open to anonymous callers.

Auth

  • POST /api/auth/login — sign in with { "email": "...", "password": "..." } (seeded users' email is their username, e.g. admin/demo); returns { tokenType, accessToken, expiresIn, refreshToken }.
  • GET /api/auth/me Auth — the signed-in user's id, username, and role.
  • POST /api/auth/register, POST /api/auth/refresh, and the rest of Identity's standard endpoints are also mapped under /api/auth.

Theaters

  • GET /api/theaters — list theaters.
  • GET /api/theaters/{theaterId} — get a theater.
  • POST /api/theaters Admin — create a theater.
  • PUT /api/theaters/{theaterId} Admin — update a theater.
  • DELETE /api/theaters/{theaterId} Admin — delete a theater.

Movies

  • GET /api/movies — list movies.
  • GET /api/movies/{movieId} — get a movie.
  • POST /api/movies Admin — create a movie.
  • PUT /api/movies/{movieId} Admin — update a movie.
  • DELETE /api/movies/{movieId} Admin — delete a movie.

Showings

  • GET /api/showings — list showings.
  • GET /api/showings/{showingId} — get a showing.
  • POST /api/showings Admin — create a showing.
  • PUT /api/showings/{showingId} Admin — update a showing.
  • DELETE /api/showings/{showingId} Admin — delete a showing.
  • GET /api/showings/{showingId}/seats/reserved — list currently reserved seat IDs for a showing.
  • POST /api/showings/{showingId}/reservations Auth — reserve one or more seats ({ "seatIds": ["A3", "B7"] }); returns a conflict response listing any seats already taken.

Running tests

dotnet test

About

A C#/.NET based reservation engine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages