# lorenzomarty/agenda-juri architecture

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

- Interactive diagram: https://gitdiagram.com/lorenzomarty/agenda-juri
- Repository: https://github.com/lorenzomarty/agenda-juri

## Overview

1. **High-level shape**  
   This is a **single Django monolith** for a law-office workflow system (“Agenda-Juri”). The app is server-rendered, with Django handling routing, views, forms, templates, authentication, and persistence in one codebase.

2. **Main domain apps**  
   The business logic is split into four feature apps: **clientes**, **processos**, **agenda**, and **usuarios**. Each app owns its own models, forms, views, URLs, templates, tests, and admin registration, which keeps the domain boundaries clear.

3. **Core/shared layer**  
   The **core** app acts as the platform layer: dashboard, shared permissions, reusable utilities, a demo-data seeder command, and shared template tags. It is the main place where cross-cutting behavior lives instead of inside each domain app.

4. **Request routing and page composition**  
   Incoming requests go through the project URL config in **jurisagenda/urls.py**, then into each app’s `urls.py`, then into class/function views in the app. Most screens are classic CRUD pages: list, detail, create, and delete-confirmation flows rendered by Django templates.

5. **Primary data flow**  
   The main workflow is domain-centric: a user logs in, creates a **cliente**, creates a related **processo**, and then records **agenda/evento** items tied to the case workflow. The **dashboard** centralizes this information for quick access alongside the standalone list/detail pages.

6. **Authentication and authorization boundary**  
   Authentication is handled in the **usuarios** app, including login and user/cargo management. Authorization is reinforced in **core/permissions.py**, **core/permission_utils.py**, and template tags used to hide/show navigation and access-controlled UI elements.

7. **Presentation layer**  
   The UI is built with Django templates, using a shared **templates/base.html** and reusable partials for navigation, search, list intros, form feedback, and delete confirmation. Each domain app also has its own page templates for forms and listings.

