Skip to content

RegManApp/RegMan.Backend

Repository files navigation

RegMan.Backend

RegMan backend is the ASP.NET Core Web API that enforces registration rules and exposes the HTTP + SignalR surface used by the frontend.

Tech Stack

  • ASP.NET Core (.NET 8)
  • Entity Framework Core + SQL Server
  • ASP.NET Identity
  • JWT authentication + role-based authorization (Admin/Student/Instructor)
  • SignalR (realtime chat + notifications)

Architecture Layers

The backend is structured as:

  • API (RegMan.Backend.API/): controllers, auth, middleware, Swagger, SignalR hubs
  • Business Layer (RegMan.Backend.BusinessLayer/): services and business rules
  • DAL (RegMan.Backend.DAL/): EF Core entities, repositories, Unit of Work, migrations

Clone & Run Locally

git clone https://github.com/RegManApp/RegMan.Backend
cd RegMan.Backend

dotnet restore

dotnet ef database update

dotnet run

Notes:

  • If you run from the repo root, you may prefer: dotnet run --project RegMan.Backend.API/RegMan.Backend.API.csproj.

  • If dotnet ef database update fails from the repo root, run:

    dotnet ef database update --project RegMan.Backend.DAL/RegMan.Backend.DAL.csproj --startup-project RegMan.Backend.API/RegMan.Backend.API.csproj
  • Default dev URLs (from launch settings): http://localhost:5236 and https://localhost:7025.

  • Swagger UI is available at /swagger.

Environment Variables

Required:

  • ConnectionStrings__DefaultConnection (SQL Server connection string)
  • Jwt__Key (JWT signing key, >= 32 characters)

Optional (enables Google Calendar integration; otherwise it is disabled):

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_REDIRECT_URI

MonsterASP hosting note

Some shared hosts (e.g., MonsterASP) may not reliably inject runtime environment variables. The Google Calendar integration also supports configuration-based secrets via RegMan.Backend.API/appsettings.Production.json:

{
  "Google": {
    "ClientId": "...",
    "ClientSecret": "...",
    "RedirectUri": "https://regman.runasp.net/api/integrations/google-calendar/callback"
  }
}

Integration endpoints:

  • Use GET /api/integrations/google-calendar/connect-url with JWT auth; the frontend then navigates to the returned URL.
  • GET /api/integrations/google-calendar/connect is legacy and JWT-protected; a plain browser navigation will not include the JWT header and will return 401.

MonsterASP configuration tips:

  • If your host supports web.config appSettings, you can set either flat keys (GOOGLE_CLIENT_ID) or hierarchical keys using the double-underscore form (Google__ClientId, Google__ClientSecret, Google__RedirectUri).
  • Restart the application after changing secrets; some hosts only apply changes on recycle.

Database & Migrations

  • EF Core migrations are stored under RegMan.Backend.DAL/Migrations/.
  • The API applies migrations at startup (Database.MigrateAsync()), but the repo also supports manual migration execution via dotnet ef database update.

If dotnet ef is not available, install it:

dotnet tool install --global dotnet-ef

Full Documentation

Deep technical docs (architecture rationale, auth details, full API reference) live in:

Contributors 4

  •  
  •  
  •  
  •  

Languages