No description
Find a file
2025-08-23 16:35:35 +00:00
.forgejo/workflows feat: add development ci 2025-08-23 16:25:56 +00:00
docs fix some issues and add features 2025-08-23 16:19:58 +00:00
src refactor: remove sigliton 2025-08-23 16:35:35 +00:00
.env.example fix some issues and add features 2025-08-23 16:19:58 +00:00
.gitignore fix some issues and add features 2025-08-23 16:19:58 +00:00
.importlinter fix some issues and add features 2025-08-23 16:19:58 +00:00
.pre-commit-config.yaml fix some issues and add features 2025-08-23 16:19:58 +00:00
docker-compose.yaml fix some issues and add features 2025-08-23 16:19:58 +00:00
Dockerfile fix some issues and add features 2025-08-23 16:19:58 +00:00
LICENSE Initial commit 2025-07-04 16:53:26 +02:00
logging-granian.json init 2025-07-04 16:54:25 +02:00
mypy.ini fix some issues and add features 2025-08-23 16:19:58 +00:00
prometheus.yml fix some issues and add features 2025-08-23 16:19:58 +00:00
pyproject.toml fix some issues and add features 2025-08-23 16:19:58 +00:00
README.md refactor: rename to just service template without fastapi 2025-08-23 15:39:18 +00:00
requirements-dev.txt fix some issues and add features 2025-08-23 16:19:58 +00:00
requirements.txt fix some issues and add features 2025-08-23 16:19:58 +00:00
uv.lock fix some issues and add features 2025-08-23 16:19:58 +00:00

Service Template

A design template for services with emphasis on asynchronous operations and database integration.

Features

  • Asynchronous handling of HTTP requests (FastAPI).
  • PostgreSQL database support (asyncpg, SQLModel)
  • Job queues (Celery, RabbitMQ)
  • Caching and rate limiting (Redis, slowapi)
  • Configurable settings via .env file
  • Ready integration with database migration tools (Alembic)
  • Extensive logging system (Rich, Granian)
  • Application healthiness (healthchecks)
  • Support for CORS, GZIP, HTTPS redirect, Trusted Hosts

Requirements

  • Python 3.12+
  • Docker (optional, to run in a container)

Installation

  1. Clone the repository: sh git clone <address_repository> cd service-template
  2. Install dependencies:

uv sync

3. Configure the `.env` file according to your needs.
## Run the application
Locally:
```sh
uv run manage-cli api serve

In Docker: ``sh docker build -t service-template . docker run -p 8000:8000 service-template

## Project structure
- `src/service_template/` - main application code
- `src/alembic/` - database migrations
- `tests/` - unit and integration tests
## management commands
All commands are available via CLI:
``sh
uv run manage-cli --help
```.
## Endpoints
- OpenAPI documentation: `/docs`.
- Redoc: `/redoc`
- Healthcheck: `/api/v1/health`.
## Author
Illia Bahlai - i.bahlai@3dcra.eu