This project has been developed with:
- Authentication (Fortify and Sanctum).
- Some level of testing to demonstrate TDD testing ability.
- Custom abstracted filter for transaction list query strings.
- Form Requests to validate inputs and check token abilities for security.
- Events and Listeners that handle the emailing and logging of transaction.
- Transactional database interaction to prevent data corruption.
- Minimal or no comments as a design choice as the code should be verbose and statically typed.
NOTE
This project depends on the host running a MacOS, Linux or WSL2 environment with PHP.
git clone [email protected]:nathandaly/accounting-api.git
cd accounting-api
Copy the example .env
cp .env.example .env
composer install
NOTE
If your host system is not running PHP 8 then you will need to add --ignore-platform-reqs
. to the composer command.
Once the PHP and node dependencies have been resolved you can run the Sail containers.
export APP_PORT=8080 && ./vendor/bin/sail up -d
This command will normally take few minutes and will download and build the required containers.
The project contains migration for the database structure as well as a DotFive
user and example data which you can seed.
./vendor/bin/sail artisan migrate
./vendor/bin/sail artisan db:seed
That should be all that is necessary for the application to be usable. A Postman collection has been provided at the root of the project for test purposes.
NOTE
When using the Postman collection you will need to first 'Login' request followed by a 'Generate Token' request. You will then have the ability to hit any of the transaction endpoints.
email: [email protected]
password: password
All tests have been written using PESTPHP which is compatible with PHPUnit.
sail artisan test
or
sail composer test
If I had more time:
- Implement additional tests for add and delete.