π Complete migration of Java 8 Spring Cloud Netflix microservices to modern .NET 9 architecture
This project represents a comprehensive re-architecture and migration of the microservice-kiwi English dictionary and learning platform from Java 8 Spring Cloud Netflix to modern .NET 9 microservices.
- Framework: Java 8 + Spring Cloud Netflix
- Service Discovery: Eureka
- API Gateway: Zuul
- Circuit Breaker: Hystrix
- Configuration: Spring Cloud Config
- Infrastructure: MySQL, Redis, RabbitMQ, Elasticsearch, FastDFS, Nginx
- Framework: .NET 9 + ASP.NET Core
- API Gateway: YARP (Yet Another Reverse Proxy)
- Circuit Breaker: Polly
- Messaging: MassTransit with RabbitMQ
- Service Discovery: Built-in .NET Service Discovery
- Configuration: .NET Configuration Providers
- Logging: Serilog with structured logging
- Monitoring: OpenTelemetry
- Kiwi.Gateway - YARP-based API Gateway with authentication, rate limiting, and circuit breaker
- Kiwi.Shared - Common libraries, base entities, and shared services
- Kiwi.Auth.API - JWT-based authentication and authorization service
- Kiwi.UPMS.API - User Permission Management System
- Kiwi.Word.API - Dictionary and word processing service with Elasticsearch integration
- Kiwi.AI.API - Machine learning and AI features using ML.NET and Semantic Kernel
- Kiwi.Crawler.API - Web scraping service with Selenium and PuppeteerSharp
- Kiwi.Configuration.API - Centralized configuration management
- .NET 9 - Latest .NET framework
- Entity Framework Core - ORM with MySQL support
- MassTransit - Distributed application framework for message-based communication
- Polly - Resilience and transient-fault-handling library
- Serilog - Structured logging
- AutoMapper - Object-to-object mapping
- FluentValidation - Input validation
- MediatR - CQRS and mediator pattern implementation
- OpenTelemetry - Observability and monitoring
- .NET 9 SDK
- Docker & Docker Compose
- MySQL 8.0+
- Redis
- RabbitMQ
- Elasticsearch 7.17.9
-
Clone the repository
git clone <repository-url> cd kason-tools-server
-
Start infrastructure services
docker-compose up -d mysql redis rabbitmq elasticsearch
-
Restore dependencies
dotnet restore
-
Run database migrations
dotnet ef database update --project src/Services/Auth/Kiwi.Auth.API dotnet ef database update --project src/Services/UPMS/Kiwi.UPMS.API dotnet ef database update --project src/Services/Word/Kiwi.Word.API
-
Start services
# Terminal 1 - Gateway cd src/Gateway/Kiwi.Gateway dotnet run # Terminal 2 - Auth Service cd src/Services/Auth/Kiwi.Auth.API dotnet run # Terminal 3 - Word Service cd src/Services/Word/Kiwi.Word.API dotnet run # Continue for other services...
Full stack deployment:
docker-compose up --buildIndividual service deployment:
docker-compose up --build kiwi-auth-apiASPNETCORE_ENVIRONMENT- Development/Staging/ProductionConnectionStrings__DefaultConnection- MySQL connection stringConnectionStrings__Redis- Redis connection stringMessageBroker__Host- RabbitMQ hostJwtSettings__Secret- JWT signing keyElasticsearch__Url- Elasticsearch endpoint
- Gateway: 5000 (HTTP), 5001 (HTTPS)
- Auth Service: 5010
- UPMS Service: 5020
- Word Service: 5030
- AI Service: 5040
- Crawler Service: 5050
- Configuration Service: 5060
Each service exposes Swagger documentation at /swagger endpoint:
- Gateway: http://localhost:5000/swagger
- Auth Service: http://localhost:5010/swagger
- Word Service: http://localhost:5030/swagger
Authentication:
# Login
POST /api/auth/login
{
"email": "user@example.com",
"password": "password123"
}
# Register
POST /api/auth/register
{
"email": "user@example.com",
"password": "password123",
"firstName": "John",
"lastName": "Doe"
}Word Service:
# Search words
GET /api/word/search?query=hello&limit=10
# Get word definition
GET /api/word/{id}- Health Checks:
/healthendpoint on each service - Metrics: OpenTelemetry integration
- Logging: Structured logging with Serilog
- Tracing: Distributed tracing across services
- Hot Reload:
dotnet watch run - Database Migrations:
dotnet ef migrations add <name> - Testing:
dotnet test - Code Coverage:
dotnet test --collect:"XPlat Code Coverage"
kason-tools-server/
βββ src/
β βββ Gateway/
β β βββ Kiwi.Gateway/
β βββ Services/
β β βββ Auth/Kiwi.Auth.API/
β β βββ UPMS/Kiwi.UPMS.API/
β β βββ Word/Kiwi.Word.API/
β β βββ AI/Kiwi.AI.API/
β β βββ Crawler/Kiwi.Crawler.API/
β β βββ Configuration/Kiwi.Configuration.API/
β βββ Shared/
β βββ Kiwi.Shared/
βββ docker-compose.yml
βββ Kiwi.Microservices.sln
- Performance: .NET 9 offers superior performance compared to Java 8
- Modern Patterns: CQRS, Event Sourcing, and Clean Architecture
- Cloud Native: Built for containerization and cloud deployment
- Observability: Comprehensive monitoring and tracing
- Developer Experience: Hot reload, better tooling, and IntelliSense
- Maintenance: Simplified dependency management and updates
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Migration Status: β Complete architecture scaffolding | π§ Implementation in progress