feat(01-01): initialize Python project with uv and dependencies

- Add pyproject.toml with FastAPI, SQLAlchemy, Pydantic dependencies
- Configure ruff linter with Python 3.12 target
- Create .env.example with documented environment variables
- Add README.md with development setup instructions
This commit is contained in:
Mikkel Georgsen 2026-01-25 20:08:14 +00:00
parent 262a32673b
commit 300b3ddb0a
3 changed files with 93 additions and 0 deletions

23
.env.example Normal file
View file

@ -0,0 +1,23 @@
# Database Configuration
# PostgreSQL connection string using asyncpg driver
DATABASE_URL=postgresql+asyncpg://debate:debate@localhost:5432/debate
# Security
# Generate with: openssl rand -hex 32
SECRET_KEY=your-secret-key-here-generate-with-openssl-rand-hex-32
# Environment
# Options: development, production
ENVIRONMENT=development
# Debug Mode
# Set to false in production
DEBUG=true
# Allowed Hosts
# Comma-separated list of allowed host headers
ALLOWED_HOSTS=localhost,127.0.0.1
# CORS Origins
# Comma-separated list of allowed origins for CORS
ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000

19
README.md Normal file
View file

@ -0,0 +1,19 @@
# Debate Backend
Backend API for the Debate Linux distribution builder platform.
## Development
```bash
# Create virtual environment
uv venv
# Activate
source .venv/bin/activate
# Install dependencies
uv pip install -e ".[dev]"
# Run development server
uvicorn backend.app.main:app --reload
```

51
pyproject.toml Normal file
View file

@ -0,0 +1,51 @@
[project]
name = "debate-backend"
version = "0.1.0"
description = "Backend API for the Debate Linux distribution builder platform"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [
{ name = "Debate Team" }
]
dependencies = [
"fastapi[all]>=0.115.0",
"uvicorn[standard]>=0.30.0",
"sqlalchemy[asyncio]>=2.0.0",
"asyncpg<0.29.0",
"alembic",
"pydantic>=2.10.0",
"pydantic-settings",
"slowapi",
"fastapi-csrf-protect",
"python-multipart",
]
[project.optional-dependencies]
dev = [
"pytest",
"pytest-asyncio",
"pytest-cov",
"httpx",
"ruff",
"mypy",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["backend"]
[tool.ruff]
line-length = 88
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
[tool.mypy]
python_version = "3.12"
strict = true