How lorenzomarty/agenda-juri works
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: urls.py Project URLs · base.html Base Layout · db.sqlite3 SQLite DB · views.py Dashboard
Components 21
Runtime & routing
Django entrypoints, project URL dispatch, and serverless adapter.
- Browser · Server-rendered UI entrypoint.
- Project URLs · Top-level request dispatcher.
jurisagenda/urls.py
Shared platform
Dashboard, permissions, template tags, and bootstrap utilities.
- Core URLs · Routes the dashboard and shared pages.
core/urls.py - Dashboard · Aggregates key work across domains.
core/views.py - Permissions · Shared authorization rules.
core/permissions.py - Permission Utils · Reusable permission checks and glue.
core/permission_utils.py - Access Tags · Hides or shows UI by permission.
core/templatetags/access.py - Navigation Tags · Builds shared navigation UI.
core/templatetags/navigation.py - Base Layout · Common page shell for the app.
templates/base.html - Sidebar Nav · Primary navigation composition.
templates/partials/sidebar_navigation.html - Seed Demo · Populates demo data for local use.
core/management/commands/seed_demo.py
Domain apps
Customer, case, agenda, and user management flows.
- Clientes URLs · Customer management routes.
clientes/urls.py - Clientes UI · Customer CRUD screens.
clientes/views.py - Processos URLs · Case management routes.
processos/urls.py - Processos UI · Case CRUD screens.
processos/views.py - Agenda URLs · Event and schedule routes.
agenda/urls.py - Agenda UI · Agenda and event screens.
agenda/views.py - Usuarios URLs · Authentication and user routes.
usuarios/urls.py - Usuarios UI · Login, users, and cargo screens.
usuarios/views.py
Storage & deploy
Local database and deployment shim.
- SQLite DB · Development persistence store.
db.sqlite3 - Vercel Adapter · Serverless hosting integration.
api/index.py
Connections 28
- 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.