Skip to content

[FEATURE] API Project Setup — FastAPI scaffold, config, and entry point #230

@gelluisaac

Description

@gelluisaac

Description

Create the initial FastAPI project structure for the AstroML web dashboard API.
This is the foundational task that all other API issues depend on.

Tasks

  • Create api/ directory at project root with __init__.py, main.py, config.py
  • Set up FastAPI app with CORS middleware (allow the Vite frontend origin)
  • Add uvicorn[standard] to project dependencies (or a requirements-api.txt)
  • Create configuration via Pydantic BaseSettings (database URL, API keys, model paths)
  • Add a health-check endpoint: GET /health returning {"status": "ok"}
  • Add a GET /api/v1 root endpoint with version info
  • Wire up logging (structlog or standard logging)
  • Add make run-api target to Makefile

Acceptance Criteria

  • uvicorn api.main:app --reload starts the server on http://localhost:8000
  • GET /health returns 200 with status ok
  • CORS headers allow requests from http://localhost:5173 (Vite dev server)
  • All configuration is loaded from environment variables / .env file

Dependencies

  • Python 3.10+
  • FastAPI, uvicorn, pydantic-settings

Labels

enhancement, api, good first issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions