# altruistech/ecd-online architecture

> Architecture diagram of the GitHub repository altruistech/ecd-online, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/altruistech/ecd-online
- Repository: https://github.com/altruistech/ecd-online

## Overview

ECD-Online is a Meteor information-management application for regional early-childhood-development services. Users navigate from the dashboard into organisation, facility, service, and staff records; the router subscribes to server-published data, while client views provide record interaction and dashboard/reporting displays. CSV-based data loading and quality assessments are additional capabilities. The shown excerpts establish routing, publication, and selected collection interactions; unsampled view wiring and some import/report details are therefore not inferred.

Main entry points: [`server/publications.js`](https://github.com/altruistech/ecd-online/blob/master/server/publications.js) (Access publications), [`both/router.js`](https://github.com/altruistech/ecd-online/blob/master/both/router.js) (Route subscriptions), [`both/collections/_service.js`](https://github.com/altruistech/ecd-online/blob/master/both/collections/_service.js) (Service records), [`client/views/deleteReloadAllData.js`](https://github.com/altruistech/ecd-online/blob/master/client/views/deleteReloadAllData.js) (CSV data loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and Views"]
  node_router["Route subscriptions<br/>[router.js]"]
  node_home["Dashboard<br/>[homeContent.js]"]
  node_organisation_ui["Organisation views<br/>[organisation.js]"]
  node_facility_ui["Facility views<br/>[facility.js]"]
  node_service_ui["Service views<br/>[service.js]"]
  node_staff_ui["Staff views<br/>[staff.js]"]
end

subgraph group_records["ECD Records"]
  node_service_records[("Service records<br/>[_service.js]")]
  node_facility_records[("Facility records<br/>[facility.js]")]
  node_organisation_records[("Organisation records<br/>[organisation.js]")]
  node_staff_records[("Staff records<br/>[staff.js]")]
  node_beneficiary_records[("Beneficiary groups")]
  node_facility_quality[("Facility quality")]
  node_service_quality[("Service quality")]
  node_methods["Data methods<br/>[methods.js]"]
  node_publications["Access publications<br/>[publications.js]"]
end

subgraph group_ingestion["Data Loading"]
  node_csv_load["CSV data loading"]
  node_csv_other["Other CSV import<br/>[readCSV-Other.js]"]
  node_csv_org["Organisation CSV import<br/>[readCSV.js]"]
  node_csv_quality["Quality CSV import<br/>[readCSVQ.js]"]
  node_seeds["Sample data seeding<br/>[seeds.js]"]
end

subgraph group_insights["Dashboard and Reports"]
  node_report_views["Report views<br/>[reportsTest.js]"]
  node_report_collections[("Reporting collections<br/>[_service.js]")]
end

node_user(("Application user"))
node_mongo[("MongoDB")]

node_user -.->|"opens routes"| node_router
node_router -->|"renders dashboard"| node_home
node_router -->|"routes organisation"| node_organisation_ui
node_router -->|"routes facility"| node_facility_ui
node_router -->|"routes service"| node_service_ui
node_router -->|"routes staff"| node_staff_ui
node_router -->|"subscribes data"| node_publications
node_publications -->|"publishes records"| node_service_records
node_publications -->|"publishes records"| node_facility_records
node_publications -->|"publishes records"| node_organisation_records
node_publications -->|"publishes records"| node_staff_records
node_publications -->|"publishes records"| node_beneficiary_records
node_publications -->|"publishes records"| node_facility_quality
node_publications -->|"publishes records"| node_service_quality
node_service_ui -->|"reads and updates"| node_service_records
node_home -->|"reads report data"| node_report_collections
node_report_views -->|"configures report tables"| node_report_collections
node_csv_load -->|"inserts records"| node_organisation_records
node_csv_load -->|"inserts records"| node_staff_records
node_csv_load -->|"inserts records"| node_service_records
node_seeds -->|"inserts samples"| node_facility_records
node_seeds -->|"inserts samples"| node_service_records
node_service_records -.->|"stores documents"| node_mongo
node_facility_records -.->|"stores documents"| node_mongo

click node_router "https://github.com/altruistech/ecd-online/blob/master/both/router.js"
click node_home "https://github.com/altruistech/ecd-online/blob/master/client/views/homeContent.js"
click node_organisation_ui "https://github.com/altruistech/ecd-online/blob/master/client/views/organisation.js"
click node_facility_ui "https://github.com/altruistech/ecd-online/blob/master/client/views/facility.js"
click node_service_ui "https://github.com/altruistech/ecd-online/blob/master/client/views/service.js"
click node_staff_ui "https://github.com/altruistech/ecd-online/blob/master/client/views/staff.js"
click node_service_records "https://github.com/altruistech/ecd-online/blob/master/both/collections/_service.js"
click node_facility_records "https://github.com/altruistech/ecd-online/blob/master/both/collections/facility.js"
click node_organisation_records "https://github.com/altruistech/ecd-online/blob/master/both/collections/organisation.js"
click node_staff_records "https://github.com/altruistech/ecd-online/blob/master/both/collections/staff.js"
click node_beneficiary_records "https://github.com/altruistech/ecd-online/blob/master/both/collections/servBenificiaryGroup.js"
click node_facility_quality "https://github.com/altruistech/ecd-online/blob/master/both/collections/facilityQualityECD.js"
click node_service_quality "https://github.com/altruistech/ecd-online/blob/master/both/collections/serviceQualityECD.js"
click node_methods "https://github.com/altruistech/ecd-online/blob/master/both/collections/methods.js"
click node_publications "https://github.com/altruistech/ecd-online/blob/master/server/publications.js"
click node_csv_load "https://github.com/altruistech/ecd-online/blob/master/client/views/deleteReloadAllData.js"
click node_csv_other "https://github.com/altruistech/ecd-online/blob/master/client/views/readCSV-Other.js"
click node_csv_org "https://github.com/altruistech/ecd-online/blob/master/client/views/readCSV.js"
click node_csv_quality "https://github.com/altruistech/ecd-online/blob/master/client/views/readCSVQ.js"
click node_seeds "https://github.com/altruistech/ecd-online/blob/master/server/startup/seeds.js"
click node_report_views "https://github.com/altruistech/ecd-online/blob/master/client/views/reportsTest.js"
click node_report_collections "https://github.com/altruistech/ecd-online/blob/master/both/collections/_service.js"

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_router,node_home,node_organisation_ui,node_facility_ui,node_service_ui,node_staff_ui,node_user toneBlue
class node_service_records,node_facility_records,node_organisation_records,node_staff_records,node_beneficiary_records,node_facility_quality,node_service_quality,node_methods,node_publications,node_mongo toneAmber
class node_csv_load,node_csv_other,node_csv_org,node_csv_quality,node_seeds toneMint
class node_report_views,node_report_collections toneRose
```

## Components

### Navigation and Views

- [Route subscriptions](https://github.com/altruistech/ecd-online/blob/master/both/router.js): `both/router.js`
- [Dashboard](https://github.com/altruistech/ecd-online/blob/master/client/views/homeContent.js): `client/views/homeContent.js`
- [Organisation views](https://github.com/altruistech/ecd-online/blob/master/client/views/organisation.js): `client/views/organisation.js`
- [Facility views](https://github.com/altruistech/ecd-online/blob/master/client/views/facility.js): `client/views/facility.js`
- [Service views](https://github.com/altruistech/ecd-online/blob/master/client/views/service.js): `client/views/service.js`
- [Staff views](https://github.com/altruistech/ecd-online/blob/master/client/views/staff.js): `client/views/staff.js`

### ECD Records

- [Service records](https://github.com/altruistech/ecd-online/blob/master/both/collections/_service.js): `both/collections/_service.js`
- [Facility records](https://github.com/altruistech/ecd-online/blob/master/both/collections/facility.js): `both/collections/facility.js`
- [Organisation records](https://github.com/altruistech/ecd-online/blob/master/both/collections/organisation.js): `both/collections/organisation.js`
- [Staff records](https://github.com/altruistech/ecd-online/blob/master/both/collections/staff.js): `both/collections/staff.js`
- [Beneficiary groups](https://github.com/altruistech/ecd-online/blob/master/both/collections/servBenificiaryGroup.js): `both/collections/servBenificiaryGroup.js`
- [Facility quality](https://github.com/altruistech/ecd-online/blob/master/both/collections/facilityQualityECD.js): `both/collections/facilityQualityECD.js`
- [Service quality](https://github.com/altruistech/ecd-online/blob/master/both/collections/serviceQualityECD.js): `both/collections/serviceQualityECD.js`
- [Data methods](https://github.com/altruistech/ecd-online/blob/master/both/collections/methods.js): `both/collections/methods.js`
- [Access publications](https://github.com/altruistech/ecd-online/blob/master/server/publications.js): `server/publications.js`

### Data Loading

- [CSV data loading](https://github.com/altruistech/ecd-online/blob/master/client/views/deleteReloadAllData.js): `client/views/deleteReloadAllData.js`
- [Other CSV import](https://github.com/altruistech/ecd-online/blob/master/client/views/readCSV-Other.js): `client/views/readCSV-Other.js`
- [Organisation CSV import](https://github.com/altruistech/ecd-online/blob/master/client/views/readCSV.js): `client/views/readCSV.js`
- [Quality CSV import](https://github.com/altruistech/ecd-online/blob/master/client/views/readCSVQ.js): `client/views/readCSVQ.js`
- [Sample data seeding](https://github.com/altruistech/ecd-online/blob/master/server/startup/seeds.js): `server/startup/seeds.js`

### Dashboard and Reports

- [Report views](https://github.com/altruistech/ecd-online/blob/master/client/views/reportsTest.js): `client/views/reportsTest.js`
- [Reporting collections](https://github.com/altruistech/ecd-online/blob/master/both/collections/_service.js): `both/collections/_service.js`

### Other components

- **Application user**
- **MongoDB**

## Connections

- Application user → Route subscriptions: opens routes
- Route subscriptions → Dashboard: renders dashboard (evidence: `both/router.js`)
- Route subscriptions → Organisation views: routes organisation (evidence: `both/router.js`)
- Route subscriptions → Facility views: routes facility (evidence: `both/router.js`)
- Route subscriptions → Service views: routes service (evidence: `both/router.js`)
- Route subscriptions → Staff views: routes staff (evidence: `both/router.js`)
- Route subscriptions → Access publications: subscribes data (evidence: `both/router.js`)
- Access publications → Service records: publishes records (evidence: `server/publications.js`)
- Access publications → Facility records: publishes records (evidence: `server/publications.js`)
- Access publications → Organisation records: publishes records (evidence: `server/publications.js`)
- Access publications → Staff records: publishes records (evidence: `server/publications.js`)
- Access publications → Beneficiary groups: publishes records (evidence: `server/publications.js`)
- Access publications → Facility quality: publishes records (evidence: `server/publications.js`)
- Access publications → Service quality: publishes records (evidence: `server/publications.js`)
- Service views → Service records: reads and updates (evidence: `client/views/service.js`)
- Dashboard → Reporting collections: reads report data (evidence: `client/views/homeContent.js`)
- Report views → Reporting collections: configures report tables (evidence: `client/views/reportsTest.js`)
- CSV data loading → Organisation records: inserts records (evidence: `client/views/deleteReloadAllData.js`)
- CSV data loading → Staff records: inserts records (evidence: `client/views/deleteReloadAllData.js`)
- CSV data loading → Service records: inserts records (evidence: `client/views/deleteReloadAllData.js`)
- Sample data seeding → Facility records: inserts samples (evidence: `server/startup/seeds.js`)
- Sample data seeding → Service records: inserts samples (evidence: `server/startup/seeds.js`)
- Service records → MongoDB: stores documents
- Facility records → MongoDB: stores documents
