Skip to content

smalaca/training-center-microservices

Repository files navigation

πŸŽ“ Training Center

A microservices-based educational platform demonstrating DDD and modern software architecture

πŸ“Š Quality & CI/CD Status

Microservice Quality Gate Coverage Bugs Code Smells
Discount Management Quality Gate Status Coverage Bugs Code Smells
Open Trainings Quality Gate Status Coverage Bugs Code Smells
Payment Gateway Quality Gate Status Coverage Bugs Code Smells
Personal Data Quality Gate Status Coverage Bugs Code Smells
Reviews Quality Gate Status Coverage Bugs Code Smells
Trainings Catalogue Quality Gate Status Coverage Bugs Code Smells
Training Offer Quality Gate Status Coverage Bugs Code Smells
Training Programs Quality Gate Status Coverage Bugs Code Smells

🎯 Project Goal

This repository demonstrates how to build and maintain a modern microservices architecture following best practices and industry-standard patterns:

  • Microservices Architecture - Decomposing a complex domain into manageable, independently deployable services
  • Event Storming - Collaborative domain exploration technique to identify bounded contexts
  • Port and Adapters Architecture (Hexagonal) - Separation of business logic from external concerns
  • Domain-Driven Design - Designing software to reflect the business domain and ubiquitous language

πŸ“‘ Table of Contents

This documentation provides insights into the tools, techniques, and decisions made throughout the project:

  1. Getting Started - Setup and installation instructions
  2. Technology Stack - Core technologies used in the project
  3. Project Artifacts - Event storming outputs and architecture decisions
  4. Business Overview - Domain understanding and requirements
    1. Brief Description
    2. High-level Requirements
  5. Educational Resources
    1. Articles - Blog posts explaining project evolution
    2. Books Worth Reading
    3. External Resources
  6. Contributing - Guidelines for contributors

πŸš€ Getting Started

Prerequisites

  • Java 21
  • Docker and Docker Compose
  • Maven

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/training-center.git
    cd training-center
  2. Build the project:

    ./mvnw clean install
  3. Start the infrastructure services:

    docker-compose up -d
  4. Start each microservice:

    ./mvnw spring-boot:run -pl open-trainings
    ./mvnw spring-boot:run -pl payment-gateway
    ./mvnw spring-boot:run -pl personal-data-management
    ./mvnw spring-boot:run -pl discount-management
    ./mvnw spring-boot:run -pl training-offer
    ./mvnw spring-boot:run -pl training-programs
    ./mvnw spring-boot:run -pl reviews
    ./mvnw spring-boot:run -pl trainings-catalogue

πŸ› οΈ Technology Stack

  • Java 21 - Core programming language
  • Spring Boot - Application framework
  • Spring Data JPA - Data access
  • Kafka - Event streaming
  • Docker - Containerization

πŸ“¦ Modules

  • annotations - Java annotations for marking architectural patterns like CQRS and Ports and Adapters, as well as domain-driven design concepts
  • annotations-test - Annotations for categorizing and organizing tests, particularly in a JUnit and Spring Boot context
  • schema-registry - Classes for managing metadata and schemas in an event-driven architecture
  • discount-management - Responsible for managing discount codes for training offers
  • open-trainings - Responsible for managing open training sessions, including registration, booking, and order processing
  • payment-gateway - Responsible for processing payments for training purchases
  • personal-data-management - Responsible for managing personal data of users, trainers, and participants
  • training-offer - Responsible for managing training offers, including pricing and availability
  • training-programs - Responsible for managing training programs
  • reviews - Responsible for reviewing training programs
  • trainings-catalogue - Responsible for viewing training programs and training offers

πŸ“‹ Project Artifacts

Event Storming

All event storming sessions are documented in our Miro Board, which includes:

  • Big Picture Event Storming - Holistic view of the domain
  • Bounded Contexts - Service boundary identification
  • Core/Supporting/Generic Domains - Domain categorization
  • Process Level Event Storming - Detailed workflow mapping

Architecture Decisions

We document significant architectural decisions in our Architecture Decision Records (ADRs) to provide context for future development.

🏒 Business Overview

Brief Description

The Training Center is an institution that provides structured training and education in various professional fields, connecting qualified trainers with individuals and organizations seeking to develop their skills.

High-level Requirements

πŸ“š Trainings Management

Management of training programs that are ready for delivery or in preparation:

  • Discoverability: Allow potential participants to browse available trainings
  • Administration: Support for creating and modifying training content
  • Supervision: Each training program has designated supervisors

πŸ“£ Marketing & Advertisement

Activities designed to attract potential attendees:

  • Webinars: Free introductory sessions on relevant topics
  • Conference Presentations: Professional talks at industry events
  • Internal Events: Knowledge-sharing sessions within organizations

πŸ‘¨β€πŸ« Trainer Management

System for managing relationships with training professionals:

  • Expertise Tracking: Record of which trainings each trainer can conduct
  • Skills Database: Comprehensive skills inventory for each trainer
  • Financial Management: Tracking of trainer rates and payments
  • Performance History: Record of past trainings with participant feedback
  • Contractual Management: Handling trainer agreements and terms

🌐 Open Trainings

