diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..62cb27d --- /dev/null +++ b/.env.example @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..296b6fd --- /dev/null +++ b/README.md @@ -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 +``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f7d29ce --- /dev/null +++ b/pyproject.toml @@ -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