# luisga64/censo-django architecture

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

- Interactive diagram: https://gitdiagram.com/luisga64/censo-django
- Repository: https://github.com/luisga64/censo-django

## Overview

CensoWeb is a Django application for managing community and organization census records. The principal workflow is a user submitting or searching for community, person, and household information, with application views using domain models to persist or retrieve records. The README also describes document generation, analytics, maps, bulk import, REST/JWT integration, multi-tenancy, and security. Source excerpts were not provided for these modules, so specific internal calls and data flows beyond the application entry points are not asserted.

Main entry points: [`censoapp/models.py`](https://github.com/luisga64/censo-django/blob/master/censoapp/models.py) (Census records), [`censoapp/urls.py`](https://github.com/luisga64/censo-django/blob/master/censoapp/urls.py) (Application routes), [`censoapp/document_views.py`](https://github.com/luisga64/censo-django/blob/master/censoapp/document_views.py) (Document generation), [`censoapp/viewsets.py`](https://github.com/luisga64/censo-django/blob/master/censoapp/viewsets.py) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Census Management"]
  node_urls["Application routes<br/>[urls.py]"]
  node_views["Census workflows<br/>[views.py]"]
  node_orgs["Organizations"]
  node_models["Census records<br/>[models.py]"]
  node_store[("Application database")]
  node_import["Bulk import"]
  node_backup["Database backup<br/>[backup_database.py]"]
end

subgraph group_insights["Reporting and Discovery"]
  node_analytics["Analytics<br/>[analytics.py]"]
  node_dashboard["Dashboard<br/>[dashboard_views.py]"]
  node_search["Global search<br/>[search_views.py]"]
  node_geo["Geolocation"]
end

subgraph group_extensions["Documents and Integrations"]
  node_documents["Document generation<br/>[document_views.py]"]
  node_templates["Document templates<br/>[template_models.py]"]
  node_api["REST API<br/>[viewsets.py]"]
  node_serializers["API serialization<br/>[serializers.py]"]
  node_notifications["Notifications"]
end

subgraph group_security["Identity and Security"]
  node_auth["Authentication<br/>[auth_backends.py]"]
  node_security["Security controls<br/>[security_models.py]"]
  node_middleware["Request middleware<br/>[middleware.py]"]
end

node_user(("Community user"))
node_email["Email service"]

node_user -->|"sends requests"| node_urls
node_urls -->|"routes requests"| node_views
node_urls -->|"routes requests"| node_orgs
node_views -->|"accesses records"| node_models
node_orgs -->|"accesses records"| node_models
node_models -->|"persists records"| node_store
node_import -->|"loads records"| node_models
node_dashboard -->|"presents metrics"| node_analytics
node_search -->|"searches records"| node_models
node_geo -->|"accesses records"| node_models
node_documents -->|"uses templates"| node_templates
node_documents -->|"accesses records"| node_models
node_api -->|"serializes data"| node_serializers
node_api -->|"accesses records"| node_models
node_notifications -.->|"sends email"| node_email
node_middleware -->|"checks identity"| node_auth
node_auth -->|"uses security state"| node_security
node_backup -->|"backs up database"| node_store

click node_urls "https://github.com/luisga64/censo-django/blob/master/censoapp/urls.py"
click node_views "https://github.com/luisga64/censo-django/blob/master/censoapp/views.py"
click node_orgs "https://github.com/luisga64/censo-django/blob/master/censoapp/organization_views.py"
click node_models "https://github.com/luisga64/censo-django/blob/master/censoapp/models.py"
click node_import "https://github.com/luisga64/censo-django/blob/master/censoapp/importador_masivo.py"
click node_analytics "https://github.com/luisga64/censo-django/blob/master/censoapp/analytics.py"
click node_dashboard "https://github.com/luisga64/censo-django/blob/master/censoapp/dashboard_views.py"
click node_search "https://github.com/luisga64/censo-django/blob/master/censoapp/search_views.py"
click node_geo "https://github.com/luisga64/censo-django/blob/master/censoapp/geolocation_views.py"
click node_documents "https://github.com/luisga64/censo-django/blob/master/censoapp/document_views.py"
click node_templates "https://github.com/luisga64/censo-django/blob/master/censoapp/template_models.py"
click node_api "https://github.com/luisga64/censo-django/blob/master/censoapp/viewsets.py"
click node_serializers "https://github.com/luisga64/censo-django/blob/master/censoapp/serializers.py"
click node_notifications "https://github.com/luisga64/censo-django/blob/master/censoapp/notification_service.py"
click node_auth "https://github.com/luisga64/censo-django/blob/master/censoapp/auth_backends.py"
click node_security "https://github.com/luisga64/censo-django/blob/master/censoapp/security_models.py"
click node_middleware "https://github.com/luisga64/censo-django/blob/master/censoapp/middleware.py"
click node_backup "https://github.com/luisga64/censo-django/blob/master/censoapp/management/commands/backup_database.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_urls,node_views,node_orgs,node_models,node_store,node_import,node_backup,node_user toneBlue
class node_analytics,node_dashboard,node_search,node_geo toneAmber
class node_documents,node_templates,node_api,node_serializers,node_notifications toneMint
class node_auth,node_security,node_middleware toneRose
class node_email toneIndigo
```

## Components

### Census Management

- [Application routes](https://github.com/luisga64/censo-django/blob/master/censoapp/urls.py): `censoapp/urls.py`
- [Census workflows](https://github.com/luisga64/censo-django/blob/master/censoapp/views.py): `censoapp/views.py`
- [Organizations](https://github.com/luisga64/censo-django/blob/master/censoapp/organization_views.py): `censoapp/organization_views.py`
- [Census records](https://github.com/luisga64/censo-django/blob/master/censoapp/models.py): `censoapp/models.py`
- **Application database**
- [Bulk import](https://github.com/luisga64/censo-django/blob/master/censoapp/importador_masivo.py): `censoapp/importador_masivo.py`
- [Database backup](https://github.com/luisga64/censo-django/blob/master/censoapp/management/commands/backup_database.py): `censoapp/management/commands/backup_database.py`

### Reporting and Discovery

- [Analytics](https://github.com/luisga64/censo-django/blob/master/censoapp/analytics.py): `censoapp/analytics.py`
- [Dashboard](https://github.com/luisga64/censo-django/blob/master/censoapp/dashboard_views.py): `censoapp/dashboard_views.py`
- [Global search](https://github.com/luisga64/censo-django/blob/master/censoapp/search_views.py): `censoapp/search_views.py`
- [Geolocation](https://github.com/luisga64/censo-django/blob/master/censoapp/geolocation_views.py): `censoapp/geolocation_views.py`

### Documents and Integrations

- [Document generation](https://github.com/luisga64/censo-django/blob/master/censoapp/document_views.py): `censoapp/document_views.py`
- [Document templates](https://github.com/luisga64/censo-django/blob/master/censoapp/template_models.py): `censoapp/template_models.py`
- [REST API](https://github.com/luisga64/censo-django/blob/master/censoapp/viewsets.py): `censoapp/viewsets.py`
- [API serialization](https://github.com/luisga64/censo-django/blob/master/censoapp/serializers.py): `censoapp/serializers.py`
- [Notifications](https://github.com/luisga64/censo-django/blob/master/censoapp/notification_service.py): `censoapp/notification_service.py`

### Identity and Security

- [Authentication](https://github.com/luisga64/censo-django/blob/master/censoapp/auth_backends.py): `censoapp/auth_backends.py`
- [Security controls](https://github.com/luisga64/censo-django/blob/master/censoapp/security_models.py): `censoapp/security_models.py`
- [Request middleware](https://github.com/luisga64/censo-django/blob/master/censoapp/middleware.py): `censoapp/middleware.py`

### Other components

- **Community user**
- **Email service**

## Connections

- Community user → Application routes: sends requests
- Application routes → Census workflows: routes requests
- Application routes → Organizations: routes requests
- Census workflows → Census records: accesses records
- Organizations → Census records: accesses records
- Census records → Application database: persists records
- Bulk import → Census records: loads records
- Dashboard → Analytics: presents metrics
- Global search → Census records: searches records
- Geolocation → Census records: accesses records
- Document generation → Document templates: uses templates
- Document generation → Census records: accesses records
- REST API → API serialization: serializes data
- REST API → Census records: accesses records
- Notifications → Email service: sends email
- Request middleware → Authentication: checks identity
- Authentication → Security controls: uses security state
- Database backup → Application database: backs up database
