# terna27/tech-ratels architecture

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

- Interactive diagram: https://gitdiagram.com/terna27/tech-ratels
- Repository: https://github.com/terna27/tech-ratels

## Overview

Nigerian Ratels Management System is a web platform for membership, regional operations, events, finance, communications, and public reporting. Members and administrators use the Next.js interface; the Go API provides authentication and domain operations backed by PostgreSQL. The README documents cleanup scheduling, participation review, governance, and foundation safeguards, while the tree shows broader marketplace, careers, inventory, gallery, and safeguarding capabilities. Edges are limited to relationships visible in excerpts; several domain modules are represented by their exact implementation paths, but their internal call chains were not sampled.

Main entry points: [`apps/api/internal/service/report_service.go`](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/report_service.go) (Reports and exports), [`apps/api/cmd/server/main.go`](https://github.com/terna27/tech-ratels/blob/main/apps/api/cmd/server/main.go) (HTTP API), [`apps/api/internal/service/auth_service.go`](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/auth_service.go) (Authentication), [`apps/web/src/app/page.tsx`](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/page.tsx) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_ui["Web interface<br/>[page.tsx]"]
  node_admin_ui["Admin workspace<br/>[page.tsx]"]
  node_finance_ui["Finance console<br/>[page.tsx]"]
  node_inventory_ui["Inventory console<br/>[page.tsx]"]
  node_market_ui["Marketplace pages<br/>[page.tsx]"]
  node_career_ui["Careers pages<br/>[page.tsx]"]
  node_gallery_ui["Gallery pages<br/>[page.tsx]"]
end

subgraph group_api["API and identity"]
  node_api_server["HTTP API<br/>[main.go]"]
  node_auth["Authentication<br/>[auth_service.go]"]
  node_repository["Data repository<br/>[repository.go]"]
  node_postgres[("PostgreSQL")]
  node_notifications["Notifications"]
end

subgraph group_operations["Regional operations"]
  node_cleanup["Cleanup events<br/>[cleanup_service.go]"]
  node_participation["Participation review"]
  node_geography["Geographic hierarchy"]
  node_safeguarding["Safeguarding"]
end

subgraph group_commerce["Commerce and resources"]
  node_finance["Finance management<br/>[finance_service.go]"]
  node_inventory["Inventory management"]
  node_marketplace["Marketplace"]
  node_careers["Careers<br/>[careers_service.go]"]
  node_gallery["Gallery media<br/>[gallery_service.go]"]
end

subgraph group_reporting["Reporting and integrations"]
  node_reports["Reports and exports<br/>[report_service.go]"]
  node_report_scheduler["Report scheduler"]
  node_report_storage["Export storage"]
end

node_members(("Members and staff"))
node_r2[("Cloudflare R2")]

node_members -.->|"uses"| node_web_ui
node_web_ui -->|"requests overview"| node_reports
node_api_server -->|"connects"| node_postgres
node_api_server -->|"starts"| node_report_scheduler
node_api_server -->|"constructs"| node_reports
node_auth -->|"uses"| node_repository
node_auth -->|"sends verification"| node_notifications
node_repository -.->|"accesses data"| node_postgres
node_report_scheduler -->|"schedules"| node_reports
node_reports -.->|"stores exports"| node_report_storage
node_report_storage -.->|"stores objects"| node_r2
node_marketplace -.->|"handles domain operations"| node_marketplace

click node_web_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/page.tsx"
click node_admin_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/page.tsx"
click node_finance_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/finance/page.tsx"
click node_inventory_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/inventory/page.tsx"
click node_market_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/marketplace/seller/page.tsx"
click node_career_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/careers/employer/page.tsx"
click node_gallery_ui "https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/gallery/page.tsx"
click node_api_server "https://github.com/terna27/tech-ratels/blob/main/apps/api/cmd/server/main.go"
click node_auth "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/auth_service.go"
click node_repository "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/repository/repository.go"
click node_cleanup "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/cleanup_service.go"
click node_participation "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/participation_service.go"
click node_geography "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/geography_service.go"
click node_finance "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/finance_service.go"
click node_inventory "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/inventory_service.go"
click node_marketplace "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/marketplace_service.go"
click node_careers "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/careers_service.go"
click node_gallery "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/gallery_service.go"
click node_safeguarding "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/safeguarding_service.go"
click node_notifications "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/notification_service.go"
click node_reports "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/report_service.go"
click node_report_scheduler "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/worker/report_scheduler.go"
click node_report_storage "https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/storage/report_export_storage.go"

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_web_ui,node_admin_ui,node_finance_ui,node_inventory_ui,node_market_ui,node_career_ui,node_gallery_ui toneBlue
class node_api_server,node_auth,node_repository,node_postgres,node_notifications,node_r2 toneAmber
class node_cleanup,node_participation,node_geography,node_safeguarding toneMint
class node_finance,node_inventory,node_marketplace,node_careers,node_gallery toneRose
class node_reports,node_report_scheduler,node_report_storage,node_members toneIndigo
```

## Components

### Web application

- [Web interface](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/page.tsx): `apps/web/src/app/page.tsx`
- [Admin workspace](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/page.tsx): `apps/web/src/app/admin/page.tsx`
- [Finance console](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/finance/page.tsx): `apps/web/src/app/admin/finance/page.tsx`
- [Inventory console](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/admin/inventory/page.tsx): `apps/web/src/app/admin/inventory/page.tsx`
- [Marketplace pages](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/marketplace/seller/page.tsx): `apps/web/src/app/marketplace/seller/page.tsx`
- [Careers pages](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/careers/employer/page.tsx): `apps/web/src/app/careers/employer/page.tsx`
- [Gallery pages](https://github.com/terna27/tech-ratels/blob/main/apps/web/src/app/gallery/page.tsx): `apps/web/src/app/gallery/page.tsx`

### API and identity

- [HTTP API](https://github.com/terna27/tech-ratels/blob/main/apps/api/cmd/server/main.go): `apps/api/cmd/server/main.go`
- [Authentication](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/auth_service.go): `apps/api/internal/service/auth_service.go`
- [Data repository](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/repository/repository.go): `apps/api/internal/repository/repository.go`
- **PostgreSQL**
- [Notifications](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/notification_service.go): `apps/api/internal/service/notification_service.go`

### Regional operations

- [Cleanup events](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/cleanup_service.go): `apps/api/internal/service/cleanup_service.go`
- [Participation review](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/participation_service.go): `apps/api/internal/service/participation_service.go`
- [Geographic hierarchy](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/geography_service.go): `apps/api/internal/service/geography_service.go`
- [Safeguarding](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/safeguarding_service.go): `apps/api/internal/service/safeguarding_service.go`

### Commerce and resources

- [Finance management](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/finance_service.go): `apps/api/internal/service/finance_service.go`
- [Inventory management](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/inventory_service.go): `apps/api/internal/service/inventory_service.go`
- [Marketplace](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/marketplace_service.go): `apps/api/internal/service/marketplace_service.go`
- [Careers](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/careers_service.go): `apps/api/internal/service/careers_service.go`
- [Gallery media](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/gallery_service.go): `apps/api/internal/service/gallery_service.go`

### Reporting and integrations

- [Reports and exports](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/service/report_service.go): `apps/api/internal/service/report_service.go`
- [Report scheduler](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/worker/report_scheduler.go): `apps/api/internal/worker/report_scheduler.go`
- [Export storage](https://github.com/terna27/tech-ratels/blob/main/apps/api/internal/storage/report_export_storage.go): `apps/api/internal/storage/report_export_storage.go`

### Other components

- **Members and staff**
- **Cloudflare R2**

## Connections

- Members and staff → Web interface: uses
- Web interface → Reports and exports: requests overview (evidence: `apps/web/src/app/page.tsx`)
- HTTP API → PostgreSQL: connects (evidence: `apps/api/cmd/server/main.go`)
- HTTP API → Report scheduler: starts (evidence: `apps/api/cmd/server/main.go`)
- HTTP API → Reports and exports: constructs (evidence: `apps/api/cmd/server/main.go`)
- Authentication → Data repository: uses (evidence: `apps/api/internal/service/auth_service.go`)
- Authentication → Notifications: sends verification (evidence: `apps/api/internal/service/auth_service.go`)
- Data repository → PostgreSQL: accesses data
- Report scheduler → Reports and exports: schedules
- Reports and exports → Export storage: stores exports
- Export storage → Cloudflare R2: stores objects
- Marketplace → Marketplace: handles domain operations (evidence: `apps/api/internal/service/marketplace_service.go`)
