Backend 2026 TerminéCompleted

Library API

API REST complète pour la gestion d'une bibliothèque, construite avec FastAPI et SQLAlchemy. Complete REST API for library management, built with FastAPI and SQLAlchemy.

Architecture en couches avec séparation des responsabilités, validation Pydantic, hashage bcrypt et documentation interactive Swagger/ReDoc. Layered architecture with clear separation of concerns, Pydantic validation, bcrypt hashing and interactive Swagger/ReDoc documentation.

2026
Projet Software EngineeringSoftware Engineering project
Library API — FastAPI REST

En 30 secondes

API REST modulaire pour gérer auteurs, livres, exemplaires, membres, bibliothécaires et prêts. Flux Client → Router → Schema → CRUD → Model → MySQL, avec 3 niveaux de tests (unitaires, système, fonctionnels) et collection Postman incluse. Modular REST API to manage authors, books, copies, members, librarians and loans. Flow: Client → Router → Schema → CRUD → Model → MySQL, with 3 test levels (unit, system, functional) and an included Postman collection.

5
Couches architectureArchitecture layers
4
Entités principalesCore entities
10+
Endpoints RESTREST endpoints
3
Types de testsTest types

Problème → Solution → Impact

ObjectifObjective

Concevoir une API backend robuste pour digitaliser la gestion d'une bibliothèque : catalogue, exemplaires physiques, utilisateurs et cycle de prêt/retour.Design a robust backend API to digitize library management: catalog, physical copies, users and the loan/return lifecycle.

SolutionSolution

Architecture en couches FastAPI + SQLAlchemy avec validation Pydantic, héritage utilisateurs (Members / Librarians), relations Many-to-Many Books ↔ Authors et workflow de prêts complet.Layered FastAPI + SQLAlchemy architecture with Pydantic validation, user inheritance (Members / Librarians), Books ↔ Authors Many-to-Many relations and a complete loan workflow.

RésultatResult

API documentée (Swagger + ReDoc), testable via pytest et Postman, prête à être consommée par un frontend ou des intégrations tierces.Documented API (Swagger + ReDoc), testable via pytest and Postman, ready to be consumed by a frontend or third-party integrations.

Architecture & Sécurité

Architecture en couchesLayered architecture

Client (HTTP) routers/ (Endpoints)(Endpoints) schemas/ (Validation Pydantic)(Pydantic validation) crud/ (Logique métier)(Business logic) models/ (SQLAlchemy ORM)(SQLAlchemy ORM) MySQL

Modèle de donnéesData model

Users Héritage Members & LibrariansMembers & Librarians inheritance
Books Many-to-Many avec AuthorsMany-to-Many with Authors
BookCopies Exemplaires physiquesPhysical copies
Loans Prêts & disponibilitéLoans & availability

Sécurité & qualitéSecurity & quality

  • Validation Pydantic sur toutes les entréesPydantic validation on all inputs
  • Hashage bcrypt des mots de passebcrypt password hashing
  • ORM SQLAlchemy (0 injection SQL)SQLAlchemy ORM (0 SQL injection)
  • Documentation Swagger UI & ReDocSwagger UI & ReDoc documentation
  • Collection Postman pour tests manuelsPostman collection for manual testing

Stack Technique

Backend

Python 3.8+
FastAPI
SQLAlchemy
Pydantic

Database

MySQL
bcrypt
uvicorn

Testing & Docs

pytest
Swagger UI
ReDoc
Postman

Endpoints principauxMain endpoints

MéthodeMethod URL DescriptionDescription
POST /authors/ Créer un auteurCreate an author
GET /authors/search?name=… Rechercher un auteurSearch an author
POST /books/ Créer un livreCreate a book
POST /copies/ Ajouter un exemplaireAdd a copy
POST /loans/ Créer un prêtCreate a loan
PUT /loans/{id}/return Retourner un livreReturn a book
GET /loans/active Prêts en coursActive loans

Qualité du Code

Tests unitairesUnit tests

Fonctions CRUD isolées avec pytestIsolated CRUD functions with pytest

Tests systèmeSystem tests

Endpoints HTTP via TestClient FastAPIHTTP endpoints via FastAPI TestClient

Tests fonctionnelsFunctional tests

Workflow complet emprunt → retourFull loan → return workflow

DocumentationDocumentation

Swagger UI (/docs) et ReDoc (/redoc)Swagger UI (/docs) and ReDoc (/redoc)

Discutons de votre projet

Vous avez un projet similaire ? Je serais ravi d'en discuter.