8. **Frontend assets**  
   Static assets are organized centrally under **static/** with base, component, page, and utility CSS, plus a small set of page-specific JavaScript modules. This suggests progressive enhancement on top of server-rendered HTML rather than a separate SPA frontend.

9. **Persistence and local development**  
   The repository includes **db.sqlite3** for local development, while the README says PostgreSQL is the intended production database. Django migrations exist for each domain app, so the schema is managed through standard Django migration workflows.

10. **Automation and seeded data**  
   The **core/management/commands/seed_demo.py** command indicates support for populating demo data, likely to bootstrap the dashboard and CRUD screens quickly in a fresh environment.

11. **Deployment/runtime hints**  
   Standard Django entrypoints are present (`manage.py`, `wsgi.py`, `asgi.py`). The presence of **vercel.json** and **api/index.py** suggests there is also an adapter for deployment on Vercel/serverless hosting, though the application architecture itself remains Django-centric.

12. **What to show in an architecture diagram**  
   The most important boxes are: **browser/UI → Django routing/views → domain apps → database**, with **core** as the shared services layer and **usuarios** as the auth/roles boundary. Add shared templates/static assets as presentation support, and show the dashboard as an aggregation point over clientes/processos/agenda data.

Main entry points: [`jurisagenda/urls.py`](https://github.com/lorenzomarty/agenda-juri/blob/master/jurisagenda/urls.py) (Project URLs), [`templates/base.html`](https://github.com/lorenzomarty/agenda-juri/blob/master/templates/base.html) (Base Layout), [`db.sqlite3`](https://github.com/lorenzomarty/agenda-juri/blob/master/db.sqlite3) (SQLite DB), [`core/views.py`](https://github.com/lorenzomarty/agenda-juri/blob/master/core/views.py) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime & routing"]
  node_browser(("Browser<br/>client"))
  node_project_urls["Project URLs<br/>django router<br/>[urls.py]"]
end

subgraph group_platform["Shared platform"]
  node_core_urls["Core URLs<br/>core router<br/>[urls.py]"]
  node_core_dashboard["Dashboard<br/>core view<br/>[views.py]"]
  node_permissions["Permissions<br/>access control<br/>[permissions.py]"]
  node_permission_utils["Permission Utils<br/>access helpers"]
  node_access_tags["Access Tags<br/>template tags<br/>[access.py]"]
  node_navigation_tags["Navigation Tags<br/>template tags<br/>[navigation.py]"]
  node_base_template["Base Layout<br/>shared template<br/>[base.html]"]
  node_sidebar_nav["Sidebar Nav<br/>partial template"]
  node_seed_demo["Seed Demo<br/>management command<br/>[seed_demo.py]"]
end

subgraph group_domain["Domain apps"]
  node_clientes_router["Clientes URLs<br/>app router<br/>[urls.py]"]
  node_clientes_views["Clientes UI<br/>domain views<br/>[views.py]"]
  node_processos_router["Processos URLs<br/>app router<br/>[urls.py]"]
  node_processos_views["Processos UI<br/>domain views<br/>[views.py]"]
  node_agenda_router["Agenda URLs<br/>app router<br/>[urls.py]"]
  node_agenda_views["Agenda UI<br/>domain views<br/>[views.py]"]
  node_usuarios_router["Usuarios URLs<br/>app router<br/>[urls.py]"]
  node_usuarios_views["Usuarios UI<br/>auth views<br/>[views.py]"]
end

subgraph group_storage["Storage & deploy"]
  node_database[("SQLite DB<br/>local database<br/>[db.sqlite3]")]
  node_vercel_adapter["Vercel Adapter<br/>deployment entry<br/>[index.py]"]
end

node_browser -->|"requests"| node_project_urls
node_project_urls -->|"dashboard"| node_core_urls
node_project_urls -->|"clientes"| node_clientes_router
node_project_urls -->|"processos"| node_processos_router
node_project_urls -->|"agenda"| node_agenda_router
node_project_urls -->|"usuarios"| node_usuarios_router
node_core_urls -->|"renders"| node_core_dashboard
node_clientes_router -->|"views"| node_clientes_views
node_processos_router -->|"views"| node_processos_views
node_agenda_router -->|"views"| node_agenda_views
node_usuarios_router -->|"views"| node_usuarios_views
node_clientes_views -->|"persists"| node_database
node_processos_views -->|"persists"| node_database
node_agenda_views -->|"persists"| node_database
node_usuarios_views -->|"persists"| node_database
node_core_dashboard -->|"summarizes"| node_database
node_permissions -->|"guards"| node_core_dashboard
node_permission_utils -->|"supports"| node_permissions
node_access_tags -->|"shapes ui"| node_base_template
node_navigation_tags -->|"builds"| node_sidebar_nav
node_base_template -->|"includes"| node_sidebar_nav
node_core_dashboard -->|"extends"| node_base_template
node_clientes_views -->|"extends"| node_base_template
node_processos_views -->|"extends"| node_base_template
node_agenda_views -->|"extends"| node_base_template
node_usuarios_views -->|"extends"| node_base_template
node_seed_demo -->|"seeds"| node_database
node_vercel_adapter -->|"adapts"| node_project_urls

click node_project_urls "https://github.com/lorenzomarty/agenda-juri/blob/master/jurisagenda/urls.py"
click node_core_urls "https://github.com/lorenzomarty/agenda-juri/blob/master/core/urls.py"
click node_core_dashboard "https://github.com/lorenzomarty/agenda-juri/blob/master/core/views.py"
click node_permissions "https://github.com/lorenzomarty/agenda-juri/blob/master/core/permissions.py"
click node_permission_utils "https://github.com/lorenzomarty/agenda-juri/blob/master/core/permission_utils.py"
click node_access_tags "https://github.com/lorenzomarty/agenda-juri/blob/master/core/templatetags/access.py"
click node_navigation_tags "https://github.com/lorenzomarty/agenda-juri/blob/master/core/templatetags/navigation.py"
click node_base_template "https://github.com/lorenzomarty/agenda-juri/blob/master/templates/base.html"
click node_sidebar_nav "https://github.com/lorenzomarty/agenda-juri/blob/master/templates/partials/sidebar_navigation.html"
click node_clientes_router "https://github.com/lorenzomarty/agenda-juri/blob/master/clientes/urls.py"
click node_clientes_views "https://github.com/lorenzomarty/agenda-juri/blob/master/clientes/views.py"
click node_processos_router "https://github.com/lorenzomarty/agenda-juri/blob/master/processos/urls.py"
click node_processos_views "https://github.com/lorenzomarty/agenda-juri/blob/master/processos/views.py"
click node_agenda_router "https://github.com/lorenzomarty/agenda-juri/blob/master/agenda/urls.py"
click node_agenda_views "https://github.com/lorenzomarty/agenda-juri/blob/master/agenda/views.py"
click node_usuarios_router "https://github.com/lorenzomarty/agenda-juri/blob/master/usuarios/urls.py"
click node_usuarios_views "https://github.com/lorenzomarty/agenda-juri/blob/master/usuarios/views.py"
click node_seed_demo "https://github.com/lorenzomarty/agenda-juri/blob/master/core/management/commands/seed_demo.py"
click node_database "https://github.com/lorenzomarty/agenda-juri/blob/master/db.sqlite3"
click node_vercel_adapter "https://github.com/lorenzomarty/agenda-juri/blob/master/api/index.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_browser,node_project_urls toneBlue
class node_core_urls,node_core_dashboard,node_permissions,node_permission_utils,node_access_tags,node_navigation_tags,node_base_template,node_sidebar_nav,node_seed_demo toneAmber
class node_clientes_router,node_clientes_views,node_processos_router,node_processos_views,node_agenda_router,node_agenda_views,node_usuarios_router,node_usuarios_views toneMint
class node_database,node_vercel_adapter toneRose
```

## Components

### Runtime & routing

Django entrypoints, project URL dispatch, and serverless adapter.

- **Browser**: client · Server-rendered UI entrypoint.
- [Project URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/jurisagenda/urls.py): django router · Top-level request dispatcher. · `jurisagenda/urls.py`

### Shared platform

Dashboard, permissions, template tags, and bootstrap utilities.

- [Core URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/core/urls.py): core router · Routes the dashboard and shared pages. · `core/urls.py`
- [Dashboard](https://github.com/lorenzomarty/agenda-juri/blob/master/core/views.py): core view · Aggregates key work across domains. · `core/views.py`
- [Permissions](https://github.com/lorenzomarty/agenda-juri/blob/master/core/permissions.py): access control · Shared authorization rules. · `core/permissions.py`
- [Permission Utils](https://github.com/lorenzomarty/agenda-juri/blob/master/core/permission_utils.py): access helpers · Reusable permission checks and glue. · `core/permission_utils.py`
- [Access Tags](https://github.com/lorenzomarty/agenda-juri/blob/master/core/templatetags/access.py): template tags · Hides or shows UI by permission. · `core/templatetags/access.py`
- [Navigation Tags](https://github.com/lorenzomarty/agenda-juri/blob/master/core/templatetags/navigation.py): template tags · Builds shared navigation UI. · `core/templatetags/navigation.py`
- [Base Layout](https://github.com/lorenzomarty/agenda-juri/blob/master/templates/base.html): shared template · Common page shell for the app. · `templates/base.html`
- [Sidebar Nav](https://github.com/lorenzomarty/agenda-juri/blob/master/templates/partials/sidebar_navigation.html): partial template · Primary navigation composition. · `templates/partials/sidebar_navigation.html`
- [Seed Demo](https://github.com/lorenzomarty/agenda-juri/blob/master/core/management/commands/seed_demo.py): management command · Populates demo data for local use. · `core/management/commands/seed_demo.py`

### Domain apps

Customer, case, agenda, and user management flows.

- [Clientes URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/clientes/urls.py): app router · Customer management routes. · `clientes/urls.py`
- [Clientes UI](https://github.com/lorenzomarty/agenda-juri/blob/master/clientes/views.py): domain views · Customer CRUD screens. · `clientes/views.py`
- [Processos URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/processos/urls.py): app router · Case management routes. · `processos/urls.py`
- [Processos UI](https://github.com/lorenzomarty/agenda-juri/blob/master/processos/views.py): domain views · Case CRUD screens. · `processos/views.py`
- [Agenda URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/agenda/urls.py): app router · Event and schedule routes. · `agenda/urls.py`
- [Agenda UI](https://github.com/lorenzomarty/agenda-juri/blob/master/agenda/views.py): domain views · Agenda and event screens. · `agenda/views.py`
- [Usuarios URLs](https://github.com/lorenzomarty/agenda-juri/blob/master/usuarios/urls.py): app router · Authentication and user routes. · `usuarios/urls.py`
- [Usuarios UI](https://github.com/lorenzomarty/agenda-juri/blob/master/usuarios/views.py): auth views · Login, users, and cargo screens. · `usuarios/views.py`

### Storage & deploy

Local database and deployment shim.

- [SQLite DB](https://github.com/lorenzomarty/agenda-juri/blob/master/db.sqlite3): local database · Development persistence store. · `db.sqlite3`
- [Vercel Adapter](https://github.com/lorenzomarty/agenda-juri/blob/master/api/index.py): deployment entry · Serverless hosting integration. · `api/index.py`

## Connections

- Browser → Project URLs: requests · Incoming HTTP traffic enters Django routing.
- Project URLs → Core URLs: dashboard · Routes shared platform pages.
- Project URLs → Clientes URLs: clientes · Dispatches customer routes.
- Project URLs → Processos URLs: processos · Dispatches case routes.
- Project URLs → Agenda URLs: agenda · Dispatches agenda routes.
- Project URLs → Usuarios URLs: usuarios · Dispatches auth and user routes.
- Core URLs → Dashboard: renders · Serves the main dashboard view.
- Clientes URLs → Clientes UI: views · Customer routes map to CRUD views.
- Processos URLs → Processos UI: views · Case routes map to CRUD views.
- Agenda URLs → Agenda UI: views · Agenda routes map to CRUD views.
- Usuarios URLs → Usuarios UI: views · Auth routes map to login and user management screens.
- Clientes UI → SQLite DB: persists · Reads and writes customer data.
- Processos UI → SQLite DB: persists · Reads and writes case data.
- Agenda UI → SQLite DB: persists · Reads and writes agenda events.
- Usuarios UI → SQLite DB: persists · Reads and writes users and cargos.
- Dashboard → SQLite DB: summarizes · Pulls data for the dashboard.
- Permissions → Dashboard: guards · Shared access control protects core pages.
- Permission Utils → Permissions: supports · Utility layer for permission logic.
- Access Tags → Base Layout: shapes ui · Template tags control access-aware rendering.
- Navigation Tags → Sidebar Nav: builds · Navigation helpers feed shared menus.
- Base Layout → Sidebar Nav: includes · Base layout composes shared navigation.
- Dashboard → Base Layout: extends · Dashboard renders through the shared shell.
- Clientes UI → Base Layout: extends · Domain screens use the shared layout.
- Processos UI → Base Layout: extends · Domain screens use the shared layout.
- Agenda UI → Base Layout: extends · Domain screens use the shared layout.
- Usuarios UI → Base Layout: extends · Auth and management screens use the shared layout.
- Seed Demo → SQLite DB: seeds · Creates demo records for local development.
- Vercel Adapter → Project URLs: adapts · Bridges deployment hosting to the Django app.
