# lslo06/sigep architecture

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

- Interactive diagram: https://gitdiagram.com/lslo06/sigep
- Repository: https://github.com/lslo06/sigep

## Overview

Fundos is a Spanish-language territorial and land-record management application. Staff sign in, select an organization, and work with role-authorized modules; the central record workflow lists, searches, creates, edits, and tracks property-related expedientes, with separate payment and multi-role process-tracking workspaces. The tree and excerpts also show organization membership, user administration, and a worker-creation function. Several major screens were not sampled in detail, so their internal operations and database relationships are not inferred here.

Main entry points: [`src/App.jsx`](https://github.com/lslo06/sigep/blob/main/src/App.jsx) (Workspace shell and dashboard), [`src/modules/ModuleWorkspace.jsx`](https://github.com/lslo06/sigep/blob/main/src/modules/ModuleWorkspace.jsx) (Territorial module workspace), [`src/modules/WorkflowWorkspace.jsx`](https://github.com/lslo06/sigep/blob/main/src/modules/WorkflowWorkspace.jsx) (Process-tracking workspace), [`src/lib/supabase.js`](https://github.com/lslo06/sigep/blob/main/src/lib/supabase.js) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Access and roles"]
  node_auth["Authentication and organization gate<br/>[AuthApp.jsx]"]
  node_memberships["Organization memberships<br/>[memberships.js]"]
  node_permissions["Role permissions<br/>[permissions.js]"]
  node_routes["Role-aware routes<br/>[routes.js]"]
  node_users["User administration<br/>[UsersWorkspace.jsx]"]
  node_worker["Worker creation handler<br/>[handler.js]"]
end

subgraph group_records["Territorial records"]
  node_app["Workspace shell and dashboard<br/>[App.jsx]"]
  node_expedientes["Expediente access and mapping<br/>[expedientes.js]"]
  node_validation["Record validation<br/>[validation.js]"]
  node_module["Territorial module workspace"]
  node_editor["Record editor<br/>[RecordEditor.jsx]"]
  node_sections["Editor sections<br/>[editorSections.js]"]
  node_config["Module definitions<br/>[config.js]"]
end

subgraph group_operations["Process operations"]
  node_workflow["Process-tracking workspace"]
  node_stages["Process stages and rules<br/>[workflow.js]"]
  node_payments["Payments workspace"]
end

subgraph group_platform["Backend services"]
  node_supabase["Supabase client<br/>[supabase.js]"]
end

node_staff(("Staff user"))

node_staff -->|"signs in"| node_auth
node_auth -->|"loads memberships"| node_memberships
node_auth -->|"opens workspace"| node_app
node_app -->|"resolves navigation"| node_routes
node_routes -->|"checks access"| node_permissions
node_app -->|"loads and saves"| node_expedientes
node_expedientes -->|"validates fields"| node_validation
node_expedientes -->|"queries records"| node_supabase
node_app -->|"renders modules"| node_module
node_module -->|"accesses module records"| node_supabase
node_module -->|"uses definitions"| node_config
node_module -->|"renders editor"| node_editor
node_editor -->|"uses sections"| node_sections
node_app -->|"renders workflow"| node_workflow
node_workflow -->|"loads and updates"| node_supabase
node_workflow -->|"applies process rules"| node_stages
node_workflow -->|"uses date rules"| node_validation
node_app -->|"renders payments"| node_payments
node_payments -->|"accesses payment data"| node_supabase
node_payments -->|"uses payment concepts"| node_stages
node_module -->|"checks access"| node_permissions
node_workflow -->|"checks work roles"| node_permissions
node_payments -->|"checks access"| node_permissions
node_users -->|"manages users"| node_supabase
node_module -->|"renders administration"| node_users
node_worker -->|"authorizes request"| node_staff

click node_auth "https://github.com/lslo06/sigep/blob/main/src/AuthApp.jsx"
click node_memberships "https://github.com/lslo06/sigep/blob/main/src/lib/memberships.js"
click node_permissions "https://github.com/lslo06/sigep/blob/main/src/lib/permissions.js"
click node_routes "https://github.com/lslo06/sigep/blob/main/src/lib/routes.js"
click node_app "https://github.com/lslo06/sigep/blob/main/src/App.jsx"
click node_expedientes "https://github.com/lslo06/sigep/blob/main/src/lib/expedientes.js"
click node_validation "https://github.com/lslo06/sigep/blob/main/src/lib/validation.js"
click node_module "https://github.com/lslo06/sigep/blob/main/src/modules/ModuleWorkspace.jsx"
click node_editor "https://github.com/lslo06/sigep/blob/main/src/modules/RecordEditor.jsx"
click node_sections "https://github.com/lslo06/sigep/blob/main/src/modules/editorSections.js"
click node_config "https://github.com/lslo06/sigep/blob/main/src/modules/config.js"
click node_workflow "https://github.com/lslo06/sigep/blob/main/src/modules/WorkflowWorkspace.jsx"
click node_stages "https://github.com/lslo06/sigep/blob/main/src/lib/workflow.js"
click node_payments "https://github.com/lslo06/sigep/blob/main/src/modules/PaymentsWorkspace.jsx"
click node_users "https://github.com/lslo06/sigep/blob/main/src/modules/UsersWorkspace.jsx"
click node_worker "https://github.com/lslo06/sigep/blob/main/supabase/functions/crear-trabajador/handler.js"
click node_supabase "https://github.com/lslo06/sigep/blob/main/src/lib/supabase.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_auth,node_memberships,node_permissions,node_routes,node_users,node_worker,node_staff toneBlue
class node_app,node_expedientes,node_validation,node_module,node_editor,node_sections,node_config toneAmber
class node_workflow,node_stages,node_payments toneMint
class node_supabase toneRose
```

## Components

### Access and roles

- [Authentication and organization gate](https://github.com/lslo06/sigep/blob/main/src/AuthApp.jsx): `src/AuthApp.jsx`
- [Organization memberships](https://github.com/lslo06/sigep/blob/main/src/lib/memberships.js): `src/lib/memberships.js`
- [Role permissions](https://github.com/lslo06/sigep/blob/main/src/lib/permissions.js): `src/lib/permissions.js`
- [Role-aware routes](https://github.com/lslo06/sigep/blob/main/src/lib/routes.js): `src/lib/routes.js`
- [User administration](https://github.com/lslo06/sigep/blob/main/src/modules/UsersWorkspace.jsx): `src/modules/UsersWorkspace.jsx`
- [Worker creation handler](https://github.com/lslo06/sigep/blob/main/supabase/functions/crear-trabajador/handler.js): `supabase/functions/crear-trabajador/handler.js`

### Territorial records

- [Workspace shell and dashboard](https://github.com/lslo06/sigep/blob/main/src/App.jsx): `src/App.jsx`
- [Expediente access and mapping](https://github.com/lslo06/sigep/blob/main/src/lib/expedientes.js): `src/lib/expedientes.js`
- [Record validation](https://github.com/lslo06/sigep/blob/main/src/lib/validation.js): `src/lib/validation.js`
- [Territorial module workspace](https://github.com/lslo06/sigep/blob/main/src/modules/ModuleWorkspace.jsx): `src/modules/ModuleWorkspace.jsx`
- [Record editor](https://github.com/lslo06/sigep/blob/main/src/modules/RecordEditor.jsx): `src/modules/RecordEditor.jsx`
- [Editor sections](https://github.com/lslo06/sigep/blob/main/src/modules/editorSections.js): `src/modules/editorSections.js`
- [Module definitions](https://github.com/lslo06/sigep/blob/main/src/modules/config.js): `src/modules/config.js`

### Process operations

- [Process-tracking workspace](https://github.com/lslo06/sigep/blob/main/src/modules/WorkflowWorkspace.jsx): `src/modules/WorkflowWorkspace.jsx`
- [Process stages and rules](https://github.com/lslo06/sigep/blob/main/src/lib/workflow.js): `src/lib/workflow.js`
- [Payments workspace](https://github.com/lslo06/sigep/blob/main/src/modules/PaymentsWorkspace.jsx): `src/modules/PaymentsWorkspace.jsx`

### Backend services

- [Supabase client](https://github.com/lslo06/sigep/blob/main/src/lib/supabase.js): `src/lib/supabase.js`

### Other components

- **Staff user**

## Connections

- Staff user → Authentication and organization gate: signs in (evidence: `src/AuthApp.jsx`)
- Authentication and organization gate → Organization memberships: loads memberships (evidence: `src/AuthApp.jsx`)
- Authentication and organization gate → Workspace shell and dashboard: opens workspace (evidence: `src/AuthApp.jsx`)
- Workspace shell and dashboard → Role-aware routes: resolves navigation (evidence: `src/App.jsx`)
- Role-aware routes → Role permissions: checks access (evidence: `src/lib/routes.js`)
- Workspace shell and dashboard → Expediente access and mapping: loads and saves (evidence: `src/App.jsx`)
- Expediente access and mapping → Record validation: validates fields (evidence: `src/lib/expedientes.js`)
- Expediente access and mapping → Supabase client: queries records (evidence: `src/lib/expedientes.js`)
- Workspace shell and dashboard → Territorial module workspace: renders modules (evidence: `src/App.jsx`)
- Territorial module workspace → Supabase client: accesses module records (evidence: `src/modules/ModuleWorkspace.jsx`)
- Territorial module workspace → Module definitions: uses definitions (evidence: `src/modules/ModuleWorkspace.jsx`)
- Territorial module workspace → Record editor: renders editor (evidence: `src/modules/ModuleWorkspace.jsx`)
- Record editor → Editor sections: uses sections (evidence: `src/modules/RecordEditor.jsx`)
- Workspace shell and dashboard → Process-tracking workspace: renders workflow (evidence: `src/App.jsx`)
- Process-tracking workspace → Supabase client: loads and updates (evidence: `src/modules/WorkflowWorkspace.jsx`)
- Process-tracking workspace → Process stages and rules: applies process rules (evidence: `src/modules/WorkflowWorkspace.jsx`)
- Process-tracking workspace → Record validation: uses date rules (evidence: `src/modules/WorkflowWorkspace.jsx`)
- Workspace shell and dashboard → Payments workspace: renders payments (evidence: `src/App.jsx`)
- Payments workspace → Supabase client: accesses payment data (evidence: `src/modules/PaymentsWorkspace.jsx`)
- Payments workspace → Process stages and rules: uses payment concepts (evidence: `src/modules/PaymentsWorkspace.jsx`)
- Territorial module workspace → Role permissions: checks access (evidence: `src/modules/ModuleWorkspace.jsx`)
- Process-tracking workspace → Role permissions: checks work roles (evidence: `src/modules/WorkflowWorkspace.jsx`)
- Payments workspace → Role permissions: checks access (evidence: `src/modules/PaymentsWorkspace.jsx`)
- User administration → Supabase client: manages users (evidence: `src/modules/UsersWorkspace.jsx`)
- Territorial module workspace → User administration: renders administration (evidence: `src/modules/ModuleWorkspace.jsx`)
- Worker creation handler → Staff user: authorizes request (evidence: `supabase/functions/crear-trabajador/handler.js`)
