generated from gilles/template-webapp
claude code
This commit is contained in:
71
backend/README.md
Normal file
71
backend/README.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# HomeStock Backend
|
||||
|
||||
Backend API pour la gestion d'inventaire domestique.
|
||||
|
||||
## Stack technique
|
||||
|
||||
- **FastAPI** : Framework web moderne et performant
|
||||
- **SQLAlchemy 2.0+** : ORM avec support asynchrone
|
||||
- **SQLite** : Base de données embarquée
|
||||
- **Alembic** : Migrations de base de données
|
||||
- **Pydantic** : Validation des données
|
||||
- **Loguru** : Logging avancé
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Avec uv (recommandé)
|
||||
uv sync
|
||||
|
||||
# Ou avec pip
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
## Lancement
|
||||
|
||||
```bash
|
||||
# Mode développement (avec hot-reload)
|
||||
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||||
|
||||
# Ou via le Makefile depuis la racine
|
||||
make dev-backend
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
# Lancer les tests
|
||||
uv run pytest
|
||||
|
||||
# Avec couverture
|
||||
uv run pytest --cov=app --cov-report=html
|
||||
```
|
||||
|
||||
## Migrations
|
||||
|
||||
```bash
|
||||
# Créer une nouvelle migration
|
||||
uv run alembic revision --autogenerate -m "Description"
|
||||
|
||||
# Appliquer les migrations
|
||||
uv run alembic upgrade head
|
||||
|
||||
# Rollback
|
||||
uv run alembic downgrade -1
|
||||
```
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
backend/
|
||||
├── app/
|
||||
│ ├── core/ # Configuration, database, logging
|
||||
│ ├── models/ # Modèles SQLAlchemy
|
||||
│ ├── schemas/ # Schémas Pydantic
|
||||
│ ├── routers/ # Endpoints API
|
||||
│ ├── services/ # Logique métier
|
||||
│ ├── repositories/ # Accès données
|
||||
│ └── utils/ # Utilitaires
|
||||
├── alembic/ # Migrations
|
||||
└── tests/ # Tests
|
||||
```
|
||||
Reference in New Issue
Block a user