Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Gianluca-X/DigitalMoney/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through cloning the repository, configuring environment variables, starting the full Docker Compose stack, and making your first authenticated API request. By the end you will have a running local wallet platform and a JWT token in hand.
1

Prerequisites

Make sure the following tools are installed and available in your PATH before you begin:
ToolMinimum VersionPurpose
Docker24.xRuns all service containers
Docker Composev2.x (docker compose)Orchestrates the multi-service stack
GitAny recent versionClones the repository
Docker Desktop for Mac and Windows ships with Docker Compose v2 built in. On Linux, install the docker-compose-plugin package for your distribution.
2

Clone the Repository

Clone the backend repository and move into the project root:
git clone https://github.com/Gianluca-X/DigitalMoney.git
cd DigitalMoney
3

Configure Environment Variables

The Docker Compose file reads sensitive configuration from a .env file in the project root. Create it before starting the stack:
# .env  — create this file at the repository root
MYSQL_ROOT_PASSWORD=yourRootPassword
MYSQL_PASSWORD=nerea

# JWT signing secret (shared by auth-service, accounts-service, and gateway)
JWT_SECRET=mySuperUltraSecretKeyForJWTGeneration123456!

# Per-service database connection URLs (MySQL container is exposed on host port 3308)
AUTH_DB_URL=jdbc:mysql://mysql:3306/auth_service_db
AUTH_DB_USERNAME=auth_service_user

USER_DB_URL=jdbc:mysql://mysql:3306/user_service_db
USER_DB_USERNAME=user_service_user

ACCOUNT_DB_URL=jdbc:mysql://mysql:3306/account_service_db
ACCOUNT_DB_USERNAME=account_service_user
ACCOUNT_DB_DATABASE=account_service_db

# Eureka service URL (used by all Spring Cloud clients)
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://eureka-server:8761/eureka/
Never commit your .env file to source control. The repository’s .gitignore should already exclude it — verify this before pushing.
Database schemas (auth_service_db, user_service_db, account_service_db) and their dedicated users are created automatically when MySQL starts for the first time, courtesy of init.sql which is mounted as a Docker init script.
4

Start the Stack

Build all service images and start the entire platform in one command:
docker-compose up --build
Docker Compose respects the depends_on health-check conditions defined in docker-compose.yml, so services come up in this order:
  1. MySQL — waits until mysqladmin ping succeeds (health-check every 30 s, up to 5 retries)
  2. Eureka Server — starts immediately; no MySQL dependency
  3. Config Server — waits for Eureka Server to start
  4. Auth Service — waits for MySQL (healthy) and Eureka (started)
  5. User Service, Accounts Service — wait for MySQL (healthy), Eureka (started), and Config Server (started)
  6. API Gateway — waits for Eureka and Config Server to start
  7. RabbitMQ — starts in parallel with everything; management UI available on port 15672
To run the stack in the background, add the -d flag: docker-compose up --build -d. Follow logs with docker-compose logs -f.
Wait until you see log lines similar to the following from the Gateway container before making API calls:
gateway    | Started GatewayApplication in 8.3 seconds
5

Register a User

With the stack running, register a new user through the API Gateway:
curl -s -X POST http://localhost:8085/users/register \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Ada",
    "lastName":  "Lovelace",
    "email":     "ada@example.com",
    "password":  "Secure@1234",
    "dni":       "12345678",
    "phone":     "+54 11 1234-5678"
  }'
A successful response returns the created user object. A digital account with a unique CVU and alias is automatically provisioned for the new user by the Accounts Service (called internally via a Feign client).
6

Log In and Retrieve Your JWT

Exchange credentials for a signed JWT token:
curl -s -X POST http://localhost:8085/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email":    "ada@example.com",
    "password": "Secure@1234"
  }'
Example response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Copy the value of token — you will include it in every subsequent request.
Tokens are valid for 24 hours (86 400 000 ms) as configured in auth-service/application.yml. After expiry, log in again to obtain a fresh token.
7

Make an Authenticated API Call

Pass the JWT in the Authorization header to access protected endpoints. The following example retrieves account information for account ID 1:
curl -s -X GET http://localhost:8085/accounts/1 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Example response:
{
  "id": 1,
  "cvu": "0000003100018765432101",
  "alias": "ada.lovelace.wallet",
  "balance": 0.00,
  "userId": 1
}
You now have a fully operational Digital Money House instance and a valid token to explore the rest of the API.

Service Port Reference

ServiceHost PortDescription
API Gateway8085Single entry point for all client requests
Auth Service8082JWT issuance, login, logout
User Service8087User registration and profile management
Accounts Service8084Accounts, cards, transfers, activity
Eureka Server8761Service registry dashboard
Config Server8888Centralised Spring Cloud Config
RabbitMQ AMQP5672Broker for async inter-service events
RabbitMQ Management UI15672Web dashboard (guest / guest)
MySQL3308Database (mapped from container port 3306)

Swagger UI

Interactive API documentation is served by each service via SpringDoc. The recommended entry point is through the gateway:
http://localhost:8085/swagger-ui.html
Individual service Swagger UIs are also available directly on their own ports, e.g. http://localhost:8084/swagger-ui.html for the Accounts Service.

Postman Collection

A maintained Postman collection covering all Auth, User, Account, Transfer, and Card endpoints is publicly available: Open in Postman → Import the collection and set the baseUrl variable to http://localhost:8085 and the token variable to the JWT you obtained in step 6 above.

Build docs developers (and LLMs) love