Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Thymeleaf Java Docker

License Stars

JavaLibrarySite is a library web application built with Spring and Thymeleaf. The site communicates with two microservices to manage users and books.

Related Services

The project uses the following microservices:

Initial Setup

Creating the First Administrator

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/json

Request Body:

{
    "nickname": "admin",
    "email": "admin@example.com",
    "password": "your_secure_password"
}

Architecture

Request Proxying

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.

Request Flow

Browser → JavaScript → Controller (Proxy) → Microservice (Docker) → Database

Known Limitations

  • 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.

Configuration

Configuring Microservice URLs

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";

Technology Stack

  • Frontend: Thymeleaf, JavaScript
  • Backend: Spring Boot, Spring MVC
  • Architecture: Microservices
  • Containerization: Docker

Localizations

About

Library Site based on JavaSpring

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages