Absolutely β hereβs a powerful, self-contained prompt you can put in your README.md
or feed into an AI to generate your full project. It captures every constraint, decision, tech stack, architecture, and behavior youβve locked in:
Prompt (README Usage or AI Boot Instruction):
Build a complete microservices-based backend project named FriendCircle
based on the following exact requirements. Do not ask any questions. Just build the system as defined below.
A social platform backend where users can:
- Register, login (JWT-based)
- Add/update/delete their own addresses
- Send and accept friend requests
- View friend-only data (like hobbies)
- Message friends (Kafka-based messaging)
- View friend list and message threads
- Receive notifications on friend events and messages
- Microservices-based backend
- Each service is fully isolated, independently deployable
- Use Spring Boot 3.2+, Java 17, Maven
- Use REST for synchronous service-to-service calls (Feign)
- Use Kafka for asynchronous messaging (no RabbitMQ)
Service Name | Description | Database |
---|---|---|
user-service |
Handles user registration, login, JWT auth, and profile data | PostgreSQL |
address-service |
Manages user addresses (CRUD) | PostgreSQL |
friendship-service |
Manages friend requests, acceptances, and friend relationships | PostgreSQL |
hobby-service |
Stores and retrieves hobby data (accessible only by friends) | MongoDB |
message-service |
Kafka-based messaging between users. Stores message threads | Kafka |
notification-service |
Consumes Kafka events and stores/send notifications | Kafka |
gateway-service |
API Gateway using Spring Cloud Gateway with JWT validation and routing | None |
config-service |
Spring Cloud Config server with Git-based configuration | Git-backed |
discovery-service |
Eureka-based service discovery | None |
Purpose | Technology |
---|---|
Language | Java 17 |
Framework | Spring Boot 3.2+ |
Build Tool | Maven |
DB for structured data | PostgreSQL |
DB for unstructured data | MongoDB (used only for hobbies) |
Caching | Redis |
Messaging | Apache Kafka |
Dev Environments | Devfile-based containers |
Containerization | Docker + Docker Compose |
Configuration Management | Spring Cloud Config |
Service Discovery | Eureka |
API Gateway | Spring Cloud Gateway |
Security/Auth | Spring Security + JWT |
Logging | ELK Stack (Logstash, Elasticsearch, Kibana) |
Monitoring & Metrics | Prometheus + Grafana |
Tracing | Spring Sleuth + Zipkin |
REST Clients | Feign |
GitOps | Git-backed config repo |
Topic Name | Purpose |
---|---|
friend-requests |
Emitted on friend send/accept actions |
user-messages |
Emitted when users message each other |
notifications |
Internal events for notifications |
friendcircle/
β
βββ common-lib/ # Shared DTOs, Kafka config, utils
βββ config-service/
βββ discovery-service/
βββ gateway-service/
β
βββ user-service/
βββ address-service/
βββ friendship-service/
βββ hobby-service/
βββ message-service/
βββ notification-service/
β
βββ docker-compose.yml # Compose setup for local dev
βββ devfile.yaml # Dev environment configuration
- JWT authentication is mandatory for all services (except config and discovery).
- Gateway must validate JWT and forward roles/userId as headers.
- All APIs should be RESTful, versioned (
/api/v1/
), with clear error handling. - All user-to-user messages and friend events must flow via Kafka only.
- Every service must expose Actuator endpoints (
/actuator/health
,/metrics
). - Use Prometheus annotations for scraping metrics.
- Services should register with Eureka at runtime.
- Logging must be JSON-structured and routed to ELK via Logstash.
- Use consistent DTOs and mapper layers across services.
Generate all services, config files, Dockerfiles, Kafka setup, health checks, metrics, and logs exactly as per the above definition. Do not omit any service or configuration. Do not propose alternatives. Build the complete production-grade codebase with clear separation.
Here is a complete list of JIRA-style tickets for your FriendCircle
microservices-based backend project. These tickets are:
- β Self-contained (independent of others as much as possible)
- β Minimally scoped (one core concept per task)
- β Functional (each delivers a working feature, config, or proof of concept)
- β Educational (helps you learn and apply key microservice/backend concepts)
Description: Create folder structure with placeholders for each service, common-lib
, and docker-compose.yaml
.
Goal: Establish scaffolding to host all services in a clean monorepo.
Teaches: Modular architecture setup.
Description: Implement a Spring Boot config-service
using Spring Cloud Config backed by a local Git repo.
Goal: Serve centralized configs to other services.
Teaches: Centralized config management.
Description: Implement discovery-service
using Spring Cloud Netflix Eureka.
Goal: Allow all services to register and discover each other.
Teaches: Service discovery with Eureka.
Description: Implement gateway-service
for routing and JWT-based auth forwarding.
Goal: Centralized entry point for all external calls.
Teaches: Gateway routing, filters, and JWT handling.
Description: Bootstrap user-service
with Spring Boot, PostgreSQL, JPA, and H2 for testing.
Goal: Establish DB connectivity and CRUD skeleton.
Teaches: Spring Boot + JPA + PostgreSQL setup.
Description: Create POST /api/v1/users/register
to register a new user.
Goal: Save user with username, email, password (hashed).
Teaches: DTOs, mapping, validation.
Description: Add POST /api/v1/auth/login
with JWT token issuance using Spring Security.
Goal: Secure the service and return signed JWT.
Teaches: JWT setup and Spring Security basics.
Description: Validate JWT in gateway-service
, pass userId
and roles to downstream services.
Goal: Enforce security at entry point.
Teaches: Filters and JWT propagation.
Description: Scaffold address-service
, DB schema, and basic config.
Goal: Isolate address logic in its own service.
Teaches: Microservice independence.
Description: POST /api/v1/addresses
to add a new address for the logged-in user.
Goal: Add address linked to authenticated user.
Teaches: Auth context + ownership.
Description: Expose GET /api/v1/addresses
and DELETE /api/v1/addresses/{id}
.
Goal: Allow user to view and remove own addresses.
Teaches: Secure REST patterns.
Description: Scaffold friendship-service
with table for friend requests and status.
Goal: Base for managing relationships.
Teaches: Designing relational join-type tables.
Description: POST /api/v1/friends/request
for sending a friend request.
Goal: Store a pending request from one user to another.
Teaches: Relationship modeling.
Description: POST /api/v1/friends/accept
to accept a pending request.
Goal: Mark request as accepted.
Teaches: Validation and updates.
Description: GET /api/v1/friends
to return all approved friends of the logged-in user.
Goal: Retrieve list of confirmed friends.
Teaches: Relationship queries.
Description: Scaffold hobby-service
using MongoDB to store user hobby info.
Goal: Separate hobby data store.
Teaches: NoSQL integration.
Description: Add endpoints POST /hobbies
and GET /hobbies/me
.
Goal: Users manage their own hobbies.
Teaches: MongoDB usage and filters.
Description: GET /hobbies/{userId}
available only to friends.
Goal: Enforce access control.
Teaches: Cross-service checks.
Description: Configure Kafka, create topics: user-messages
, friend-requests
, notifications
.
Goal: Enable Kafka for all services.
Teaches: Kafka setup.
Description: Scaffold message-service
, consume user-messages
, expose thread API.
Goal: Store and retrieve message threads.
Teaches: Kafka Producer/Consumer, stateful logic.
Description: POST /messages/send
produces message to Kafka.
Goal: Decouple message flow from persistence.
Teaches: Async event production.
Description: GET /messages/thread/{friendId}
returns chat history.
Goal: Filter messages between 2 users.
Teaches: Kafka-backed data retrieval.
Description: Consume Kafka topics: friend-requests
, user-messages
.
Goal: Log and store notifications.
Teaches: Event-based systems.
Description: GET /notifications
shows all notifications for current user.
Goal: User-facing inbox of events.
Teaches: Event logs.
Description: Enable /actuator/health
and /actuator/metrics
.
Goal: Basic service health endpoints.
Teaches: Observability starters.
Description: Add Prometheus scraping and dashboard with Grafana. Goal: View live service metrics. Teaches: Metrics, dashboards.
Description: Enable Sleuth and export traces to Zipkin. Goal: View request flow across services. Teaches: Tracing microservices.
Description: All logs should be in JSON structured format. Goal: Feed into Logstash. Teaches: Logging best practices.
Description: Set up Logstash, Elasticsearch, Kibana in Docker Compose. Goal: Centralize and visualize logs. Teaches: Centralized logging.
Description: Add working Dockerfile to each microservice. Goal: Enable container-based deployment. Teaches: Dockerization.
Description: Single file to spin up all services + Kafka + DBs + observability stack. Goal: Local dev environment setup. Teaches: System integration via Docker Compose.
Would you like me to generate this as an actual .csv
or .md
JIRA ticket file, or insert this directly into your project scaffold?