A small project using Laravel 8/Vue.js 3 for the YouCan Software Engineer application
- List your products
- Create products
- Celete products
- Create categories
- Delete Categories
- Filter products by category
- Sort by name
- Sort by price
- clone the repository and cd to the project folder:
git clone https://github.com/devnart/Youcan-Coding-Challenge
cd Youcan-Coding-Challenge
- create a database for the project
- from the project root run
cp .env.example .env
- edit your
.env
file - Install the necessary dependencies:
composer install
- from the project root run
php artisan key:generate
- from the project root run
php artisan migrate
- From the projects root folder run
npm install
- From the projects root folder run
npm run dev
ornpm run production
- You can watch assets with
npm run watch
To create a category from the command line you can run the following command and follow the instructions :
php artisan category:create
To delete a category from the command line run ( replace category_id with the category id you wish to delete ) :
php artisan category:delete --id=category_id
To create a product from the command line you can run the following command and follow the instructions :
php artisan product:create
To delete a product from the command line run ( replace product_id with the product id you wish to delete ) :
php artisan product:delete --id=product_id
[GET] /api/products
[POST] /api/products
- Name
- Description
- Price
- Image
[DELETE] /api/products/{id}
[POST] /products/categories
- product_id
- category_id
[GET] /categories/{id}
[GET] /api/categories
[POST] /api/categories
- Name
- parent_id
By name [GET] /api/products?sort=name
By price [GET] /api/products?sort=price
By name [GET] /api/products?sort=name?category=1
Deploying ...