Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/germainlefebvre4/fastapi-backend-clickhouse-boilerplate
Python FastAPI with Clickhouse boilerplate
https://github.com/germainlefebvre4/fastapi-backend-clickhouse-boilerplate
Last synced: 15 days ago
JSON representation
Python FastAPI with Clickhouse boilerplate
- Host: GitHub
- URL: https://github.com/germainlefebvre4/fastapi-backend-clickhouse-boilerplate
- Owner: germainlefebvre4
- License: gpl-3.0
- Created: 2023-08-18T09:30:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-18T09:46:41.000Z (about 1 year ago)
- Last Synced: 2024-10-10T20:52:21.983Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 136 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python FastAPI with Clickhouse boilerplate
Python FastAPI with Clickhouse boilerplate based on [https://github.com/tiangolo/full-stack-fastapi-postgresql](https://github.com/tiangolo/full-stack-fastapi-postgresql).
## Getting started
Install required packages:
```bash
sudo apt update
sudo apt install python3-pip python3-dev
pip install poetry
```Setup the database:
```bash
docker compose up -d db
```Run the app:
```bash
poetry install
poetry run alembic upgrade head
poetry run python app/initial_data.py
poetry run uvicorn app.main:app --port=8080 --reload
```### Troubleshooting
Some distributions might miss some packages. These are some hints if needed:
```bash
# cryptography/cffi
sudo apt install build-essential libssl-dev libffi-dev libpq-dev
```## Development
### Setup workspace
```bash
sudo apt update
sudo apt install python3-pip python3-dev
pip install poetry
poetry install
```### Run locally
This section use docker database called `bspauto`.
```bash
docker compose up -d db
poetry run alembic upgrade head
poetry run python app/initial_data.py
poetry run uvicorn app.main:app --port=8080 --reload
```### Run tests
This section use docker database called `bspauto_test`.
```bash
docker compose up -d db_test
poetry run pytest -sv app/tests/
```