This codebase is a basic checkout SPA that uses Laravel to make API calls, and Vue2 to render the frontend. All the frontend files are located in the resources/ directory.
At the moment, it's a single monolithic Vue component (bleh!), the validation is not very good, and the code quality could be massively improved!
- Refactor the checkout SPA in a way that you feel makes the code cleaner, easier to maintain and extendable in future
- Look at how the user experience could be improved by considering different types of user (mobile vs desktop, wifi vs 3G etc) or by general improvements that would benefit all users
Write some automated tests for the code you've written. You have freedom to choose whichever framework you would prefer. You do not need complete test coverage we just want to see that you have experience in writing automated tests!
To get started clone this repo and perform the following setup.
The code does need PHP8 in order to run. If you are on a Mac, the built-in version of PHP should suffice!
Laravel uses composer to manage dependencies, as such you'll need to install this project's dependencies by running:
php composer.phar install
Navigate to the root of the codebase and run the following command:
php artisan serve
This will reply with a web address (usually http://127.0.0.1:8000 or http://127.0.0.1:8001). You can then access the checkout SPA by going to that URL, with /checkout on the end (e.g. http://127.0.0.1:8000/checkout)
Using Node v16, please run npm i to install the dependencies.
The frontend tooling is currently webpack, so you can then build the code in dev mode with npm run watch or npm run dev. There is no need to do a production build for this task.
Once you are happy you can submit the final code to us by emailing a .zip or by sharing your repo on github.