# bcgov/myss-web architecture

> Architecture diagram of the GitHub repository bcgov/myss-web, 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/bcgov/myss-web
- Repository: https://github.com/bcgov/myss-web

## Overview

myss-web is the SvelteKit frontend for BC’s MySelfServe income-assistance portal. A client uses it to register or sign in, then manage account details and complete service requests, employment plans, monthly reports, messages, and payment information; workers have separate admin and support-view capabilities. The frontend communicates with the related API, and a standalone eligibility estimator posts applicant details for an estimate. Several route and API implementations were not sampled, so those capabilities are represented by their documented source directories; inferred route-to-API links are dashed.

Main entry points: [`eligibility-estimator/src/EligibilityEstimatorComponent.svelte`](https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimatorComponent.svelte) (Estimator form), [`src/routes/service-requests`](https://github.com/bcgov/myss-web/tree/main/src/routes/service-requests) (Service requests), [`src/lib/api/service-requests.ts`](https://github.com/bcgov/myss-web/blob/main/src/lib/api/service-requests.ts) (Service request API), [`src/routes/admin`](https://github.com/bcgov/myss-web/tree/main/src/routes/admin) (Admin tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Client portal"]
  node_portal["Portal shell"]
  node_registration["Registration"]
  node_account["Account"]
  node_messages["Messages"]
  node_payments["Payment info"]
end

subgraph group_workflows["Applications and reporting"]
  node_service["Service requests"]
  node_serviceapi["Service request API"]
  node_plans["Employment plans"]
  node_reports["Monthly reports"]
end

subgraph group_worker["Worker tools"]
  node_admin["Admin tools"]
  node_support["Support view"]
  node_adminapi["Admin API<br/>[admin.ts]"]
end

subgraph group_shared["Shared services"]
  node_api["API client<br/>[client.ts]"]
end

subgraph group_estimator["Eligibility estimator"]
  node_estimator["Estimator form"]
  node_estimatorapi["Eligibility API<br/>[eligibility.ts]"]
  node_estimate["Estimate result"]
  node_element["Custom element shell"]
end

node_client(("Client"))
node_worker(("Worker"))
node_backend[("MySelfServe API")]

node_client -->|"uses"| node_portal
node_client -.->|"registers"| node_registration
node_client -.->|"manages account"| node_account
node_client -.->|"uses"| node_messages
node_client -.->|"views payment"| node_payments
node_client -.->|"requests service"| node_service
node_client -.->|"manages plans"| node_plans
node_client -.->|"submits reports"| node_reports
node_worker -->|"uses"| node_admin
node_worker -.->|"views clients"| node_support
node_admin -.->|"requests data"| node_adminapi
node_service -.->|"requests"| node_serviceapi
node_serviceapi -->|"calls"| node_api
node_api -->|"sends requests"| node_backend
node_client -->|"enters details"| node_estimator
node_element -->|"wraps"| node_estimator
node_estimator -->|"calculates"| node_estimatorapi
node_estimatorapi -->|"posts estimate"| node_backend
node_estimator -->|"displays result"| node_estimate

click node_portal "https://github.com/bcgov/myss-web/tree/main/src/routes"
click node_registration "https://github.com/bcgov/myss-web/tree/main/src/routes/registration"
click node_account "https://github.com/bcgov/myss-web/tree/main/src/routes/account"
click node_messages "https://github.com/bcgov/myss-web/tree/main/src/routes/messages"
click node_payments "https://github.com/bcgov/myss-web/tree/main/src/routes/payment-info"
click node_service "https://github.com/bcgov/myss-web/tree/main/src/routes/service-requests"
click node_serviceapi "https://github.com/bcgov/myss-web/blob/main/src/lib/api/service-requests.ts"
click node_plans "https://github.com/bcgov/myss-web/tree/main/src/routes/employment-plans"
click node_reports "https://github.com/bcgov/myss-web/tree/main/src/routes/monthly-report"
click node_admin "https://github.com/bcgov/myss-web/tree/main/src/routes/admin"
click node_support "https://github.com/bcgov/myss-web/tree/main/src/routes/admin/support-view"
click node_adminapi "https://github.com/bcgov/myss-web/blob/main/src/lib/api/admin.ts"
click node_api "https://github.com/bcgov/myss-web/blob/main/src/lib/api/client.ts"
click node_estimator "https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimatorComponent.svelte"
click node_estimatorapi "https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/api/eligibility.ts"
click node_estimate "https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimatorComponent.svelte"
click node_element "https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimator.svelte"

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_portal,node_registration,node_account,node_messages,node_payments,node_client toneBlue
class node_service,node_serviceapi,node_plans,node_reports,node_backend toneAmber
class node_admin,node_support,node_adminapi toneMint
class node_api,node_worker toneRose
class node_estimator,node_estimatorapi,node_estimate,node_element toneIndigo
```

## Components

### Client portal

- [Portal shell](https://github.com/bcgov/myss-web/tree/main/src/routes): `src/routes`
- [Registration](https://github.com/bcgov/myss-web/tree/main/src/routes/registration): `src/routes/registration`
- [Account](https://github.com/bcgov/myss-web/tree/main/src/routes/account): `src/routes/account`
- [Messages](https://github.com/bcgov/myss-web/tree/main/src/routes/messages): `src/routes/messages`
- [Payment info](https://github.com/bcgov/myss-web/tree/main/src/routes/payment-info): `src/routes/payment-info`

### Applications and reporting

- [Service requests](https://github.com/bcgov/myss-web/tree/main/src/routes/service-requests): `src/routes/service-requests`
- [Service request API](https://github.com/bcgov/myss-web/blob/main/src/lib/api/service-requests.ts): `src/lib/api/service-requests.ts`
- [Employment plans](https://github.com/bcgov/myss-web/tree/main/src/routes/employment-plans): `src/routes/employment-plans`
- [Monthly reports](https://github.com/bcgov/myss-web/tree/main/src/routes/monthly-report): `src/routes/monthly-report`

### Worker tools

- [Admin tools](https://github.com/bcgov/myss-web/tree/main/src/routes/admin): `src/routes/admin`
- [Support view](https://github.com/bcgov/myss-web/tree/main/src/routes/admin/support-view): `src/routes/admin/support-view`
- [Admin API](https://github.com/bcgov/myss-web/blob/main/src/lib/api/admin.ts): `src/lib/api/admin.ts`

### Shared services

- [API client](https://github.com/bcgov/myss-web/blob/main/src/lib/api/client.ts): `src/lib/api/client.ts`

### Eligibility estimator

- [Estimator form](https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimatorComponent.svelte): `eligibility-estimator/src/EligibilityEstimatorComponent.svelte`
- [Eligibility API](https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/api/eligibility.ts): `eligibility-estimator/src/api/eligibility.ts`
- [Estimate result](https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimatorComponent.svelte): `eligibility-estimator/src/EligibilityEstimatorComponent.svelte`
- [Custom element shell](https://github.com/bcgov/myss-web/blob/main/eligibility-estimator/src/EligibilityEstimator.svelte): `eligibility-estimator/src/EligibilityEstimator.svelte`

### Other components

- **Client**
- **Worker**
- **MySelfServe API**

## Connections

- Client → Portal shell: uses (evidence: `README.md`)
- Client → Registration: registers
- Client → Account: manages account
- Client → Messages: uses
- Client → Payment info: views payment
- Client → Service requests: requests service
- Client → Employment plans: manages plans
- Client → Monthly reports: submits reports
- Worker → Admin tools: uses (evidence: `README.md`)
- Worker → Support view: views clients
- Admin tools → Admin API: requests data
- Service requests → Service request API: requests
- Service request API → API client: calls (evidence: `src/lib/api/service-requests.ts`)
- API client → MySelfServe API: sends requests (evidence: `src/lib/api/client.ts`)
- Client → Estimator form: enters details (evidence: `eligibility-estimator/src/EligibilityEstimatorComponent.svelte`)
- Custom element shell → Estimator form: wraps (evidence: `eligibility-estimator/src/EligibilityEstimator.svelte`)
- Estimator form → Eligibility API: calculates (evidence: `eligibility-estimator/src/EligibilityEstimatorComponent.svelte`)
- Eligibility API → MySelfServe API: posts estimate (evidence: `eligibility-estimator/src/api/eligibility.ts`)
- Estimator form → Estimate result: displays result (evidence: `eligibility-estimator/src/EligibilityEstimatorComponent.svelte`)
