A FastAPI service for code sharing.
- uv (fast Python package installer and resolver)
- Python 3.12 (managed automatically by
uv)
git clone https://github.com/sparrowsurya/pastebin-apiThe project comes pre-configured with default settings using a local SQLite database (sqlite:///./db.sqlite3), so creating a .env file is optional for local development and testing.
To override settings locally, you can create/modify .env.dev:
ENV_NAME=dev
BASE_URL=127.0.0.1:8000
DB_URL=sqlite:///./db.sqlite3
INTERVAL=3600Note
When running on Vercel, the application dynamically ignores the local env files and relies directly on Environment Variables configured in your Vercel Dashboard settings. Use .env.prod purely as a local template reference.
Installs the locked dependencies into a local virtual environment:
uv syncStart the application using uvicorn:
uv run uvicorn api.main:app --log-config=log_config.jsonRun the test suite via the builtin unittest framework:
uv run python -m unittest discoverTo lint the codebase with Ruff:
uv run ruff checkTo auto-format the codebase with Ruff:
uv run ruff formatTo type-check the codebase with mypy:
uv run mypy api