# Despliegue

```mermaid
flowchart LR
  browser["Navegador del usuario<br/>HTTP"] --> angularDev["Angular dev server<br/>ng serve<br/>localhost:4200"]
  angularDev -- "Proxy /api<br/>HTTP" --> node["Node.js + Express<br/>backend/server.js<br/>localhost:3000"]
  node -- "pg TCP" --> postgres[("PostgreSQL<br/>localhost:5432<br/>database: PGDATABASE")]
  node -- "HTTPS fetch<br/>solo sincronizacion" --> socrata["datos.gov.co Socrata API<br/>www.datos.gov.co/resource/*.json"]

  subgraph Frontend
    angularDev
    proxy["proxy.conf.json<br/>/api -> http://localhost:3000"]
  end

  subgraph Backend
    node
    env["Variables de entorno<br/>NODE_ENV, PORT, CORS_ORIGINS<br/>PGHOST, PGUSER, PGDATABASE, PGPORT, PGPOOL_MAX<br/>PGPASSWORD secreto<br/>SOCRATA_APP_TOKEN secreto opcional<br/>AUTH_TOKEN_SECRET secreto<br/>AUTH_SESSION_HOURS<br/>ADMIN_USERNAME, ADMIN_FULL_NAME<br/>ADMIN_PASSWORD secreto"]
  end

  proxy --> node
  env --> node
```

## Archivos analizados

- `semillero/angular.json`
- `semillero/proxy.conf.json`
- `semillero/package.json`
- `backend/package.json`
- `backend/server.js`
- `backend/src/server.js`
- `backend/src/app.js`
- `backend/src/config/env.js`
- `backend/src/db/pool.js`
- `backend/APIinvima.js`
- `backend/APIinvima.json`
