Week 9 Worklog

Week 9 Objectives:

  • Complete the setup of the Microservice architecture using .NET Aspire and build all core Shared Libraries.
  • Fully implement the User Service with AWS Cognito authentication integration and automatic user/profile creation logic.
  • Fully implement the Wallet Service with balance management logic, Money Jar management, Goals Tracking, and Jar Expiry Processing mechanisms.
  • Set up the API Gateway, configure Polly, and finalize Integration Testing for the End-to-End flow (User-Wallet).

Tasks to be carried out this week:

DayTaskStart DateCompletion DateReference Material
1Microservice Architecture & Shared Libraries Setup
- Initialize the .NET Aspire solution and structure 6 Microservices (User, Wallet, Transaction, Report, Notification, AI Integration Service).
- Configure Service Discovery and Docker Compose for the local development environment.
- Build core Shared Libraries: Common.DTOs (with ApiResponse<T>), Common.Authentication (JWT), Common.Messaging (MassTransit/RabbitMQ), Common.Repositories (UoW Pattern), and Common.Middlewares (Rate Limiting, Correlation ID).
03/11/202503/11/2025Day 1 Docs
2Implement User Service & Authentication Integration
- Set up PostgreSQL Database (user_service_db) and design the User Entity (using Guid.CreateVersion7(), Soft Delete Filter).
- Integrate AWS Cognito authentication (JWT Bearer Authentication) and create middleware to extract CognitoSub.
- Implement automatic user record creation logic upon first login.
- Implement Core APIs: GET /api/users/me (Get/Create profile), PUT /api/users/me (Update), and POST /api/users/complete-profile.
04/11/202504/11/2025Day 2 Docs
3Wallet Service - Part 1: Wallet Management & Allocation Logic
- Set up PostgreSQL Database (wallet_service_db) and design Wallet, MoneyJar, BudgetPeriod Entities.
- Implement Message Consumer to automatically create Wallet upon receiving the UserCreated event, and simultaneously create the default “Income” jar.
- Implement core Wallet APIs: Deposit, Withdraw (from Available Balance only), Reconcile (Synchronize total balance), and Soft Delete/Archive Wallet.
- Implement basic Money Jar CRUD APIs.
05/11/202505/11/2025Day 3 Docs
4Wallet Service - Part 2: Money Jar, Goals & Budget
- Complete CRUD for Money Jar, including logic to recalculate AvailableBalance upon updating AllocatedAmount.
- Integrate Goals Tracking (calculate ProgressPercent) and GoalAchieved event publishing logic.
- Implement Jar Operations: Deposit, Withdraw, Transfer between jars, and Reconcile Jar Balance.
- Implement Budget Threshold & Over-Budget Logic (publish warning events) and Jar Expiry Processing Service (handle Income Jar auto-reset, Expense Jar Grace Period/Auto-Return).
06/11/202506/11/2025Day 4 Docs
5End-to-End Integration & Testing
- Set up API Gateway (Routing, CORS, Rate Limiting).
- Configure Service-to-Service communication with HTTP Client Factory and Polly (Retry Policy, Circuit Breaker).
- Perform Integration Testing for the End-to-End flow: New User Onboarding, Jar Creation, Wallet/Jar Operations (Deposit/Withdraw/Transfer/Reconcile), and Goal Achievement.
- Test Security (JWT Expiration, Authorization) and Concurrency (Balance Updates).
07/11/202507/11/2025Day 5 Docs

Week 9 Achievements:

  • Microservice Platform Architecture Established:
    • Used .NET Aspire to shape the Microservice architecture for 6 services.
    • Completed the core set of Shared Libraries, including MassTransit/RabbitMQ configuration.
  • User Service Completed:
    • Successfully integrated AWS Cognito for the JWT authentication mechanism.
    • Implemented automatic user profile creation logic and the profile completion API.
  • Wallet Service Completed:
    • Implemented three-component balance management logic: TotalBalance, AllocatedBalance, AvailableBalance.
    • Completed Money Jar Management with Goals Tracking (Target, Progress) and GoalAchieved event publishing.
  • Complex Business Logic Implemented:
    • Finalized operations such as Wallet/Jar Reconciliation (Balance Synchronization) and Jar Expiry Processing (allowing Income Jar auto-reset and Expense Jar with a grace period).
  • Stable and Integrated System:
    • API Gateway and the fault tolerance mechanism Polly (Retry, Circuit Breaker) have been configured.
    • The entire main business flow has been successfully Integration Tested (from Cognito -> User Service -> Wallet Service).