This project is a demonstration application for managing transfers using a Laravel API. The API is called by a mobile application and communicates with a third-party service to perform transfers. The application showcases the management of asynchronous calls, webhooks, and a smooth user experience.
graph TD
Mobile -->|1. Send money| YourAPI(BACKEND API)
YourAPI -->|2. Trigger transaction| 3P(3rd Party)
YourAPI -->|3. Send result| Mobile
.
├── docker-compose.yml
├── README.md
├── client
│ └── README.md
├── thirdpartymock
│ └── README.md
└── backend
├── README.md
├── Dockerfile
├── app
│ ├── Http
│ │ ├── Controllers
│ │ | │-Controller.php
│ │ | └── TransactionController.php
| ├── Jobs
| | |── SendTransaction.php
│ └── ...
├── ...
├── resources
└── routes
| ├── ...
| └── web.php (BACKEND API ROUTES DEFINITION)
|
└── ...
The project is organized into three main folders:
client: Contains a simulated client application that calls the API to perform transfers.thirdparty: Simulates a third-party service with specific behaviors, including delays and asynchronous responses.backend: Contains the Laravel application, the API that manages transfers.
- Docker and Docker Compose are installed on your system.
- The application uses the SQLite database to simplify the demonstration.
-
Clone this repository to your local machine: :
git clone https://github.com/votre-utilisateur/votre-projet.git cd votre-projet -
In the project's root folder, launch the Docker services with the following command:
docker-compose up
-
Queue Execution: To monitor and manage background tasks, you need to manually run the Laravel queue. Open a terminal and execute:
docker-compose exec backend php artisan queue:work
If you want to perform some tests after your docker-compose is up, you can run the following cURL:
curl -H 'Content-Type: application/json' -X POST localhost:3100/transaction
or you can use Postman for API call testing
This will ask the client application to trigger a transaction creation. Which in turn will call your API.