This project consists of several microservices managed via Docker Compose. The main services are:
- discovery-service (Eureka)
- authorization-service
- profile-service
- store-value-service
- payments-service
- events-service
- gateway-service
- Supporting services: postgres, rabbitmq, redis
- Docker
- Docker Compose
- Java 17+ (for local development outside Docker)
- Maven (for building services locally)
-
Clone the repository (if you haven't already):
git clone <your-repo-url> cd DTB
-
Build the services (optional, Docker Compose will build if not already built):
docker-compose build
-
Start all services:
docker-compose up
This will start all microservices, databases, and supporting infrastructure.
-
Accessing Services:
- Eureka Dashboard: http://localhost:8761
- Gateway: http://localhost:8081
- RabbitMQ Management: http://localhost:15672 (user: guest, pass: guest)
- Postgres: localhost:5432 (user: postgres, pass: postgres)
- Redis: localhost:6379
Each microservice is exposed on its respective port (see
docker-compose.ymlfor details). -
Stopping Services:
docker-compose down
-
Start dependencies with Docker Compose, but exclude the service you want to run locally:
docker-compose up postgres rabbitmq redis discovery-service
-
In a new terminal, navigate to the service directory and run:
mvn spring-boot:run
Make sure to set the appropriate Spring profile (e.g.,
localorcompose).
- Database, Redis, RabbitMQ, and Eureka URLs are set in
docker-compose.ymlandapplication-compose.ymlfor each service. - For local development, check each service's
application.ymlfor port and profile settings.
- If ports are already in use, stop conflicting services or change the ports in
docker-compose.yml. - For database issues, ensure Docker volumes are cleared if you want a fresh start.
| Username | Password | Phone | User Type | Gender | Public ID | |
|---|---|---|---|---|---|---|
| system.administrator | admin@gathigai.com | 0721111111 | SYSTEM_USER | MALE | 7070fe44-7efd-4384-8c5b-ff79422eb01e | |
| tester1 | tester1@gathigai.com | 0721111112 | CUSTOMER | MALE | (auto-generated or see DB) | |
| tester2 | tester2@gathigai.com | 0721111113 | CUSTOMER | FEMALE | (auto-generated or see DB) | |
| tester3 | tester3@gathigai.com | 0721111114 | CUSTOMER | FEMALE | (auto-generated or see DB) |
Note: The public ID for
system.administratoris explicitly set in the code as7070fe44-7efd-4384-8c5b-ff79422eb01e. Other users have their public IDs generated automatically and can be found in the database after initialization.
- POST
/users- Request Body: UserDto (see UserRestController)
- Example:
{ "user": { "username": "tester1", "password": "yourpassword", "email": "tester1@gathigai.com" } }
- Topup (Deposit funds):
POST /accounts/{publicId}/topup
Body:{ "amount": ... } - Withdraw (Withdraw funds):
POST /accounts/{publicId}/withdraw
Body:{ "amount": ... } - Check Balance:
GET /accounts/{publicId}/balance - Search User Accounts:
GET /accounts?user={userPublicId}
All endpoints require authentication (JWT token in the Authorization header).