JavaLibrarySite is a library web application built with Spring and Thymeleaf. The site communicates with two microservices to manage users and books.
The project uses the following microservices:
- JavaBookService — book management
- JavaUserService — user management and authentication
After the first launch of all services, you need to create an administrator account:
Endpoint:
POST http://ip-user-service:8092/api/admin/registerAsAdmin/
Content-Type: application/jsonRequest Body:
{
"nickname": "admin",
"email": "admin@example.com",
"password": "your_secure_password"
}The site uses Controllers to proxy requests from JavaScript files to microservices:
- JavaScript files send requests to local Controllers
- Controllers forward requests to Docker container IP addresses
- Containers process requests and return results
Important: When changing Docker configuration or ports, you must update the URLs in Controller files.
Browser → JavaScript → Controller (Proxy) → Microservice (Docker) → Database
- Error Handling: In the current version, error messages may not be clear enough for end users. It is recommended to add more informative error descriptions.
If you changed service ports or IP addresses, update the corresponding URLs in Controller files:
Example:
// In BookController.java file
private static final String BOOK_SERVICE_URL = "http://book-service:8090";
// In UserController.java file
private static final String USER_SERVICE_URL = "http://user-service:8092";- Frontend: Thymeleaf, JavaScript
- Backend: Spring Boot, Spring MVC
- Architecture: Microservices
- Containerization: Docker