API: Project scaffold and database schema #1

Open
opened 2026-03-28 02:09:27 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Standalone — scoped from Daily 100 design spec.

Repo

forgejo_admin/daily-100-api

User Story

As a developer
I want a FastAPI project with PostgreSQL schema
So that the backend is ready for endpoint development

Context

FastAPI project scaffold with PostgreSQL. Create daily_entries table: date DATE PRIMARY KEY, 8 boolean columns (doordash, pushups, jumprope, pullups, lunges, lsits, drills, curls) all DEFAULT FALSE, created_at TIMESTAMPTZ, updated_at TIMESTAMPTZ. Index on date DESC. All day boundaries use America/Denver timezone.

File Targets

Files the agent should modify or create:

  • app/main.py -- FastAPI application entry point
  • app/models.py -- SQLAlchemy model for daily_entries
  • app/database.py -- async DB connection and session
  • alembic/versions/001_initial.py -- initial migration
  • pyproject.toml -- project dependencies

Files the agent should NOT touch:

  • (none — greenfield)

Acceptance Criteria

  • FastAPI starts successfully
  • Alembic migration creates daily_entries table
  • Health check endpoint (GET /health) responds
  • Database connection pool configured

Test Expectations

  • Unit test: DB connection established
  • Unit test: daily_entries model matches schema
  • Run command: pytest tests/

Constraints

  • SQLAlchemy 2.0 async with asyncpg driver
  • Alembic for migrations
  • Pydantic v2 for settings

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • daily-100 -- project
### Type Feature ### Lineage Standalone — scoped from Daily 100 design spec. ### Repo `forgejo_admin/daily-100-api` ### User Story As a developer I want a FastAPI project with PostgreSQL schema So that the backend is ready for endpoint development ### Context FastAPI project scaffold with PostgreSQL. Create `daily_entries` table: date DATE PRIMARY KEY, 8 boolean columns (doordash, pushups, jumprope, pullups, lunges, lsits, drills, curls) all DEFAULT FALSE, created_at TIMESTAMPTZ, updated_at TIMESTAMPTZ. Index on date DESC. All day boundaries use America/Denver timezone. ### File Targets Files the agent should modify or create: - `app/main.py` -- FastAPI application entry point - `app/models.py` -- SQLAlchemy model for daily_entries - `app/database.py` -- async DB connection and session - `alembic/versions/001_initial.py` -- initial migration - `pyproject.toml` -- project dependencies Files the agent should NOT touch: - (none — greenfield) ### Acceptance Criteria - [ ] FastAPI starts successfully - [ ] Alembic migration creates daily_entries table - [ ] Health check endpoint (`GET /health`) responds - [ ] Database connection pool configured ### Test Expectations - [ ] Unit test: DB connection established - [ ] Unit test: daily_entries model matches schema - Run command: `pytest tests/` ### Constraints - SQLAlchemy 2.0 async with asyncpg driver - Alembic for migrations - Pydantic v2 for settings ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `daily-100` -- project
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/daily-100-api#1
No description provided.