How yukionishi1129/kotlin-server-side-programming-practice works
Project type and purpose
• This is a multi‐module sample‐code repository for the book “Kotlin サーバーサイドプログラミング実践開発.”
• It contains small standalone demos (part1 and part3 chapters) plus one full‐stack application (“book-manager” in part2) and its accompanying front-end (Vue.js SPA under part2/front).
File structure
• Top‐level folders:
• part1 – chapter01–03: simple console‐app demos in Kotlin/Java
• part2 – chapter04–05 demos, plus book-manager back-end and its front-end
• part3 – chapter09–12: gRPC demos, Ktor routing, DSLs, testing
• The “book-manager” subfolder under part2 is a Spring Boot application with clearly separated layers:
• presentation (controllers, AOP, config, handlers)
• application (services)
• domain (models, repositories interfaces)
• infrastructure (MyBatis mappers, records, repository implementations)
• src/main/resources (application.yml, generatorConfig.xml)
• src/test – unit and integration tests
• The “front/book-manager” folder under part2 is a typical Vue.js project (webpack, src/api, src/components, router, main.js).
README
• Confirms the structure and shows that chapters 6–8 are implemented as one “book-manager” application with a back-end and front-end.
Main components
a. Front-end SPA (Vue.js)
– Components: Login.vue, BookList.vue, etc.
– API layer (src/api/*.js) connecting to back-end’s REST endpoints
b. Back-end Spring Boot application
– HTTP layer: Controllers (BookController, RentalController, AdminBookController)
– Security layer: SecurityConfig, custom UserDetailsService, handlers, AOP logging
– Application services: BookService, RentalService, AuthenticationService, AdminBookService
– Domain layer: Entities/Models (Book, Rental, User), Repository interfaces
– Infrastructure layer: MyBatis mappers & records, RepositoryImpl classes
– Database: relational DB (MySQL/PostgreSQL), SQL schema (book_manager.sql), MyBatis generatorConfig.xml
c. Persistence
– External database (depicted as a container or managed service)
– Docker Compose (docker/docker-compose.yml) for local dev
d. Optional: gRPC demos (chapter09), Ktor server (chapter10), DSL examples (chapter11), testing (chapter12) as separate, isolated “micro‐demos.”
Relationships and interactions
• Front-end → (HTTPS/REST) → Back-end Controllers
• Controllers → Application Services → Domain → Infrastructure → Database
• Security filters wrap Controller calls, consult AuthenticationService & UserDetailsService
• AOP LoggingAdvice intercepts service/controller calls for logging
• Docker Compose orchestrates Back-end + Database for local environment
• Build/Gradle scripts manage compilation, packaging, tests for each module
Architectural patterns & design principles
• Layered (onion) architecture in back-end
• Hexagonal elements: Controllers (ports), Services (application), Repositories (adapters)
• Separation of concerns: Web, Security, Business, Persistence
• MyBatis generator for mapping low‐level SQL to domain records/mappers
• SPA + REST API integration
Essential elements to capture
• Module boundaries (part1/part2/part3) or treat only the book-manager modules for clarity
• All back-end layers and key configuration pieces (security, AOP, ORM)
• Front-end SPA structure (components vs API client)
• Data flow direction and protocols
• Environment orchestration (docker-compose)