Skip to main content

Backend Development

Guide for developing the FacilFlow backend.

Technology Stack

  • Runtime: Node.js 18+
  • Framework: Express.js
  • Database: PostgreSQL, InfluxDB
  • Auth: Firebase Admin SDK
  • Logging: Winston

Project Structure

backend/
├── src/
│ ├── server.js # Express app setup
│ ├── routes/
│ │ ├── pipelines.js # Pipeline CRUD
│ │ ├── agents.js # Agent management
│ │ ├── catalog.js # Data catalog
│ │ └── health.js # Health checks
│ └── services/ # Business logic
├── tests/ # Jest tests
└── package.json

API Routes

Pipelines /api/pipelines

MethodEndpointDescription
GET/List all pipelines
POST/Create pipeline
GET/:idGet pipeline details
PUT/:idUpdate pipeline
DELETE/:idDelete pipeline
POST/:id/startStart pipeline
POST/:id/stopStop pipeline

Agents /api/agents

MethodEndpointDescription
GET/List all agents
GET/:idGet agent details
GET/:id/statusGet agent health
POST/:id/restartRestart agent

Catalog /api/catalog

MethodEndpointDescription
GET/Get full catalog
GET/sourcesList data sources
GET/sources/:id/tagsList source tags
POST/queryQuery data

Running Tests

cd backend
npm test # Run all tests
npm test -- --watch # Watch mode