How grgbrasil/procapi works
ProcAPI exposes judicial-process data through a read-only REST API and refreshes records asynchronously from Eproc. Existing process records provide cached results; requests for missing or stale records trigger creation or refresh. The task code stores the raw response and extracts process, event, and party data. The README also documents forced updates and retained responses for later processing. Arrows reflect the sampled routes, view logic, task calls, and service code; some internal task behavior was not sampled.
Main entry points: tasks.py Refresh tasks · views.py Process views · services.py Eproc services · models.py Process records
Components 16
REST API
- API routing
config/urls.py - Process views
procapi/processo/views.py - JSON serializers
procapi/processo/serializers.py
Refresh workflow
- Refresh tasks
procapi/processo/tasks.py - Eproc services
procapi/utils/services.py
Process data
- Process records
procapi/processo/models.py - Raw responses
procapi/processo/models.py - Events and documents
procapi/processo/models.py - Parties and people
procapi/processo/models.py - Reference catalogs
procapi/processo/models.py
Runtime configuration
- Celery app
procapi/taskapp/celery.py - Application settings
config/settings/common.py
Other components
- API client
- MongoDB
- Eproc service
- Task broker
Connections 21
- API client → API routing: requests
config/urls.py - API routing → Process views: routes to
config/urls.py - Process views → JSON serializers: serializes with
procapi/processo/views.py - Process views → Process records: queries
procapi/processo/views.py - Process views → Refresh tasks: triggers refresh
procapi/processo/views.py - Refresh tasks → Eproc services: consults
procapi/processo/tasks.py - Refresh tasks → Raw responses: stores response
procapi/processo/tasks.py - Refresh tasks → Process records: updates
procapi/processo/tasks.py - Refresh tasks → Events and documents: extracts
procapi/processo/tasks.py - Refresh tasks → Parties and people: extracts
procapi/processo/tasks.py - Refresh tasks → Reference catalogs: looks up
procapi/processo/tasks.py - Eproc services → Eproc service: calls
procapi/utils/services.py - Process records → MongoDB: persists in
- Raw responses → MongoDB: persists in
- Events and documents → MongoDB: persists in
- Parties and people → MongoDB: persists in
- Reference catalogs → MongoDB: persists in
- Celery app → Application settings: loads
procapi/taskapp/celery.py - Refresh tasks → Celery app: registers tasks
procapi/processo/tasks.py - Refresh tasks → Task broker: dispatches tasks
- Application settings → Eproc services: configures endpoints