Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker/.claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(.venv/Scripts/python -c \"import fastapi; print\\(fastapi.__version__\\)\")",
"Read(//c/Users/cgold/Desktop/polywatch/**)",
"Bash(gh pr create --title 'feat: FastAPI app configuration' --body ':*)"
]
}
}
19 changes: 19 additions & 0 deletions files/LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,22 @@ Running record of work sessions. Newest at the top. Low ceremony — the point i
---

<!-- Entries go below this line, newest first -->

## 2026-04-11

**Did:**
- Initial repo scaffold — `pyproject.toml` with full dep stack, `.gitignore`, `.pre-commit-config.yaml`, Dockerfiles, Terraform stubs, scripts, ADRs (0000–0015), architecture/plan docs, and src skeleton
- Added GitHub Actions workflows: `ci.yml` (lint → type-check → tests → docker build, security in parallel), `deploy-dev.yml` (push to Artifact Registry on merge to main), `deploy-prod.yml` (GCP deploy on semver tag with manual approval gate)
- Added `src/polywatch/config.py` — `Settings` class via `pydantic-settings`; also added `ignore_missing_imports` to mypy config so pre-commit passes without all deps installed locally
- Added Postgres service to `docker/docker-compose.yml`
- Added `src/polywatch/api/main.py` — FastAPI app instance with `GET /` and `GET /health` endpoints (entry point for all future routes)
- Added `src/polywatch/logger.py` — `structlog`-based `setup_logging()` and module-level `log` instance
- Opened PR #3 (`feat/fastapi`) documenting that this branch is where FastAPI will be configured

**Next:**
- Define routers and route modules under `src/polywatch/api/routes/`
- Wire up DB session dependency injection
- Add middleware (CORS, request ID, OpenTelemetry tracing)
- Implement lifespan events (startup/shutdown hooks)

**Stuck on / questions:** —
13 changes: 13 additions & 0 deletions src/polywatch/api/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from fastapi import FastAPI

app = FastAPI()


@app.get("/") # type: ignore[misc]
def read_root() -> dict[str, str]:
return {"Hello": "World"}


@app.get("/health") # type: ignore[misc]
def read_health() -> dict[str, str]:
return {"status": "healthy"}
21 changes: 21 additions & 0 deletions src/polywatch/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import logging
import sys

import structlog


def setup_logging(log_level: str = "INFO") -> None:
structlog.configure(
processors=[
structlog.contextvars.merge_contextvars,
structlog.processors.add_log_level,
structlog.processors.TimeStamper(fmt="iso"),
structlog.processors.JSONRenderer(),
],
wrapper_class=structlog.make_filtering_bound_logger(logging.getLevelName(log_level)),
context_class=dict,
logger_factory=structlog.PrintLoggerFactory(sys.stdout),
)


log = structlog.get_logger()
Loading