Self-hosted developer portfolio — FastAPI REST API + Next.js 15 | Docker + GitHub Actions CI/CD
| Layer | Technology |
|---|---|
| Backend | FastAPI — Python 3.12 |
| Frontend | Next.js 15 — TypeScript + TailwindCSS + TanStack Query |
| Database | SQLite via SQLModel + Alembic (migrations) |
| Auth | JWT (single-user) |
| Deploy | Coolify (self-hosted PaaS) + Cloudflare Tunnels |
| CI/CD | GitHub Actions → Proxmox (self-hosted) |
| Tool | Role |
|---|---|
| Ruff | Linter + formatter |
| mypy | Static type checking |
| Bandit | Security linter |
| pytest + pytest-cov | Tests + coverage |
| pip-audit | Dependency vulnerability scanner |
| pre-commit | Git hooks (lint, format, security) |
- pyenv — Python version management
- uv — Fast Python package manager
- nvm — Node.js version management
- Docker & Docker Compose — For containerized deployment
git clone git@github.com:YOUR_USER/portfolio.git
cd portfoliocd backend
# Python version is automatically set via .python-version
pyenv install 3.12.8 # if not already installed
# Install dependencies
uv sync
# Apply database migrations
uv run alembic upgrade head
# Run the API (dev mode with hot reload)
uv run fastapi dev app/main.pyAPI available at http://localhost:8000 Interactive docs at http://localhost:8000/docs
cd frontend
# Configure environment
cp .env.local.example .env.local
# Edit .env.local : NEXT_PUBLIC_API_URL=http://localhost:8000
npm install
npm run devApp available at http://localhost:3000
cd backend
# Run API
uv run fastapi dev app/main.py
# Apply migrations
uv run alembic upgrade head
# Create a new migration (after model changes)
uv run alembic revision --autogenerate -m "description"
# Lint
uv run ruff check .
# Format
uv run ruff format .
# Type checking
uv run mypy app/
# Security scan (code)
uv run bandit -r app/
# Security scan (dependencies)
uv run pip-audit
# Tests with coverage
uv run pytestcd frontend
# Dev server (hot reload)
npm run dev
# Production build
npm run build
# Lint
npm run lint# Install pre-commit hooks (run once)
pre-commit install
# Run all hooks manually
pre-commit run --all-files# Build et lancer l'API
docker compose up --build
# En arrière-plan
docker compose up -d
# Logs
docker compose logs -f api
# Arrêter
docker compose downThis project is licensed under the MIT License.