d19183923c834ae505c8c4b894ad21a886a84c90
Extracted from oil project — business logic removed, auth/db/deploy infrastructure generalized with APP_NAME placeholders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Base Template
Vue 3 + FastAPI + SQLite full-stack template with K8s deployment.
Tech Stack
- Frontend: Vue 3 + Vite + Pinia + Vue Router
- Backend: FastAPI + SQLite (WAL mode) + uvicorn
- Testing: Vitest (unit) + Cypress (E2E)
- Deploy: Docker multi-stage build → K8s (k3s + Traefik)
- CI/CD: Gitea Actions (test → deploy, PR preview)
Quick Start
# Frontend
cd frontend && npm install && npm run dev
# Backend (in another terminal)
pip install -r backend/requirements.txt
DB_PATH=./dev.db uvicorn backend.main:app --reload --port 8000
Frontend dev server proxies /api to localhost:8000.
Setup for New Project
- Replace all
APP_NAMEplaceholders indeploy/,scripts/, and.gitea/workflows/ - Add your tables to
backend/database.py→init_db() - Add your routes to
backend/main.py - Add your pages to
frontend/src/views/and register infrontend/src/router/index.js
Testing
cd frontend
npm run test:unit # Vitest
npm run test:e2e # Cypress (requires both servers running)
npm test # Both
Deploy
# Production
python3 scripts/deploy-preview.py deploy-prod
# PR preview
python3 scripts/deploy-preview.py deploy <PR_ID>
python3 scripts/deploy-preview.py teardown <PR_ID>
Project Structure
├── frontend/
│ ├── src/
│ │ ├── composables/useApi.js # HTTP client with auth
│ │ ├── stores/auth.js # Auth state (Pinia)
│ │ ├── router/index.js # Routes
│ │ ├── views/ # Page components
│ │ └── assets/styles.css # Design tokens + base styles
│ ├── cypress/ # E2E tests
│ └── vite.config.js
├── backend/
│ ├── main.py # FastAPI app + routes
│ ├── auth.py # Auth dependencies
│ └── database.py # SQLite init + helpers
├── deploy/ # K8s manifests (replace APP_NAME)
├── scripts/deploy-preview.py # Deploy automation
├── .gitea/workflows/ # CI/CD pipelines
└── Dockerfile # Multi-stage build
Description
Languages
Python
55.9%
JavaScript
20.4%
CSS
12.7%
Vue
8%
Dockerfile
1.9%
Other
1.1%