How fernandatperez/booklibre works
BookLibre is a two-part platform for peer-to-peer book lending: readers and publishers browse a catalog, reserve books, manage profiles, and earn BiblioKarmas. The frontend SPA calls the Kotlin/Spring API; backend controllers delegate catalog, reservation, user, and authentication work to services and persistence. The README also documents a Redis-backed popular-home path, GraphQL/OpenLibrary metadata, and role-based security. Several of these implementations are unsampled, so their internal links are omitted or shown only where documented.
Main entry points: MongoBookRepository.kt Book repository · ReservationService.kt Reservation lifecycle · UserService.kt User profiles · BookController.kt Book endpoints
Components 21
Web client
- BookLibre SPA
frontend/src/main.tsx - App routing
frontend/src/router/AppRouter.tsx - Catalog and profiles
frontend/src/pages - HTTP and GraphQL clients
frontend/src/services
API surface
- Spring API
backend/src/main/kotlin/ar/edu/unsam/phm/ProjectApplication.kt - Book endpoints
backend/src/main/kotlin/ar/edu/unsam/phm/controller/BookController.kt - Reservation endpoints
backend/src/main/kotlin/ar/edu/unsam/phm/controller/ReservationController.kt - Authentication endpoints
backend/src/main/kotlin/ar/edu/unsam/phm/controller/auth/AuthController.kt - User endpoints
backend/src/main/kotlin/ar/edu/unsam/phm/controller/UserController.kt
Lending services
- Catalog and BiblioKarmas
backend/src/main/kotlin/ar/edu/unsam/phm/services/BookService.kt - Reservation lifecycle
backend/src/main/kotlin/ar/edu/unsam/phm/services/ReservationService.kt - User profiles
backend/src/main/kotlin/ar/edu/unsam/phm/services/UserService.kt
Identity and access
- Authentication and tokens
backend/src/main/kotlin/ar/edu/unsam/phm/services/AuthenticationService.kt - JWT and role security
backend/src/main/kotlin/ar/edu/unsam/phm/config/SecurityConfiguration.kt
Persistence and analytics
- Book repository
backend/src/main/kotlin/ar/edu/unsam/phm/repository/MongoBookRepository.kt - User and loan repositories
backend/src/main/kotlin/ar/edu/unsam/phm/repository/CrudReservationRepository.kt - Popular-book ranking
backend/src/main/kotlin/ar/edu/unsam/phm/services/PopularBooksService.kt - Catalog GraphQL
backend/src/main/kotlin/ar/edu/unsam/phm/graphql
Other components
- Readers and publishers
- OpenLibrary
- Redis
Connections 21
- Readers and publishers → BookLibre SPA: uses
- BookLibre SPA → App routing: loads
- HTTP and GraphQL clients → Spring API: calls API
- Spring API → Book endpoints: serves routes
- Book endpoints → Catalog and BiblioKarmas: delegates
backend/src/main/kotlin/ar/edu/unsam/phm/controller/BookController.kt - Book endpoints → Popular-book ranking: routes home query
backend/src/main/kotlin/ar/edu/unsam/phm/controller/BookController.kt - Reservation endpoints → Reservation lifecycle: delegates
backend/src/main/kotlin/ar/edu/unsam/phm/controller/ReservationController.kt - Authentication endpoints → Authentication and tokens: delegates
backend/src/main/kotlin/ar/edu/unsam/phm/controller/auth/AuthController.kt - User endpoints → User profiles: delegates
- Authentication and tokens → User profiles: loads user
backend/src/main/kotlin/ar/edu/unsam/phm/services/AuthenticationService.kt - Authentication and tokens → JWT and role security: uses JWT config
backend/src/main/kotlin/ar/edu/unsam/phm/services/AuthenticationService.kt - Catalog and BiblioKarmas → Book repository: queries books
backend/src/main/kotlin/ar/edu/unsam/phm/services/BookService.kt - Reservation lifecycle → User and loan repositories: reads and writes
backend/src/main/kotlin/ar/edu/unsam/phm/services/ReservationService.kt - Reservation lifecycle → Book repository: updates book
backend/src/main/kotlin/ar/edu/unsam/phm/services/ReservationService.kt - Reservation lifecycle → User and loan repositories: reads ratings
backend/src/main/kotlin/ar/edu/unsam/phm/services/ReservationService.kt - User profiles → User and loan repositories: reads and writes
backend/src/main/kotlin/ar/edu/unsam/phm/services/UserService.kt - User profiles → Book repository: updates owned books
backend/src/main/kotlin/ar/edu/unsam/phm/services/UserService.kt - Popular-book ranking → Redis: reads ranking
- Popular-book ranking → Book repository: serves book data
- Catalog GraphQL → Book repository: stitches catalog data
backend/src/main/kotlin/ar/edu/unsam/phm/repository/MongoBookRepository.kt - Catalog GraphQL → OpenLibrary: loads metadata lazily