# joel1-coder/rasi-maths-tution-centre architecture

> Architecture diagram of the GitHub repository joel1-coder/rasi-maths-tution-centre, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joel1-coder/rasi-maths-tution-centre
- Repository: https://github.com/joel1-coder/rasi-maths-tution-centre

## Overview

Rasi Maths is an education and tuition portal with public-facing pages, student and family information, learning resources, and administrative management. The browser enters through the routed Home or SiteAdmin experience; its client is configured to call the server’s tRPC endpoint. Server procedures enforce access rules and delegate domain operations to database helpers, while separate routes handle OAuth, uploads, and system notifications. The schema shows distinct academic and student-record domains. README documentation was absent, and several major UI and service files were not sampled, so their internal interactions are not inferred.

Main entry points: [`client/src/App.tsx`](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/App.tsx) (App routes), [`server/_core/index.ts`](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/index.ts) (HTTP server), [`server/routers.ts`](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/routers.ts) (tRPC procedures), [`server/db.ts`](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/db.ts) (Domain data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_entry["Client bootstrap<br/>[main.tsx]"]
  node_routes["App routes<br/>[App.tsx]"]
  node_home["Portal pages<br/>[Home.tsx]"]
  node_portfolio["Portfolio<br/>[Portfolio.tsx]"]
  node_siteadmin["Site admin<br/>[SiteAdmin.tsx]"]
end

subgraph group_api["API and domain"]
  node_api_server["HTTP server<br/>[index.ts]"]
  node_procedures["tRPC procedures<br/>[routers.ts]"]
  node_system["System procedures<br/>[systemRouter.ts]"]
  node_uploads["Cloudinary procedures"]
  node_context["Request context<br/>[context.ts]"]
end

subgraph group_identity["Identity and integrations"]
  node_cloudinary["Cloudinary operations<br/>[cloudinary.ts]"]
  node_notification["Owner notifications<br/>[notification.ts]"]
  node_oauth_routes["OAuth routes<br/>[oauth.ts]"]
  node_auth_sdk["Auth SDK<br/>[sdk.ts]"]
end

subgraph group_persistence["Persistence"]
  node_data["Domain data access<br/>[db.ts]"]
  node_schema["Education schema<br/>[schema.ts]"]
  node_database[("PostgreSQL")]
end

node_browser(("Portal user"))
node_oauth_provider["OAuth service"]

node_browser -->|"opens"| node_entry
node_entry -->|"renders"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_siteadmin
node_routes -.->|"routes to"| node_portfolio
node_home -->|"references"| node_portfolio
node_entry -->|"calls tRPC"| node_api_server
node_api_server -->|"mounts"| node_procedures
node_api_server -->|"creates context"| node_context
node_api_server -->|"registers routes"| node_oauth_routes
node_procedures -->|"calls"| node_data
node_procedures -->|"dispatches"| node_system
node_procedures -->|"dispatches"| node_uploads
node_system -->|"notifies"| node_notification
node_uploads -->|"uploads and transforms"| node_cloudinary
node_context -->|"uses"| node_auth_sdk
node_context -->|"reads user data"| node_data
node_oauth_routes -->|"uses"| node_auth_sdk
node_auth_sdk -->|"exchanges tokens"| node_oauth_provider
node_data -->|"queries"| node_schema
node_data -->|"reads and writes"| node_database

click node_entry "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/main.tsx"
click node_routes "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/App.tsx"
click node_home "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/Home.tsx"
click node_portfolio "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/Portfolio.tsx"
click node_siteadmin "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/SiteAdmin.tsx"
click node_api_server "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/index.ts"
click node_procedures "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/routers.ts"
click node_system "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/systemRouter.ts"
click node_uploads "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/cloudinaryRouter.ts"
click node_cloudinary "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/cloudinary.ts"
click node_notification "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/notification.ts"
click node_oauth_routes "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/oauth.ts"
click node_auth_sdk "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/sdk.ts"
click node_context "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/context.ts"
click node_data "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/db.ts"
click node_schema "https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/drizzle/schema.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_routes,node_home,node_portfolio,node_siteadmin,node_browser toneBlue
class node_api_server,node_procedures,node_system,node_uploads,node_context toneAmber
class node_cloudinary,node_notification,node_oauth_routes,node_auth_sdk toneMint
class node_data,node_schema,node_database toneRose
class node_oauth_provider toneIndigo
```

## Components

### Client experience

- [Client bootstrap](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/main.tsx): `client/src/main.tsx`
- [App routes](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Portal pages](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/Home.tsx): `client/src/pages/Home.tsx`
- [Portfolio](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/Portfolio.tsx): `client/src/pages/Portfolio.tsx`
- [Site admin](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/client/src/pages/SiteAdmin.tsx): `client/src/pages/SiteAdmin.tsx`

### API and domain

- [HTTP server](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/index.ts): `server/_core/index.ts`
- [tRPC procedures](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/routers.ts): `server/routers.ts`
- [System procedures](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/systemRouter.ts): `server/_core/systemRouter.ts`
- [Cloudinary procedures](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/cloudinaryRouter.ts): `server/cloudinaryRouter.ts`
- [Request context](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/context.ts): `server/_core/context.ts`

### Identity and integrations

- [Cloudinary operations](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/cloudinary.ts): `server/cloudinary.ts`
- [Owner notifications](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/notification.ts): `server/_core/notification.ts`
- [OAuth routes](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/oauth.ts): `server/_core/oauth.ts`
- [Auth SDK](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/_core/sdk.ts): `server/_core/sdk.ts`

### Persistence

- [Domain data access](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/server/db.ts): `server/db.ts`
- [Education schema](https://github.com/joel1-coder/rasi-maths-tution-centre/blob/main/drizzle/schema.ts): `drizzle/schema.ts`
- **PostgreSQL**

### Other components

- **Portal user**
- **OAuth service**

## Connections

- Portal user → Client bootstrap: opens (evidence: `client/src/main.tsx`)
- Client bootstrap → App routes: renders (evidence: `client/src/main.tsx`)
- App routes → Portal pages: routes to (evidence: `client/src/App.tsx`)
- App routes → Site admin: routes to (evidence: `client/src/App.tsx`)
- App routes → Portfolio: routes to
- Portal pages → Portfolio: references (evidence: `client/src/pages/Home.tsx`)
- Client bootstrap → HTTP server: calls tRPC (evidence: `client/src/main.tsx`)
- HTTP server → tRPC procedures: mounts (evidence: `server/_core/index.ts`)
- HTTP server → Request context: creates context (evidence: `server/_core/index.ts`)
- HTTP server → OAuth routes: registers routes (evidence: `server/_core/index.ts`)
- tRPC procedures → Domain data access: calls (evidence: `server/routers.ts`)
- tRPC procedures → System procedures: dispatches (evidence: `server/routers.ts`)
- tRPC procedures → Cloudinary procedures: dispatches (evidence: `server/routers.ts`)
- System procedures → Owner notifications: notifies (evidence: `server/_core/systemRouter.ts`)
- Cloudinary procedures → Cloudinary operations: uploads and transforms (evidence: `server/cloudinaryRouter.ts`)
- Request context → Auth SDK: uses (evidence: `server/_core/context.ts`)
- Request context → Domain data access: reads user data (evidence: `server/_core/context.ts`)
- OAuth routes → Auth SDK: uses (evidence: `server/_core/oauth.ts`)
- Auth SDK → OAuth service: exchanges tokens (evidence: `server/_core/sdk.ts`)
- Domain data access → Education schema: queries (evidence: `server/db.ts`)
- Domain data access → PostgreSQL: reads and writes (evidence: `server/db.ts`)
