How lenekerc98/geoportal-backend works
Catastro API 2026 is a FastAPI backend for a GIS-enabled cadastral system. The main workflow is an API client calling registered routes: authentication and authorization protect requests, GIS routes read or modify cadastral/spatial data, and responses return to the client. Separate routes manage users, companies, projects, configuration, drawings, and system operations. Spatial services catalog orthoimages and process GIS files; PostgreSQL/PostGIS stores application and spatial data. The excerpts show application wiring and selected service calls, but not the full GIS route behavior, so uncertain service links are omitted or marked unverified.
Main entry points: database.py Database sessions · main.py FastAPI application · gis.py Cadastral GIS routes · auth.py Authentication routes
Components 26
API and operations
- FastAPI application
app/main.py - Configuration routes
app/routers/config.py - System routes
app/routers/system.py
Identity and administration
- Authentication routes
app/routers/auth.py - User and role routes
app/routers/users.py - Company routes
app/routers/empresas.py - Project routes
app/routers/proyectos.py - User and tenancy models
app/models/user.py - Password and token security
app/core/security.py
GIS and cataloging
- Drawing routes
app/routers/dibujo.py - Cadastral GIS routes
app/routers/gis.py - Drawing model
app/models/dibujo.py - Orthoimage cataloging
app/core/catalogacion_service.py - Orthoimage processing
app/core/ortofoto_service.py - GIS file utilities
app/core/file_utils.py - Shapefile processing
app/services/shapefile_service.py - CAD processing
app/services/cad_service.py - SQL Server integration
app/services/sqlserver_service.py
Data and platform
- SMTP configuration model
app/models/config.py - Database sessions
app/core/database.py - PostgreSQL and PostGIS
- Spatial schema initialization
app/core/init_db.py - Audit and alerting
app/core/logger.py - Audit log model
app/models/log.py
Other components
- API client
- SMTP mail service
Connections 37
- API client → FastAPI application: sends requests
app/main.py - FastAPI application → Authentication routes: registers routes
app/main.py - FastAPI application → User and role routes: registers routes
app/main.py - FastAPI application → Company routes: registers routes
app/main.py - FastAPI application → Project routes: registers routes
app/main.py - FastAPI application → Configuration routes: registers routes
app/main.py - FastAPI application → Drawing routes: registers routes
app/main.py - FastAPI application → System routes: registers routes
app/main.py - FastAPI application → Cadastral GIS routes: registers routes
app/main.py - FastAPI application → Spatial schema initialization: initializes schema
app/main.py - FastAPI application → Database sessions: creates tables
app/main.py - FastAPI application → Audit and alerting: logs failures
app/main.py - Authentication routes → Database sessions: gets sessions
app/routers/auth.py - Authentication routes → Password and token security: verifies and signs
app/routers/auth.py - User and role routes → Database sessions: gets sessions
app/routers/users.py - User and role routes → Password and token security: uses token security
app/routers/users.py - Configuration routes → Database sessions: gets sessions
app/routers/config.py - Drawing routes → Database sessions: gets sessions
app/routers/dibujo.py - Company routes → Database sessions: gets sessions
app/routers/empresas.py - Project routes → Database sessions: gets sessions
app/routers/proyectos.py - System routes → Database sessions: gets sessions
app/routers/system.py - Cadastral GIS routes → Database sessions: gets sessions
app/routers/gis.py - Database sessions → PostgreSQL and PostGIS: connects to
app/core/database.py - Spatial schema initialization → PostgreSQL and PostGIS: creates spatial schema
- User and tenancy models → Database sessions: maps ORM tables
app/models/user.py - SMTP configuration model → Database sessions: maps ORM table
app/models/config.py - Drawing model → Database sessions: maps ORM table
app/models/dibujo.py - Audit log model → Database sessions: maps ORM table
app/models/log.py - Audit and alerting → Audit log model: writes audit records
app/core/logger.py - Audit and alerting → SMTP mail service: sends alerts
app/core/logger.py - Orthoimage cataloging → GIS file utilities: uses path helpers
app/core/catalogacion_service.py - Orthoimage processing → GIS file utilities: uses storage helpers
app/core/ortofoto_service.py - Cadastral GIS routes → Orthoimage cataloging: dispatches cataloging
app/routers/gis.py - Cadastral GIS routes → Orthoimage processing: dispatches processing
app/routers/gis.py - Cadastral GIS routes → Shapefile processing: uses GIS processing
app/routers/gis.py - Cadastral GIS routes → CAD processing: uses CAD processing
app/routers/gis.py - Cadastral GIS routes → SQL Server integration: uses integration
app/routers/gis.py