Public training sessions open to individual registration:

  • Scheduling: Management of training dates and times
  • Payment Processing: Handling of participant payments
  • Cancellation Handling: Process for participant resignations
  • Trainer Agreements: Management of contracts with training providers
  • Capacity Planning: Enforcement of minimum/maximum group sizes
  • Cancellation Policies: Rules for training cancellations

🏭 Dedicated Trainings

Custom training programs for corporate clients:

  • Customization: Ability to adjust training content to company needs
  • Client Communication: Interface for discussions with company representatives
  • Confidentiality: Management of Non-Disclosure Agreements

πŸ“š Educational Resources

The following resources explain the evolution of this project and the reasoning behind key decisions:

Examples

Category Pattern/Concept Miro Board Code Example
🎯 Event Storming Big Picture View -
Process Level View -
Design Level View -
πŸ—οΈ DDD Strategic Domain Types View -
Bounded Contexts View -
πŸ—οΈ DDD Tactical Aggregate View Offer Aggregate
Entity - Participants
Value Object - OfferNumber
Repository - OfferRepository
Factory - OfferFactory
Domain Event - Offer Events
Domain Service - TrainingOfferDomainService
Policy - ReviewerAssignmentPolicy
Specification - TrainingProgramProposalReviewSpecification
Saga (Choreography) - Training Program Events
Saga (Orchestration) View OfferAcceptanceSaga
πŸ›οΈ Architecture Architecture Decision Record - ADR Records
Architecture Tests - ArchUnit
Event-Driven - Training Program Events
Ports & Adapters - Open Trainings Module
Outbox Pattern - JpaOutboxMessageRepository
Event Sourcing - OfferAcceptanceSaga
CQRS (Within Service) - Application vs Query
CQRS (Between Services) - Commands: training-programs, training-offer / Query: trainings-catalogue
πŸ§ͺ Testing Unit Tests - OfferApplicationServiceTest
Integration Tests - JpaOfferRepositoryIntegrationTest
System Tests - OfferRestControllerSystemTest
πŸ”„ CI/CD CI Pipeline - GitHub Actions
Code Quality - SonarCloud Analysis

Articles

A chronological series of blog posts documenting the project journey:

  1. Introduction
    1. Rise Above! Elevating Your Code Craftsmanship
    2. Elevating Your Code Craftsmanship: Questions and Answers
  2. Event Storming Introduction
    1. The Power of Post-Its: Deciphering Business Processes with Event Storming
    2. Setting the Stage: Preparing for Your Event Storming Workshop
    3. Event Storming Workshops: A Closer Look at Different Approaches
    4. Event Storming Workshops: Tips and Tricks
  3. Big Picture Event Storming
    1. Navigating the Storm: A Guide to Big Picture Event Storming
    2. Taming the Storm: How Chaotic Exploration Shapes Big Picture Event Storming
    3. Event Storming Big Picture β€” How to enforce the Timeline?
    4. So… Which Event Goes First?
    5. Big Challenges of Event Storming Big Picture
    6. After the Big Picture: Turning Insights into Action
  4. Software Architecture Introduction
    1. The Secret Geometry Behind Your Architecture
    2. Understanding the Problem and Solution Spaces
  5. Domain-Driven Design Introduction
    1. The Two Faces of DDD: Strategy vs. Tactics
  6. Discovering Language Boundaries
    1. Ubiquitous Language - Boundaries, Words, and the Hidden Cost of Ignoring Them
    2. Speaking Many Languages in One System
    3. Ubiquitous Language in Action: Boundaries Made of Words
    4. Core, Supporting, Generic – How to Stop Treating All Domains the Same
    5. So… Which Part of Your System Is Actually Worth Building?
  7. Architecture Decision Record
    1. What ADR is?
    2. Monolith or Microservices?
  8. Defining initial Bounded Contexts
    1. Problem and Solution Space
    2. What Bounded Context is?
    3. Defining Bounded Contexts
  9. Process Level Event Storming
    1. What is the goal of it?
    2. Process Level Example: Releasing Training Program
    3. Process Level Example: Purchase Open and Dedicated Training
    4. Updating Bounded Contexts
  10. Defining Context Mapping
    1. What context maps are?
    2. Team collaboration and context maps
    3. Architecture and context maps
    4. Made decision and ADRs
  11. Design Level Event Storming
    1. Why we need it?
    2. Open Training Purchase
  12. Architecture of the Code
    1. Short story about the architecture types.
    2. How to pick the right architecture for your context?
    3. Open Training Purchase and Decision
  13. Command Query Responsibility Segregation
    1. CQRS for dummies
    2. Data Model vs. Domain Model
    3. Anemic Domain Model - where to use it?
    4. Trainings Catalogue and Decision
  14. Design Level - how to convert sticky notes into code?
    1. Port and Adapters in details
    2. Port and Adapters - various implementation
    3. Application layer - what is that
    4. ...

Books worth reading

External Resources

🀝 Contributing

Contributions are welcome! Here's how you can help improve this project:

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines

  • Follow the existing code style and architectural patterns
  • Write tests for new features
  • Update documentation as needed
  • Adhere to DDD principles when implementing domain logic

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages