Installation¶
Requirements¶
| Requirement | Version | Notes |
|---|---|---|
| Python | >= 3.13 | Required for all features |
| uv | latest | Fast Python package manager |
| fping | any (optional) | For fast bulk latency measurement |
Install from Source¶
1. Clone the repository¶
2. Install uv (if not installed)¶
3. Install dependencies¶
# Production dependencies only
uv sync --no-dev
# With development dependencies (testing, linting)
uv sync
This creates a .venv/ virtual environment and installs all packages.
4. Create configuration file¶
Edit .env to match your environment. See Configuration for all options.
5. Verify installation¶
Install fping (Optional)¶
fping enables significantly faster bulk latency measurements. Without it, the API falls back to TCP connect (which still works but is slower).
Verify: fping --version
Project Structure¶
draco-metric/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI application entry point
│ ├── settings.py # Pydantic Settings configuration
│ ├── middleware/
│ │ ├── auth.py # API key authentication
│ │ └── rate_limit.py # Rate limiting
│ ├── models/
│ │ └── vpn.py # VPNServer, CountryInfo schemas
│ ├── routers/
│ │ └── vpn.py # API endpoint definitions
│ └── services/
│ ├── vpn_service.py # HTTP client + abstract base class
│ ├── nordvpn_service.py # NordVPN provider implementation
│ ├── surfshark_service.py # Surfshark provider implementation
│ └── latency_service.py # Latency measurement (fping/TCP)
├── tests/
│ ├── conftest.py # Test fixtures
│ ├── test_endpoints.py # API integration tests
│ └── test_services.py # Service unit tests
├── docs/ # This documentation
├── .env.example # Configuration template
├── Containerfile # Podman/Docker build
├── pyproject.toml # Project metadata and dependencies
└── mkdocs.yml # Documentation config
Development Tools¶
Running tests¶
uv run pytest # Run all tests with coverage
uv run pytest -v # Verbose output
uv run pytest tests/test_services.py # Run specific test file
Linting and formatting¶
Starting the dev server¶
The --reload flag enables hot-reload on code changes.