https://github.com/aphp/federation-api
https://github.com/aphp/federation-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aphp/federation-api
- Owner: aphp
- Created: 2024-06-03T09:11:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-10T08:29:38.000Z (over 1 year ago)
- Last Synced: 2025-09-09T09:24:49.138Z (10 months ago)
- Language: Python
- Size: 104 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README


[](https://sonarcloud.io/summary/new_code?id=aphp_federation-api)
[](https://sonarcloud.io/summary/new_code?id=aphp_federation-api)
# Federation API
## Stack technique
- ⚡ [**FastAPI**](https://fastapi.tiangolo.com)
- 🔍 [Pydantic](https://docs.pydantic.dev)
- 🧰 [SQLAlchemy](https://www.sqlalchemy.org/)
- 💾 [PostgreSQL](https://www.postgresql.org)
- 🔒 Secure password hashing
- 🔑 JWT authentication (for dev only)
# Setup
## 1. 🎨 Récupérer le projet
```sh
git clone https://github.com/aphp/federation-api.git
```
## 2. 🚀 Lancer le projet
### Avec Docker 🐋
* Créer le fichier de variables d'environnement `federation-api/.env` à base du template `.env.example`
```sh
cd federation-api
docker compose --env-file .docker.env up
```
* Accéder à la documentation de l'API sur [localhost:8000/docs](localhost:8000/docs)
* S'authentifier avec **admin**/**1234** pour tester les routes de l'API
### Avec Uvicorn 🦄
Avec Python 3.12 déjà installé, procéder comme suit:
* Installer UV et créer un environnement virtuel
```sh
cd federation-api
pip install uv && uv venv py312venv && uv pip install --no-cache -r requirements.txt
```
* Créer le fichier de variables d'environnement `federation-api/.env` à base du template `.env.example`
* Démarrer Uvicorn
```sh
source py312venv/bin/activate
(py312venv) uvicorn platform_registry.main:app --port 8000 --reload
```
* Accéder à la documentation de l'API sur [localhost:8000/docs](localhost:8000/docs)
* Pour tester l'API:
1. configurer un serveur de BD PotgreSQL et lancer les migrations avec `Alembic`
```sh
(py312venv) alembic upgrade head
```
2. Lancer le script pour créer un utilisateur initial `admin`
```sh
(py312venv) python platform_registry/initial_data.py
```
3. S'authentifier avec **admin**/**1234** pour tester les routes de l'API