A Java-based wallet API for managing digital wallet operations. This project is structured as a Gradle application and follows best practices for modular, testable, and maintainable code.
- Digital wallet management
- Event sourcing and persistence
- RESTful API endpoints
- Integration and unit tests
- Database migrations (Flyway)
- Event Sourcing: The architectural model is well-suited to requirements for full traceability of operations and allows for precise and auditable retrieval of historical balances.
- Hexagonal Architecture: The separation between business rules and adapters makes future changes in communication with external systems easier, making the system more flexible and testable.
- Spring Boot: Chosen due to the team's familiarity with the framework and its excellent community support, which accelerates development and facilitates maintenance.
src/
main/
java/com/abnercarleto/ # Main Java source code
resources/ # Application properties and migrations
test/
java/com/abnercarleto/ # Test source code
resources/ # Test resources
build.gradle # Gradle build file
- Java 21 or higher
- Gradle 7+
- Docker (for running database locally)
- Clone the repository:
git clone <repository-url> cd wallet-api
- Start dependencies (e.g., database):
docker-compose -f src/docker/docker-compose.dev.yml up -d
- Build and run:
- On Linux/macOS:
./gradlew bootRun
- On Windows (use Command Prompt or PowerShell):
gradlew.bat bootRun
- On Linux/macOS:
- On Linux/macOS:
./gradlew test
- On Windows:
gradlew.bat test
- Main configuration:
src/main/resources/application.properties
- Test configuration:
src/test/resources/application.properties
- Managed by Flyway.
- Migration scripts:
src/main/resources/db/migration/
- API endpoints are exposed via REST (see controller classes under
com.abnercarleto.walletapi.web.controller
). - Swagger/OpenAPI integration can be added for interactive docs.
- If enabled, access the API docs at http://localhost:8080/swagger-ui/index.html.
- The API exposes endpoints for wallet operations (see controller classes for details).
- Example (using
curl
):curl -X GET http://localhost:8080/api/wallets
- For more endpoints, refer to the controller classes or Swagger UI if enabled.
- Database not running: Ensure Docker is running and the database container is up.
- Port conflicts: Make sure port 8080 (API) and the database port are free.
- Gradle issues: Try running
./gradlew clean
(orgradlew.bat clean
on Windows) if you encounter build errors.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.