Add FastAPI backend, auth, AI chat, and fix Docker healthcheck - #11
Open
sanjay289 wants to merge 9 commits into
Open
Add FastAPI backend, auth, AI chat, and fix Docker healthcheck#11sanjay289 wants to merge 9 commits into
sanjay289 wants to merge 9 commits into
Conversation
The compose healthcheck ran curl, which isn't installed in the python3.12-bookworm-slim final image, so the container reported unhealthy even when the app was fine. Switched it to Python's urllib, which is already present, and verified via docker compose up --build that the container now reports healthy. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Multi-stage Dockerfile (Node build stage for the frontend, uv-based Python stage for the backend), plus start/stop scripts for Mac/Linux/PowerShell and the supporting .dockerignore/.env.example/ .gitignore entries needed to build and run the container. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implements the full backend for the Kanban app: - app/main.py: FastAPI app, health check, static file serving (NextStaticFiles resolves Next's static-export routing quirks) - app/auth.py: hardcoded-credential login, in-memory session tokens - app/db.py: SQLite schema + seeding, created on first run - app/board.py: board/column/card CRUD backed by SQLite - app/ai.py: OpenRouter client (plain + structured completions) - app/chat.py: AI chat endpoint that can read and rewrite the board, with validation to reject malformed board updates Covered by pytest across auth, board routes, static routing, AI client error handling, and chat (backend/tests/). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- lib/auth.ts + /login page + AuthGate: hardcoded login against the backend, session check on load, redirect to /login when unauthenticated - lib/api.ts: fetch client for the board/card/column endpoints, raising UnauthorizedError on 401 - KanbanBoard now loads/mutates the board through the API instead of local-only state, with optimistic updates reconciled against the server response (or a full refetch on error) - next.config.ts: static export for production, dev-mode rewrite of /api/* to the local backend (output: "export" disallows rewrites) - Playwright/vitest config and specs updated for the auth-gated, server-persisted board Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collapsible sidebar (ChatSidebar) that sends messages to POST /api/chat and replaces the board state with any AI-driven update in the response, so card/column changes made via chat show up immediately without a manual refresh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
docs/DATABASE.md and docs/schema.json record the SQLite schema (users/boards/columns/cards) and the reasoning behind it. docs/PLAN.md is updated with progress, decisions, and verification notes accumulated while building the backend, auth, board API, and AI chat. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Runs on push/PR to main: - backend: uv sync + pytest (real-OpenRouter tests self-skip without OPENROUTER_API_KEY, verified locally by running the suite without a local .env present) - frontend: npm ci, lint, vitest unit tests - e2e: Playwright against the real backend + frontend dev server, same webServer setup as local dev. Marked continue-on-error since the AI-driven spec (chat.spec.ts) depends on a real OpenRouter call and is already documented as blocked on a working API key (docs/PLAN.md); the auth/kanban specs still exercise the app end-to-end and are verified passing locally. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Author
|
Heads up on CI visibility for this PR: The workflow does work: it ran via the
Once this merges (or the workflow file otherwise lands on |
Concise entry point for Claude Code that points to the existing AGENTS.md docs and summarizes commands and cross-cutting architecture. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Read-only get_board plus create/update/delete card and rename column tools, talking to app.board/app.db directly over stdio rather than through the HTTP API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the backend, auth, and AI chat for the Kanban MVP described in
AGENTS.md/docs/PLAN.md, plus a Docker healthcheck fix and a code review of the whole repo.Summary
curlagainst the final image even though it isn't installed there (python3.12-bookworm-slim) \u2014 swapped to Python'surllib, which is already present. Added the Dockerfile, start/stop scripts (Mac/Linux/PowerShell), and supporting.dockerignore/.env.example.backend/app/): FastAPI app \u2014 hardcoded-credential login with in-memory sessions, SQLite-backed board/column/card CRUD (created and seeded on first run), an OpenRouter client, and a/api/chatendpoint that can read and rewrite the board via structured outputs, with validation that rejects malformed board updates. Covered by pytest across auth, board routes, static routing, AI client errors, and chat.AuthGate,/login), a fetch-based API client with 401 handling, and an AI chat sidebar (ChatSidebar) that applies board updates from the assistant immediately.docs/DATABASE.md/docs/schema.jsondocument the SQLite schema;docs/PLAN.mdtracks progress/decisions;docs/review.mdis a code review of the repo (backend, frontend, Docker config) noting the healthcheck fix and a few lower-severity follow-ups.Test plan
uv run pytest(auth, board CRUD, chat, static routing, AI error paths)npm run test:unit(component/lib unit tests) andnpm run test:e2e(Playwright, login/board/chat flows)docker compose up --build\u2014 confirmeddocker compose ps/docker inspectreportSTATUS: healthycurl http://localhost:8000/api/healthfrom the host returns{"status":"ok"}