# isaacescobar0100/sednp architecture

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

- Interactive diagram: https://gitdiagram.com/isaacescobar0100/sednp
- Repository: https://github.com/isaacescobar0100/sednp

## Overview

SIG-SERDNP is a functional union-management simulator with role-based workflows for union officers and an affiliate portal. The main workflow is sign-in or public enrollment, followed by role-appropriate management of affiliation, finances, governance, discipline, and member services; shared application state supports those modules. The README describes browser persistence, while sampled source also shows Supabase authentication, storage, and API-backed services, so the graph reflects both. Some module connections are documented rather than source-verified; unsampled implementations are not inferred beyond those documented capabilities.

Main entry points: [`src/App.tsx`](https://github.com/isaacescobar0100/sednp/blob/main/src/App.tsx) (Application router), [`src/pages/FinancieroPage.tsx`](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/FinancieroPage.tsx) (Finance), [`src/store/DemoStore.tsx`](https://github.com/isaacescobar0100/sednp/blob/main/src/store/DemoStore.tsx) (Shared application state), [`src/pages/AfiliacionPage.tsx`](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/AfiliacionPage.tsx) (Affiliation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_app["Application router<br/>[App.tsx]"]
  node_auth["Authentication<br/>[auth.tsx]"]
  node_role["Roles and permissions<br/>[session.tsx]"]
  node_public["Public site<br/>[PublicSite.tsx]"]
  node_enrollment["Public enrollment"]
end

subgraph group_operations["Union operations"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_affiliation["Affiliation<br/>[AfiliacionPage.tsx]"]
  node_finance["Finance<br/>[FinancieroPage.tsx]"]
  node_discipline["Discipline"]
  node_governance["Governance<br/>[GobernanzaPage.tsx]"]
  node_committees["Committees<br/>[ComitesPage.tsx]"]
end

subgraph group_member["Member services"]
  node_documents["Document repository<br/>[DocumentalPage.tsx]"]
  node_communications["Communications"]
  node_portal["Affiliate portal<br/>[AfiliadoPortal.tsx]"]
  node_reports["Reports and export<br/>[ReportesPage.tsx]"]
  node_parameters["Union parameters<br/>[ParametrosPage.tsx]"]
end

subgraph group_state["State and domain rules"]
  node_demo[("Shared application state<br/>[DemoStore.tsx]")]
  node_affiliate_rules["Affiliation rules<br/>[affiliates.ts]"]
  node_finance_rules["Finance rules<br/>[finance.ts]"]
  node_contribution_rules["Contribution rules<br/>[contributions.ts]"]
end

subgraph group_integrations["External services"]
  node_storage["File storage client<br/>[storageApi.ts]"]
  node_supabase["Supabase<br/>[supabase.ts]"]
  node_email["Email service client<br/>[emailApi.ts]"]
end

node_officers(("Union officers"))
node_affiliate(("Affiliate"))

node_officers -->|"use system"| node_app
node_affiliate -->|"use portal"| node_app
node_app -->|"provides access"| node_auth
node_app -->|"shows public site"| node_public
node_app -->|"routes enrollment"| node_enrollment
node_app -->|"routes portal"| node_portal
node_app -->|"sets role context"| node_role
node_officers -->|"register and approve"| node_affiliation
node_officers -->|"manage finances"| node_finance
node_officers -->|"manage cases"| node_discipline
node_officers -->|"manage governance"| node_governance
node_officers -->|"manage committees"| node_committees
node_officers -->|"manage documents"| node_documents
node_officers -->|"send communications"| node_communications
node_officers -->|"view reports"| node_reports
node_officers -->|"manage parameters"| node_parameters
node_affiliate -->|"view member services"| node_portal
node_affiliation -->|"updates state"| node_demo
node_finance -->|"updates state"| node_demo
node_discipline -->|"uses shared state"| node_demo
node_governance -->|"uses shared state"| node_demo
node_portal -->|"reads member data"| node_demo
node_affiliation -->|"uses rules"| node_affiliate_rules
node_finance -->|"uses calculations"| node_finance_rules
node_finance -->|"reads contribution data"| node_contribution_rules
node_finance -->|"uploads and opens files"| node_storage
node_storage -->|"uses storage"| node_supabase
node_auth -->|"authenticates and loads profile"| node_supabase
node_affiliation -.->|"sends notices"| node_email
node_email -->|"gets session token"| node_supabase
node_email -->|"requests email delivery"| node_officers

click node_app "https://github.com/isaacescobar0100/sednp/blob/main/src/App.tsx"
click node_auth "https://github.com/isaacescobar0100/sednp/blob/main/src/store/auth.tsx"
click node_role "https://github.com/isaacescobar0100/sednp/blob/main/src/store/session.tsx"
click node_public "https://github.com/isaacescobar0100/sednp/blob/main/src/components/PublicSite.tsx"
click node_enrollment "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/PublicRegistroPage.tsx"
click node_dashboard "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DashboardPage.tsx"
click node_affiliation "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/AfiliacionPage.tsx"
click node_finance "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/FinancieroPage.tsx"
click node_discipline "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DisciplinarioPage.tsx"
click node_governance "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/GobernanzaPage.tsx"
click node_committees "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ComitesPage.tsx"
click node_documents "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DocumentalPage.tsx"
click node_communications "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ComunicacionesPage.tsx"
click node_portal "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/AfiliadoPortal.tsx"
click node_reports "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ReportesPage.tsx"
click node_parameters "https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ParametrosPage.tsx"
click node_demo "https://github.com/isaacescobar0100/sednp/blob/main/src/store/DemoStore.tsx"
click node_affiliate_rules "https://github.com/isaacescobar0100/sednp/blob/main/src/store/affiliates.ts"
click node_finance_rules "https://github.com/isaacescobar0100/sednp/blob/main/src/store/finance.ts"
click node_contribution_rules "https://github.com/isaacescobar0100/sednp/blob/main/src/store/contributions.ts"
click node_storage "https://github.com/isaacescobar0100/sednp/blob/main/src/store/storageApi.ts"
click node_supabase "https://github.com/isaacescobar0100/sednp/blob/main/src/lib/supabase.ts"
click node_email "https://github.com/isaacescobar0100/sednp/blob/main/src/store/emailApi.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_app,node_auth,node_role,node_public,node_enrollment toneBlue
class node_dashboard,node_affiliation,node_finance,node_discipline,node_governance,node_committees toneAmber
class node_documents,node_communications,node_portal,node_reports,node_parameters toneMint
class node_demo,node_affiliate_rules,node_finance_rules,node_contribution_rules toneRose
class node_storage,node_supabase,node_email,node_officers,node_affiliate toneIndigo
```

## Components

### Entry and access

- [Application router](https://github.com/isaacescobar0100/sednp/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/isaacescobar0100/sednp/blob/main/src/store/auth.tsx): `src/store/auth.tsx`
- [Roles and permissions](https://github.com/isaacescobar0100/sednp/blob/main/src/store/session.tsx): `src/store/session.tsx`
- [Public site](https://github.com/isaacescobar0100/sednp/blob/main/src/components/PublicSite.tsx): `src/components/PublicSite.tsx`
- [Public enrollment](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/PublicRegistroPage.tsx): `src/pages/PublicRegistroPage.tsx`

### Union operations

- [Dashboard](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Affiliation](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/AfiliacionPage.tsx): `src/pages/AfiliacionPage.tsx`
- [Finance](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/FinancieroPage.tsx): `src/pages/FinancieroPage.tsx`
- [Discipline](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DisciplinarioPage.tsx): `src/pages/DisciplinarioPage.tsx`
- [Governance](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/GobernanzaPage.tsx): `src/pages/GobernanzaPage.tsx`
- [Committees](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ComitesPage.tsx): `src/pages/ComitesPage.tsx`

### Member services

- [Document repository](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/DocumentalPage.tsx): `src/pages/DocumentalPage.tsx`
- [Communications](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ComunicacionesPage.tsx): `src/pages/ComunicacionesPage.tsx`
- [Affiliate portal](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/AfiliadoPortal.tsx): `src/pages/AfiliadoPortal.tsx`
- [Reports and export](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ReportesPage.tsx): `src/pages/ReportesPage.tsx`
- [Union parameters](https://github.com/isaacescobar0100/sednp/blob/main/src/pages/ParametrosPage.tsx): `src/pages/ParametrosPage.tsx`

### State and domain rules

- [Shared application state](https://github.com/isaacescobar0100/sednp/blob/main/src/store/DemoStore.tsx): `src/store/DemoStore.tsx`
- [Affiliation rules](https://github.com/isaacescobar0100/sednp/blob/main/src/store/affiliates.ts): `src/store/affiliates.ts`
- [Finance rules](https://github.com/isaacescobar0100/sednp/blob/main/src/store/finance.ts): `src/store/finance.ts`
- [Contribution rules](https://github.com/isaacescobar0100/sednp/blob/main/src/store/contributions.ts): `src/store/contributions.ts`

### External services

- [File storage client](https://github.com/isaacescobar0100/sednp/blob/main/src/store/storageApi.ts): `src/store/storageApi.ts`
- [Supabase](https://github.com/isaacescobar0100/sednp/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Email service client](https://github.com/isaacescobar0100/sednp/blob/main/src/store/emailApi.ts): `src/store/emailApi.ts`

### Other components

- **Union officers**
- **Affiliate**

## Connections

- Union officers → Application router: use system (evidence: `README.md`)
- Affiliate → Application router: use portal (evidence: `README.md`)
- Application router → Authentication: provides access (evidence: `src/App.tsx`)
- Application router → Public site: shows public site (evidence: `src/App.tsx`)
- Application router → Public enrollment: routes enrollment (evidence: `src/App.tsx`)
- Application router → Affiliate portal: routes portal (evidence: `src/App.tsx`)
- Application router → Roles and permissions: sets role context (evidence: `README.md`)
- Union officers → Affiliation: register and approve (evidence: `README.md`)
- Union officers → Finance: manage finances (evidence: `README.md`)
- Union officers → Discipline: manage cases (evidence: `README.md`)
- Union officers → Governance: manage governance (evidence: `README.md`)
- Union officers → Committees: manage committees (evidence: `README.md`)
- Union officers → Document repository: manage documents (evidence: `README.md`)
- Union officers → Communications: send communications (evidence: `README.md`)
- Union officers → Reports and export: view reports (evidence: `README.md`)
- Union officers → Union parameters: manage parameters (evidence: `README.md`)
- Affiliate → Affiliate portal: view member services (evidence: `README.md`)
- Affiliation → Shared application state: updates state (evidence: `README.md`)
- Finance → Shared application state: updates state (evidence: `README.md`)
- Discipline → Shared application state: uses shared state (evidence: `README.md`)
- Governance → Shared application state: uses shared state (evidence: `README.md`)
- Affiliate portal → Shared application state: reads member data (evidence: `README.md`)
- Affiliation → Affiliation rules: uses rules (evidence: `src/pages/AfiliacionPage.tsx`)
- Finance → Finance rules: uses calculations (evidence: `src/pages/FinancieroPage.tsx`)
- Finance → Contribution rules: reads contribution data (evidence: `src/pages/FinancieroPage.tsx`)
- Finance → File storage client: uploads and opens files (evidence: `src/pages/FinancieroPage.tsx`)
- File storage client → Supabase: uses storage (evidence: `src/store/storageApi.ts`)
- Authentication → Supabase: authenticates and loads profile (evidence: `src/store/auth.tsx`)
- Affiliation → Email service client: sends notices (evidence: `src/pages/AfiliacionPage.tsx`)
- Email service client → Supabase: gets session token (evidence: `src/store/emailApi.ts`)
- Email service client → Union officers: requests email delivery (evidence: `src/store/emailApi.ts`)
