Refactor: Vue 3 + FastAPI + SQLite architecture #1

Open
fam wants to merge 4 commits from dev into main
First-time contributor

Summary

  • Backend: FastAPI + SQLite (WAL mode), 22 tables, ~40 REST API endpoints
  • Frontend: Vue 3 + Vite + Pinia + Vue Router, 8 views (Notes/Tasks/Reminders/Body/Music/Docs/Planning/SleepBuddy)
  • Database: JSON file → SQLite with proper schema and migrations
  • Dockerfile: Multi-stage build (node:20 + python:3.12)
  • Deploy: K8s manifests (namespace, deployment, service, ingress, pvc, backup cronjob)
  • CI/CD: Gitea Actions — test.yml / deploy.yml / preview.yml (pr-$id.planner.oci.euphon.net)
  • Tests: 20 Cypress E2E files, 196 test cases, ~85% feature coverage
  • Doc: doc/test-coverage.md

Architecture (参考 oil)

frontend/          Vue 3 + Vite + Pinia
  src/stores/      auth.js, ui.js, planner.js
  src/views/       8 page components
  src/composables/ useApi.js, useDialog.js
  cypress/e2e/     20 test files
backend/           FastAPI + SQLite
  main.py          All API endpoints
  database.py      Schema (22 tables)
deploy/            K8s manifests
scripts/           deploy-preview.py
.gitea/workflows/  CI/CD pipelines

Test plan

  • cd frontend && npm run build passes
  • Backend DB init creates all 22 tables
  • Login/logout flow works
  • All 7 tabs render and CRUD works
  • Sleep Buddy register/login/record works
  • Cypress E2E tests pass
  • Docker build succeeds

🤖 Generated with Claude Code

## Summary - **Backend**: FastAPI + SQLite (WAL mode), 22 tables, ~40 REST API endpoints - **Frontend**: Vue 3 + Vite + Pinia + Vue Router, 8 views (Notes/Tasks/Reminders/Body/Music/Docs/Planning/SleepBuddy) - **Database**: JSON file → SQLite with proper schema and migrations - **Dockerfile**: Multi-stage build (node:20 + python:3.12) - **Deploy**: K8s manifests (namespace, deployment, service, ingress, pvc, backup cronjob) - **CI/CD**: Gitea Actions — test.yml / deploy.yml / preview.yml (pr-$id.planner.oci.euphon.net) - **Tests**: 20 Cypress E2E files, 196 test cases, ~85% feature coverage - **Doc**: doc/test-coverage.md ## Architecture (参考 oil) ``` frontend/ Vue 3 + Vite + Pinia src/stores/ auth.js, ui.js, planner.js src/views/ 8 page components src/composables/ useApi.js, useDialog.js cypress/e2e/ 20 test files backend/ FastAPI + SQLite main.py All API endpoints database.py Schema (22 tables) deploy/ K8s manifests scripts/ deploy-preview.py .gitea/workflows/ CI/CD pipelines ``` ## Test plan - [ ] `cd frontend && npm run build` passes - [ ] Backend DB init creates all 22 tables - [ ] Login/logout flow works - [ ] All 7 tabs render and CRUD works - [ ] Sleep Buddy register/login/record works - [ ] Cypress E2E tests pass - [ ] Docker build succeeds 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fam added 1 commit 2026-04-07 21:21:36 +00:00
Refactor to Vue 3 + FastAPI + SQLite architecture
Some checks failed
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 3s
PR Preview / teardown-preview (pull_request) Has been skipped
Test / e2e-test (push) Failing after 55s
PR Preview / deploy-preview (pull_request) Failing after 40s
d3f3b4f37b
- Backend: FastAPI + SQLite (WAL mode), 22 tables, ~40 API endpoints
- Frontend: Vue 3 + Vite + Pinia + Vue Router, 8 views, 3 stores
- Database: migrate from JSON file to SQLite with proper schema
- Dockerfile: multi-stage build (node + python)
- Deploy: K8s manifests (namespace, deployment, service, ingress, pvc, backup)
- CI/CD: Gitea Actions (test, deploy, PR preview at pr-$id.planner.oci.euphon.net)
- Tests: 20 Cypress E2E test files, 196 test cases, ~85% coverage
- Doc: test-coverage.md with full feature coverage report

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fam added 1 commit 2026-04-07 21:37:31 +00:00
Fix reminders-flow.cy.js: use parents() instead of parent()
Some checks failed
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 3s
PR Preview / teardown-preview (pull_request) Has been skipped
Test / e2e-test (push) Failing after 1m2s
PR Preview / deploy-preview (pull_request) Failing after 5s
62057d6022
The .remove-btn is nested inside .reminder-main, not a direct child
of the element containing the text. Use .parents('.reminder-card')
to traverse up to the correct ancestor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fam added 1 commit 2026-04-07 21:41:10 +00:00
Fix CI: clean stale DB before e2e tests, fix reminder selector
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 3s
PR Preview / deploy-preview (pull_request) Failing after 4s
Test / e2e-test (push) Successful in 52s
8c69e2db5b
- Clean previous run's DB/WAL/SHM files and kill stale processes
  before starting backend, preventing test data contamination
- reminders-flow: use parents('.reminder-card') to find .remove-btn

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fam added 1 commit 2026-04-07 21:43:19 +00:00
Fix deploy-preview: handle missing prod DB gracefully
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 3s
Test / e2e-test (push) Successful in 51s
PR Preview / deploy-preview (pull_request) Successful in 57s
a110d10e39
Production still uses JSON, so /data/planner.db doesn't exist yet.
Detect cp failure and use empty DB (init_db creates tables on startup).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 3s
Test / e2e-test (push) Successful in 51s
PR Preview / deploy-preview (pull_request) Successful in 57s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin dev:dev
git checkout dev
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hera/schedule-planner#1