Skip to content

rcsoyer/account-registry

Repository files navigation

account-registry Service

A 24/7 web service that allows users to manage their banking details.

The application provides REST APIs for users to: register, login, and manage their account details.

The resources are secured with JWT, Bearer Token, authentication.

Setup local development environment

The minimum requirements to run the application are:

  • Java 21
    • any JDK 21 distro should work: Eclipse Temurin, OpenJDK, Oracle JDK..etc
  • Docker engine
    • the integration tests need a Docker engine to run MySQL in a container;
    • Docker Desktop is an easy way to get Docker on your OS;
  • If you run the application through an IDE, such as IntelliJ IDEA, you may need to enable annotation processing to support Lombok and MapStruct.
  • Local MySQL database instance with an empty schema named account_registry.

Building the application

The application can be built via gradle on your IDE.

Or you can build the application via the command line in terminal:

./gradlew clean build

CI/CD pipeline

This project uses GitHub Actions for CI/CD pipeline: gradle build.

The pipeline is triggered on every push to the master branch.

The pipeline runs the following steps:

  • Git checkout the code
  • Setup Java 21
  • Build the application
    • Run the unit tests
    • Run the integration tests

Running the application

The project provides an easy to use dev Spring profile: application-dev.yml.

From that file, you can adjust the connection to a local MySQL database instance.

Or you may simply run a MySQL instance in a Docker container with the expected url configuration and credentials described in the file.

The application then can be run in two ways:

  • through the IDE
    • IDEs via auto-detection of the main class with the Spring profile: dev
  • through the command line
    • ./gradlew bootRun --args='--spring.profiles.active=dev'

API Testing

A postman collection is available in the project dev directory: AccountRegistry postman collection.

This collection can simply be imported into Postman and used to test the API features exposed by the application.

Features

Security

Unless specified, all the endpoints require authentication to access.

If the client is not authenticated the application may redirect the client to the login page.

OpenAPI documentation

The application provides an OpenAPI documentation for better integration with other services.

Manage Accounts

Actuator

The application provides the Spring Boot Actuator endpoints for monitoring and management.