Please implement a system:
- where people can enter a shipping tracking code in a form
- as a result, they will see an estimated delivery date.
- The frontend is supposed to be connecting to the backend through a REST API.
- Please make sure that the data store in the backend can be replaced (e.g by a config).
- Implement two storage solutions that can be plugged in.
- Suggestions for data stores to implement are SQLite and file (CSV).
- Create model, controller, migration and seeder.
- Implement needed REST API methods.
- Make storage flexible.
- Add tests.
- Implement front-end using Vue.js.
- Connect front-end to the backend.
- Final testing.
- Feel free to use libraries, when it makes sense.
- Please be careful about unit tests, commits and all those other pesky details. They matter!
- Deliver the results as a git repository with commit history.
- The implementation should be done in a half day (4h).
./install.sh
composer install
cp .env.example .env
./artisan key:generate
# generate the sqlite DB
touch database/database.sqlite
./artisan migrate:refresh --seed
# generate the CSV file
./artisan generator:csv
# generate the test db
touch database/database_test.sqlite
./artisan migrate --database=sqlite_test
npm install
npm run production
Pentru a schimba storageul, aveţi două posibilităţi:
- În fişierul
.env
schimbaţi valoarea cheiiSTORAGE_TYPE
la una din următoarele valori:db
,csv
. - Schimbaţi valoarea implicită din fişierul
app/packagetracking.php
ladb
saucsv
.
./vendor/bin/phpunit tests/
./artisan serve
Începe aici.
+--------+----------+-------------------+-----------------+-----------------------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+-------------------+-----------------+-----------------------------------------------------------+------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/shipment/{id} | | PackageTracking\Http\Controllers\ShipmentController@show | api |
| | GET|HEAD | api/shipments | shipments.index | PackageTracking\Http\Controllers\ShipmentController@index | api |
+--------+----------+-------------------+-----------------+-----------------------------------------------------------+------------+