Table of contents
Did you know that GitHub supports table of contents by default 🤔
About
This is the API for viewing maps in InNoHassle.
Technologies
- Python 3.14 & uv
- FastAPI
- Formatting and linting: Ruff, pre-commit
- Deployment: Docker, Docker Compose, GitHub Actions
Development
Set up for development
- Install uv and Docker
- Install dependencies:
- Start development server (and read logs in the terminal):
uv run -m src.api --reload
Follow the provided instructions (if needed).
- Open in the browser: http://localhost:8000
The api will be reloaded when you edit the code
Important
For endpoints requiring authorization click "Authorize" button in Swagger UI
Set up PyCharm integrations
- Run configurations (docs).
Right-click the
__main__.pyfile in the project explorer, selectRun '__main__'from the context menu. - Ruff (plugin).
It will lint and format your code. Make sure to enable
Use ruff formatoption in plugin settings. - Pydantic (plugin). It will fix PyCharm issues with type-hinting.
- Conventional commits (plugin). It will help you to write conventional commits.
Deployment
We use Docker with Docker Compose plugin to run the service on servers.
- Copy the file with environment variables:
cp .example.env .env - Change environment variables in the
.envfile - Copy the file with settings:
cp settings.example.yaml settings.yaml - Change settings in the
settings.yamlfile according to your needs (check settings.schema.yaml for more info) - Install Docker with Docker Compose
- Run the containers:
docker compose up --build --wait - Check the logs:
docker compose logs -f
FAQ
Be up to date with the template!
Check https://github.com/one-zero-eight/fastapi-template for updates once in a while.
How to update dependencies
- Run
uv sync --upgradeto update uv.lock file and install the latest versions of the dependencies. - Run
uv tree --outdated --depth=1will show what package versions are installed and what are the latest versions. - Run
uv run prek auto-update
Also, Dependabot will help you to keep your dependencies up-to-date, see dependabot.yaml.
Contributing
We are open to contributions of any kind. You can help us with code, bugs, design, documentation, media, new ideas, etc. If you are interested in contributing, please read our contribution guide.