# felcardoso/lexmanager architecture

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

- Interactive diagram: https://gitdiagram.com/felcardoso/lexmanager
- Repository: https://github.com/felcardoso/lexmanager

## Overview

LexManager is a Flask CRM for law firms. A lawyer signs in, manages clients and cases, and can add a case manually or trigger Datajud synchronization; the application persists records in SQLite and renders web pages. The README also identifies dashboard statistics and hearing management, while the tree and app excerpt show reporting, documents, and fee-management surfaces. Domain routes are concentrated in app.py. Evidence is limited to the supplied excerpts and README; unsampled route details are not inferred.

Main entry points: [`app.py`](https://github.com/felcardoso/lexmanager/blob/main/app.py) (Flask routes), [`datajud_api.py`](https://github.com/felcardoso/lexmanager/blob/main/datajud_api.py) (Datajud client), [`db.py`](https://github.com/felcardoso/lexmanager/blob/main/db.py) (CRM database), [`templates`](https://github.com/felcardoso/lexmanager/tree/main/templates) (Web templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Flask routes<br/>[app.py]"]
  node_auth["Authentication<br/>[app.py]"]
  node_dashboard["Dashboard<br/>[app.py]"]
  node_pages["Web templates"]
end

subgraph group_practice["Casework"]
  node_clients["Client management<br/>[app.py]"]
  node_cases["Case management<br/>[app.py]"]
  node_hearings["Hearing management<br/>[app.py]"]
  node_documents["Documents<br/>[app.py]"]
  node_fees["Legal fees<br/>[app.py]"]
  node_reports["Reports<br/>[app.py]"]
end

subgraph group_records["Persistence and integration"]
  node_database[("CRM database<br/>[db.py]")]
  node_datajud["Datajud client<br/>[datajud_api.py]"]
  node_config["Configuration<br/>[config.py]"]
end

node_lawyer(("Lawyer"))
node_datajud_service{{"Datajud API"}}

node_lawyer -->|"uses"| node_routes
node_routes -->|"routes login"| node_auth
node_routes -->|"serves dashboard"| node_dashboard
node_routes -->|"manages clients"| node_clients
node_routes -->|"manages cases"| node_cases
node_routes -->|"manages hearings"| node_hearings
node_routes -->|"queries documents"| node_documents
node_routes -->|"queries fees"| node_fees
node_routes -->|"renders reports"| node_reports
node_routes -->|"renders pages"| node_pages
node_routes -->|"queries and writes"| node_database
node_routes -->|"calls"| node_datajud
node_datajud -->|"requests data"| node_datajud_service
node_datajud -->|"updates cases"| node_database
node_datajud -->|"imports key"| node_config

click node_routes "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_auth "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_dashboard "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_pages "https://github.com/felcardoso/lexmanager/tree/main/templates"
click node_clients "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_cases "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_hearings "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_documents "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_fees "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_reports "https://github.com/felcardoso/lexmanager/blob/main/app.py"
click node_database "https://github.com/felcardoso/lexmanager/blob/main/db.py"
click node_datajud "https://github.com/felcardoso/lexmanager/blob/main/datajud_api.py"
click node_config "https://github.com/felcardoso/lexmanager/blob/main/config.py"

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_routes,node_auth,node_dashboard,node_pages toneBlue
class node_clients,node_cases,node_hearings,node_documents,node_fees,node_reports toneAmber
class node_database,node_datajud,node_config,node_datajud_service toneMint
class node_lawyer toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Authentication](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Dashboard](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Web templates](https://github.com/felcardoso/lexmanager/tree/main/templates): `templates`

### Casework

- [Client management](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Case management](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Hearing management](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Documents](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Legal fees](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`
- [Reports](https://github.com/felcardoso/lexmanager/blob/main/app.py): `app.py`

### Persistence and integration

- [CRM database](https://github.com/felcardoso/lexmanager/blob/main/db.py): `db.py`
- [Datajud client](https://github.com/felcardoso/lexmanager/blob/main/datajud_api.py): `datajud_api.py`
- [Configuration](https://github.com/felcardoso/lexmanager/blob/main/config.py): `config.py`

### Other components

- **Lawyer**
- **Datajud API**

## Connections

- Lawyer → Flask routes: uses (evidence: `README.md`)
- Flask routes → Authentication: routes login (evidence: `app.py`)
- Flask routes → Dashboard: serves dashboard (evidence: `app.py`)
- Flask routes → Client management: manages clients (evidence: `README.md`)
- Flask routes → Case management: manages cases (evidence: `app.py`)
- Flask routes → Hearing management: manages hearings (evidence: `README.md`)
- Flask routes → Documents: queries documents (evidence: `app.py`)
- Flask routes → Legal fees: queries fees (evidence: `app.py`)
- Flask routes → Reports: renders reports (evidence: `app.py`)
- Flask routes → Web templates: renders pages (evidence: `app.py`)
- Flask routes → CRM database: queries and writes (evidence: `app.py`)
- Flask routes → Datajud client: calls (evidence: `app.py`)
- Datajud client → Datajud API: requests data (evidence: `datajud_api.py`)
- Datajud client → CRM database: updates cases (evidence: `datajud_api.py`)
- Datajud client → Configuration: imports key (evidence: `datajud_api.py`)
