Snapshot uses a standard Python src/ layout with project metadata and tooling
in pyproject.toml.
PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"Linux or macOS:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"The .[dev] extra installs Snapshot plus Black, Ruff, mypy, Pytest, coverage,
and HTTPX.
If you see this:
No module named pytest
No module named ruff
run:
python -m pip install -e ".[dev]"snapshotAlternative:
python -m uvicorn snapshot.main:app --host 0.0.0.0 --port 3000python -m pytestCheck formatting:
python -m black --check .Apply formatting:
python -m black .python -m ruff check .python -m mypypython -m black --check .
python -m ruff check .
python -m mypy
python -m pytest
docker compose config --quietThe repository Compose file stores uploads in ./data/uploads and writes the
generated ShareX config to ./data/snapshot.sxcu. Docker logs are written to
stdout/stderr and can be viewed with:
docker compose logs -f
docker compose logs --no-color > snapshot.logGenerate the ShareX config without starting the server:
make configUse Conventional Commits and Python Semantic Release:
semantic-release --noop version --print
semantic-release version
git push --follow-tagsSee Versioning.
src/snapshot/
├── api.py # FastAPI routes and app factory
├── cli.py # snapshot command
├── config.py # Pydantic settings
├── constants.py # App constants and messages
├── errors.py # API exceptions and error codes
├── log_config.py # Request-aware logging
├── main.py # ASGI app entry point
├── rate_limit.py # In-memory rate limiter
├── schemas.py # Response models
├── security.py # Secret comparison
├── storage.py # Upload storage
└── utils.py # Small shared helpers