To start the solution you can, being located in the project directory, run:
./run.sh
That's all! this command will start the solution using docker-compose and will run the tests!
Besides the staging API, the repository contains additional services to complement the solution. Here is a list of the services and an explanation of them:
service | mapped port | description |
---|---|---|
staging | 8000 | The main service. This is the staging API. |
core_mock | - | This is the mock of the core API used for testing and development |
integration_test | - | This is a small application used only for running the integration tests and is stopped by the run.sh script after that. |
swagger-ui | 8001 | a swagger service with the definition of the staging API |
The Staging API was developed using Slim Framework and following onion architecture. Here is an explanation of the directories:
It's the directory served by apache and only contains a very simple index.php
.
This directory contains basic files used to start and configure the app. Here you can find the routing, dependencies injection, middlewares registering and a class which provide some test tokens.
After config, this is the most external layer, here you can find request handling middlewares and some adapter for interfaces defined inside the application.
See slim documentation for more details.
Adapters that allow communicating with external services (supposing external even the configured tokens).
Here are the files that belong to the application itself. It contains the core files, and also the controllers and consumers.
The application controllers
The classes used to consume external resources
Here is where the token validation occurs
Contains the business logic and domain entities.
Business logic files.
Business logic executed by the controllers
Interface of the repositories used to consume external resources
Domain entities.
Unit tests, they replicate the files structure of the rest of the application.