Coder Social home page Coder Social logo

hatchet's Introduction

Requirements

  • PHP 8.1
  • Mysql

Setup (with Sail)

Install composer packages

composer install

Run Sail

./vendor/bin/sail up -d

Migrate database

sail artisan migrate

Seed database

sail artisan db:seed

Compile assets

sail npm run build

Usage

Navigate to localhost to use the frontend interface.

Explanation

The two routes in use are the root (/) found in routes/web.php and the API endpoint (/locations), which is handled by the LocationController.

LocationController uses Laravel's pipelines to add filters to the DB query using parameters from the current request.

The UI is provided by the App.vue component, though it delegates table display to the location-list component.

To see the loading spinner adding a sleep() cal to the LocationController may be necessary.

Tests are available for the LocationController. Run with sail artisan test.

Notes

  • I did not get to test my setup instructions from scratch. I hope they work!
  • Given how simple the task was, it would have been much simpler (and no great loss) to keep filter logic directly in the controller. However, I assumed that this would be a small part in a larger program, and so refactoring the filters to something more composable would be good. Given a little more time I would refactor the pipelines in the controller out to another class, so that the controller was not caring for that responsibility.
  • I would like to add some Vue tests but did not get time.
  • I added a 'Clear' button for UI completeness!

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.