CodexLibris is a RESTful API developed with Spring Boot, PostgreSQL, and JWT authentication, designed to manage a digital library of books, authors, genres, and users. The project models real-world library features like book availability, role-based access control, and personalized recommendations via a local LLM (Large Language Model).
Everything runs in Docker containers, making the setup and deployment seamless.
- Java + Spring Boot (API, security, business logic)
- PostgreSQL (relational data persistence)
- JWT (token-based authentication)
- Docker + Docker Compose (containerized infrastructure)
- OpenAPI/Swagger (interactive API docs)
- Optional: Local LLM integration for book recommendations (Python + Transformers)
- User management with role-based access (
ADMIN
,USER
) - CRUD operations for:
- Books
- Authors
- Genres
- Loads
- Events
- Users
- Roles
- JWT-based login and secure endpoints
- Swagger UI for API exploration
- HTTPS enabled with self-signed cert
- Bonus: AI-powered recommendations with local LLM
docker-compose build --no-cache
docker-compose up -d
docker ps
- Access the API at:
https://localhost
- Because of the self-signed certificate:
- Use
-k
withcurl
to bypass SSL verification - In the browser, manually accept the certificate
- Use
https://localhost/swagger-ui/index.html
Use the /auth/login
endpoint to obtain a JWT token.
curl -X POST https://localhost/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin"}'
Example response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"username": "admin",
"roleId": 1
}
GET /user/{id}
GET /users
GET /books
GET /books/{id}
POST /books
PUT /books/{id}
GET /authors
GET /authors/{id}
POST /authors
PUT /authors/{id}
GET /genres
GET /genres/{id}
POST /genres
PUT /genres/{id}
All endpoints require Authorization header:
-H "Authorization: Bearer YOUR_JWT_TOKEN"
This API includes an optional LLM-powered recommendation system, run locally via Docker.
cd llm
docker-compose up --build
curl -k -X POST https://localhost/api/llm/recomender \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"text": "Harry Potter"}'
Example response:
{
"results": [
{
"title": "Harry Potter and the Philosopher's Stone",
"author": "J. K. Rowling",
"year": 1997
}
]
}
- This project is part of a personal exploration of robust REST architecture and full-stack Java development.
- It serves as a base for testing different frontends, such as Vaadin or Angular, using the same backend.
- It’s also a playground for integrating lightweight AI systems into backend services.
Jessica GitHub