This is a transactions demo backend & API. Made with the Laravel framework
This project is configured to be installed in a Docker container using Docker compose, or in the tradicional way over an standard PHP server.
Requirements are specified in the docker-compose.yml file. Environment configurations are defined in Dockerfile.
To install it follow next steps:
-
Run
git clone https://github.com/smarquina/transactions.git transactions -
Make sure you have installed Docker. Then, from the projects root folder run
docker-compose up -
Once container is installed and running, it can be accessed on
localhost:3000To seed database, it is necessary to interact with compose CLI:
- Get the name of the container by running
docker-compose ps - Then, run seed command:
docker exec -it transactions_transactions-test_1 php artisan db:seed
** To interact with transactions-test container as it where a normal php server, type:
docker exec -it [NAME] /bin/bash - Get the name of the container by running
To run it on your own server, you need to configure first dependencies, environment variables and a MySQL or MariaDB.
-
Run
git clone https://github.com/smarquina/transactions.git transactions -
Create a MySQL database for the project
mysql -u root -p, if using Vagrant:mysql -u homestead -p secretcreate database transactions;\q
-
From the projects root run
cp .env.example .env -
Configure your
.envfile -
Dependencies are managed by composer. Make sure you have Composer first. Then run
composer installfrom the projects root folder -
From the projects root folder run
sudo chmod -R 755 ../transactions -
From the projects root folder run
php artisan key:generate -
From the projects root folder run
php artisan jwt:secret -
From the projects root folder run
php artisan migrate -
From the projects root folder run
composer dump-autoloadIf you want to seed database with some random data, from the projects root folder run
php artisan db:seedThis also will create this seeded users
Name Email Password Admin admin@zenos.es admin
This project is divided into two parts admin panel and rest api:
To log into admin panel you can use seeded users o create new one by registering them.
In admin panel there are available a list of users registered in app and a list of transactions made by users.
Also is available a link to API docs.
Api docs are made with Swagger. Available under /api/documentation route.
To make protected calls to api, you must first logged in. Api is secured by JWT auth tokens. This token must be included in the headers of the api call, adding:
authorization: Bearer XXXXXX
This demo is open-source software licensed under the Apache License.