Skip to content

Scaffold Python FastAPI backend service #15

Description

@bgorzelic

Description

The CLAUDE.md references a planned services/api Python FastAPI backend for advanced analytics and data processing that goes beyond what Next.js server actions can efficiently handle.\n\n## Proposed Scope\n\n### What Moves to FastAPI\n- Heavy computation: batch weather data processing, historical analysis\n- Machine learning: fire behavior prediction models (future)\n- Data pipeline: aggregation, ETL for analytics dashboard\n- External API orchestration: RAWS weather stations, satellite imagery\n\n### What Stays in Next.js\n- All current CRUD (observations, auth, user management)\n- Real-time UI interactions (form, map, dashboard)\n- Server-side rendering\n\n### Architecture\n\nservices/api/\n├── pyproject.toml (uv managed)\n├── src/\n│ └── firevector_api/\n│ ├── main.py (FastAPI app)\n│ ├── routers/ (API routes)\n│ ├── models/ (Pydantic models matching @firevector/schema)\n│ ├── services/ (business logic)\n│ └── db/ (SQLAlchemy or direct postgres)\n└── tests/\n

Deployment\n- Containerized (Dockerfile)\n- Deploy to Vercel Serverless Functions, Railway, or Fly.io\n- Shared database with Next.js app (same Vercel Postgres)\n\n## Acceptance Criteria\n\n- [ ] services/api/ scaffolded with FastAPI, uv, pytest\n- [ ] Health check endpoint working\n- [ ] Shared database access (read from observations table)\n- [ ] At least one analytics endpoint (e.g., EWS statistics)\n- [ ] Docker build working\n- [ ] npm run test:api runs pytest from monorepo root\n- [ ] OpenAPI docs generated at /docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowLow priority — nice to havearea: apiFastAPI backend (services/api)needs discussionNeeds team discussion or ADRsize: LLarge — 3-5 daystype: featureNew feature or capability

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions