Skip to content

SergejsRom/show-products

Repository files navigation

Requirements

Use latest version of Laravel PHP framework. Use PHP >= 8.0. GIT must be used for version control. Usage of MySQL or SQLite database. Usage of Bootstrap or any other CSS framework that you like for front-end realization.

Task

Create mini page with the following functionality:

Write a command which imports products from given JSON file (products.json)

Write a scheduled command which imports products stock from given JSON file (stocks.json)

Write a simple JSON API endpoint which can list all existing products.

Create a front-end:

List all products

Single product page with related products

Use cache for single product page information (keep in mind that stock must be shown in real-time).

Show most popular tags list by products count.

API auth

Add authentification for JSON API.


Comments:


✔️ Save products to DB from json file. command: 'app:get-products'

✔️ Scheduled stock update from json file. command: 'app:stock-update schedule'

Loads stock only if "SKU" exists in Products table

✔️ Api endpoint for all Products.

✔️ Api endpoint for all Stock.

✔️ Api endpoints loading from cache for 24h or till create/update and reset on action.

✔️ Made Commands, observers, resources, controllers to handle api.

✔️ $schedule->command(StockUpdate::class, ['schedule'])->hourly();

✔️ "Welcome" page to choose Livewire or blade version

✔️ Created front page with all products list (livewire)

✔️ List pagination loading on button click (livewire)

✔️ Modal for "show" product (livewire)

✔️ List all products (blade)

✔️ "show" product from cache (blade)

✔️ Most popular tags list

✔️ Added auth for API routes. Token could be issued: After login/register to the profile in Jetstream

OR

After login/register through API (token issued for specific device) (with 'supports_credentials' => true) Register and Login API routes

✔️ API Scribe docs link: /docs


To run shedule on local (linux)

crontab -e
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published