UserService Microservice β MVP Setup (2025-08-05)
Author: Jeet Solanki
Overviewβ
This document outlines the initial setup and architecture of the UserService microservice for the Junior Ai project.
It explains what has been implemented, how the service is organized, current capabilities, and outstanding tasks.
What I Didβ
1. Project Structureβ
- Created a modular Java Spring Boot project with the following packages:
config/
β Security and app configurationcontroller/
β REST API endpointsdto/
β Data Transfer Objects for requests/responsesentity/
βexception/
β (Reserved for future custom exceptions)repository/
βsecurity/
β (Reserved for future, e.g., filters)service/
β Business logic (UserService)util/
β Utility classes
2. Environment Configurationβ
- Split configuration into:
application.properties
(shared, non-sensitive)application-dev.properties
(PostgresSql, dev settings)application-test.properties
(H2, test settings)
- JWT secret is now referenced as an environment variable (
JWT_SECRET
), not hardcoded.
5. CI/CDβ
- GitHub Actions workflow runs tests and builds Docker images.
- CI uses the
test
profile, ensuring safe, isolated builds.
What We Can Do Nowβ
- Accept Registration, Validate, and User-specific requests via REST API.
- Create user in db and passing roles, and use passwordEncoder
- Run automated tests and builds in CI/CD with safe, environment-specific config.
- Easily extend the service for new features (e.g., friend-system, group-system, etc.).
Whatβs Needed for Productionβ
- Set the
JWT_SECRET
environment variable securely in production. - Implement the UserService microservice for user profile management, and context based LLM usage(core-stuff).
- Add more tests (unit, integration, security).
- Add exception handling and error responses.
- Add monitoring/health checks (Spring Boot Actuator).
- (Optional) Add rate limiting, logging, and audit features.
What Remains / Next Stepsβ
- Write test cases
- Implement context-storage in user-side, LLm-core to provide that context, communicate them via webclient(asynchronous) and connect it to a real database.
- Add context-storage, password reset, and user profile endpoints.
- Write more documentation for each new feature or milestone.
- Regularly update the
docs/
folder with new design decisions and features.
How to Use This Documentationβ
- Keep this file in
docs/
as a permanent record of the MVP setup. - For each new feature or milestone, add a new markdown file in
docs/
(e.g.,2025-07-27-User-feature.md
). - Copy/paste or link these docs to your knowledge base repo as needed.