Coder Social home page Coder Social logo

accounting-api's Introduction

Technical task

Technology

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.

Installation & setup


NOTE

This project depends on the host running a MacOS, Linux or WSL2 environment with PHP.


Clone the repository and change into the project directory

git clone [email protected]:nathandaly/accounting-api.git
cd accounting-api

Copy the example .env

cp .env.example .env

Installing dependencies

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.

Database migration and seeding

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

๐ŸŽ‰ Up and running ๐ŸŽ‰

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.


Test credentials

email: [email protected]
password: password

Testing

All tests have been written using PESTPHP which is compatible with PHPUnit.

sail artisan test

or

sail composer test

Todos:

If I had more time:

  • Implement additional tests for add and delete.

accounting-api's People

Contributors

nathandaly avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.