MyPortal

Architecture

How the MyPortal solution is laid out, and how SQL is versioned and applied.

MyPortal is modular and API-first. The backend is an ASP.NET Core Web API, the frontend is a separate Angular application that talks to it over HTTP, and all schema changes are versioned in a dedicated migrations project.

Repository layout

ProjectResponsibility
MyPortal.WebApiASP.NET Core host and HTTP endpoints
MyPortal.DataRepositories, Dapper queries, embedded SQL
MyPortal.MigrationsConsole runner that creates and updates the schema
MyPortal.CoreDomain entities
MyPortal.ContractsRequest and response DTOs
MyPortal.CommonShared interfaces and utilities
MyPortal.AuthAuthentication and authorisation
MyPortal.ServicesBusiness logic between the API and the data layer
MyPortal.TimetablerTimetabling logic
MyPortal.FileStorageDocument and attachment storage
MyPortal.Frontend/myportal-spaAngular SPA
MyPortal.TestsBackend tests

Cross-cutting concerns

Permissions, auditing, and safeguarding controls are handled centrally rather than per-module. A module gets access control and an audit trail by being part of the system, not by reimplementing them.

The SPA serves staff, students, and parents from one application, with role-based routing deciding what each of them sees.

How SQL is managed

SQL lives in two places, and the distinction matters.

Schema changes — MyPortal.Migrations/Sql

  • Updates/ — one-shot migrations, applied once each, in filename order.
  • StoredProcedures/, Functions/, Views/, Indexes/ — re-applied on every run, so they are written as idempotent CREATE OR ALTER statements.

Runtime queries — MyPortal.Data/Sql

Query templates used by repositories at runtime.

Both directories are embedded resources. A new .sql file must be registered as an EmbeddedResource in the owning .csprojMyPortal.Migrations.csproj or MyPortal.Data.csproj — or it will not be found at runtime.

Database support

SQL Server 2019 or newer is the supported database today. Additional providers are planned, but the embedded SQL is currently written against SQL Server.

Authentication

Authentication uses OAuth 2.0 and OpenID Connect, so identity can be delegated to a provider the school already runs rather than being managed inside MyPortal.