# juanfermc/credit-compass architecture

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

- Interactive diagram: https://gitdiagram.com/juanfermc/credit-compass
- Repository: https://github.com/juanfermc/credit-compass

## Overview

Credit-Compass (Veridica) is a credit-scoring frontend for risk administrators and credit analysts. Users enter through the public site, authenticate (or use the documented demo mode), and reach a role-aware protected panel for account administration and scoring work: applicants, risk variables, rules, evaluations, and reports. Shared API clients connect the interface to Security-Module, the Scoring Engine, and Evaluation Query. The README documents some capabilities whose route implementations were not sampled; those branches are retained with documented relationships. Edges reflect sampled calls or README statements, not inferred sibling pipelines.

Main entry points: [`src/components/layout/app-shell.tsx`](https://github.com/juanfermc/credit-compass/blob/main/src/components/layout/app-shell.tsx) (Panel navigation), [`src/api/auth-client.ts`](https://github.com/juanfermc/credit-compass/blob/main/src/api/auth-client.ts) (Security client), [`src/api/evaluation-query.ts`](https://github.com/juanfermc/credit-compass/blob/main/src/api/evaluation-query.ts) (Evaluation query client), [`src/routes/iniciar-sesion.tsx`](https://github.com/juanfermc/credit-compass/blob/main/src/routes/iniciar-sesion.tsx) (Sign-in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_landing["Public landing<br/>[index.tsx]"]
  node_auth_pages["Sign-in and signup<br/>[iniciar-sesion.tsx]"]
  node_panel_guard["Panel guard<br/>[route.tsx]"]
  node_app_shell["Panel navigation<br/>[app-shell.tsx]"]
  node_account["Account settings<br/>[cuenta.tsx]"]
  node_users["User administration<br/>[usuarios.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_facade["Auth facade<br/>[auth.ts]"]
  node_auth_client["Security client<br/>[auth-client.ts]"]
  node_session["Session state<br/>[session.ts]"]
  node_tokens["Token store<br/>[token-store.ts]"]
end

subgraph group_scoring["Credit scoring"]
  node_applicants["Applicant management<br/>[solicitantes.tsx]"]
  node_variables["Risk variables<br/>[variables.tsx]"]
  node_rules["Scoring rules<br/>[reglas.tsx]"]
  node_policy["Classification policy"]
  node_evaluations["Evaluations<br/>[evaluaciones.tsx]"]
  node_reports["Reports<br/>[informes.tsx]"]
end

subgraph group_transport["API transport"]
  node_scoring_api["Scoring API client<br/>[client.ts]"]
  node_query_api["Evaluation query client"]
  node_http["HTTP client<br/>[http.ts]"]
end

node_user(("User"))
node_security_service{{"Security-Module"}}
node_scoring_service{{"Scoring Engine"}}
node_query_service{{"Evaluation Query"}}

node_user -->|"opens"| node_landing
node_landing -->|"links to"| node_auth_pages
node_user -.->|"submits credentials"| node_auth_pages
node_auth_pages -->|"authenticates"| node_auth_facade
node_auth_facade -->|"delegates to"| node_auth_client
node_auth_client -->|"requests auth"| node_security_service
node_auth_client -->|"updates session"| node_session
node_auth_client -->|"stores tokens"| node_tokens
node_auth_pages -.->|"redirects after auth"| node_panel_guard
node_panel_guard -->|"checks session"| node_session
node_panel_guard -->|"renders panel"| node_app_shell
node_app_shell -.->|"offers account"| node_account
node_app_shell -->|"offers by role"| node_users
node_app_shell -.->|"offers by role"| node_applicants
node_app_shell -.->|"offers by role"| node_variables
node_app_shell -.->|"offers by role"| node_rules
node_app_shell -.->|"offers by role"| node_policy
node_app_shell -.->|"offers by role"| node_evaluations
node_app_shell -.->|"offers by role"| node_reports
node_users -->|"uses authentication"| node_auth_facade
node_evaluations -->|"requests scoring"| node_scoring_api
node_evaluations -->|"requests persisted results"| node_query_api
node_scoring_api -->|"calls API"| node_scoring_service
node_query_api -->|"queries results"| node_query_service
node_query_api -->|"refreshes session"| node_auth_facade
node_auth_client -->|"creates client"| node_http
node_scoring_api -->|"creates client"| node_http
node_query_api -->|"creates client"| node_http
node_http -->|"reads access token"| node_tokens

click node_landing "https://github.com/juanfermc/credit-compass/blob/main/src/routes/index.tsx"
click node_auth_pages "https://github.com/juanfermc/credit-compass/blob/main/src/routes/iniciar-sesion.tsx"
click node_panel_guard "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/route.tsx"
click node_app_shell "https://github.com/juanfermc/credit-compass/blob/main/src/components/layout/app-shell.tsx"
click node_account "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/cuenta.tsx"
click node_users "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/usuarios.tsx"
click node_applicants "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/solicitantes.tsx"
click node_variables "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/variables.tsx"
click node_rules "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/reglas.tsx"
click node_policy "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/politica-clasificacion.tsx"
click node_evaluations "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/evaluaciones.tsx"
click node_reports "https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/informes.tsx"
click node_auth_facade "https://github.com/juanfermc/credit-compass/blob/main/src/api/auth.ts"
click node_auth_client "https://github.com/juanfermc/credit-compass/blob/main/src/api/auth-client.ts"
click node_session "https://github.com/juanfermc/credit-compass/blob/main/src/api/session.ts"
click node_tokens "https://github.com/juanfermc/credit-compass/blob/main/src/api/token-store.ts"
click node_scoring_api "https://github.com/juanfermc/credit-compass/blob/main/src/api/client.ts"
click node_query_api "https://github.com/juanfermc/credit-compass/blob/main/src/api/evaluation-query.ts"
click node_http "https://github.com/juanfermc/credit-compass/blob/main/src/api/http.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_landing,node_auth_pages,node_panel_guard,node_app_shell,node_account,node_users,node_user toneBlue
class node_auth_facade,node_auth_client,node_session,node_tokens toneAmber
class node_applicants,node_variables,node_rules,node_policy,node_evaluations,node_reports toneMint
class node_scoring_api,node_query_api,node_http toneRose
class node_security_service,node_scoring_service,node_query_service toneIndigo
```

## Components

### Web experience

- [Public landing](https://github.com/juanfermc/credit-compass/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Sign-in and signup](https://github.com/juanfermc/credit-compass/blob/main/src/routes/iniciar-sesion.tsx): `src/routes/iniciar-sesion.tsx`
- [Panel guard](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/route.tsx): `src/routes/panel/route.tsx`
- [Panel navigation](https://github.com/juanfermc/credit-compass/blob/main/src/components/layout/app-shell.tsx): `src/components/layout/app-shell.tsx`
- [Account settings](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/cuenta.tsx): `src/routes/panel/cuenta.tsx`
- [User administration](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/usuarios.tsx): `src/routes/panel/usuarios.tsx`

### Identity and access

- [Auth facade](https://github.com/juanfermc/credit-compass/blob/main/src/api/auth.ts): `src/api/auth.ts`
- [Security client](https://github.com/juanfermc/credit-compass/blob/main/src/api/auth-client.ts): `src/api/auth-client.ts`
- [Session state](https://github.com/juanfermc/credit-compass/blob/main/src/api/session.ts): `src/api/session.ts`
- [Token store](https://github.com/juanfermc/credit-compass/blob/main/src/api/token-store.ts): `src/api/token-store.ts`

### Credit scoring

- [Applicant management](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/solicitantes.tsx): `src/routes/panel/solicitantes.tsx`
- [Risk variables](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/variables.tsx): `src/routes/panel/variables.tsx`
- [Scoring rules](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/reglas.tsx): `src/routes/panel/reglas.tsx`
- [Classification policy](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/politica-clasificacion.tsx): `src/routes/panel/politica-clasificacion.tsx`
- [Evaluations](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/evaluaciones.tsx): `src/routes/panel/evaluaciones.tsx`
- [Reports](https://github.com/juanfermc/credit-compass/blob/main/src/routes/panel/informes.tsx): `src/routes/panel/informes.tsx`

### API transport

- [Scoring API client](https://github.com/juanfermc/credit-compass/blob/main/src/api/client.ts): `src/api/client.ts`
- [Evaluation query client](https://github.com/juanfermc/credit-compass/blob/main/src/api/evaluation-query.ts): `src/api/evaluation-query.ts`
- [HTTP client](https://github.com/juanfermc/credit-compass/blob/main/src/api/http.ts): `src/api/http.ts`

### Other components

- **User**
- **Security-Module**
- **Scoring Engine**
- **Evaluation Query**

## Connections

- User → Public landing: opens (evidence: `src/routes/index.tsx`)
- Public landing → Sign-in and signup: links to (evidence: `src/routes/index.tsx`)
- User → Sign-in and signup: submits credentials
- Sign-in and signup → Auth facade: authenticates (evidence: `src/routes/iniciar-sesion.tsx`)
- Auth facade → Security client: delegates to (evidence: `src/api/auth.ts`)
- Security client → Security-Module: requests auth (evidence: `src/api/auth-client.ts`)
- Security client → Session state: updates session (evidence: `src/api/auth-client.ts`)
- Security client → Token store: stores tokens (evidence: `src/api/auth-client.ts`)
- Sign-in and signup → Panel guard: redirects after auth
- Panel guard → Session state: checks session (evidence: `src/routes/panel/route.tsx`)
- Panel guard → Panel navigation: renders panel (evidence: `src/routes/panel/route.tsx`)
- Panel navigation → Account settings: offers account
- Panel navigation → User administration: offers by role (evidence: `src/components/layout/app-shell.tsx`)
- Panel navigation → Applicant management: offers by role
- Panel navigation → Risk variables: offers by role
- Panel navigation → Scoring rules: offers by role
- Panel navigation → Classification policy: offers by role
- Panel navigation → Evaluations: offers by role
- Panel navigation → Reports: offers by role
- User administration → Auth facade: uses authentication (evidence: `src/routes/panel/usuarios.tsx`)
- Evaluations → Scoring API client: requests scoring (evidence: `src/routes/panel/evaluaciones.tsx`)
- Evaluations → Evaluation query client: requests persisted results (evidence: `src/routes/panel/evaluaciones.tsx`)
- Scoring API client → Scoring Engine: calls API (evidence: `src/api/client.ts`)
- Evaluation query client → Evaluation Query: queries results (evidence: `src/api/evaluation-query.ts`)
- Evaluation query client → Auth facade: refreshes session (evidence: `src/api/evaluation-query.ts`)
- Security client → HTTP client: creates client (evidence: `src/api/auth-client.ts`)
- Scoring API client → HTTP client: creates client (evidence: `src/api/client.ts`)
- Evaluation query client → HTTP client: creates client (evidence: `src/api/evaluation-query.ts`)
- HTTP client → Token store: reads access token (evidence: `src/api/client.ts`)
