A simple product management system;
After you clone this project, do the following:
# go into the project backend part
cd backend
# create a .env file
cp .env.example .env
# install composer dependencies
composer install
# install npm dependencies
npm install
# generate a key for your application
php artisan key:generate
# add the database connection config to your .env file
DB_CONNECTION=mysql
DB_DATABASE=youcan_test
DB_USERNAME=root
DB_PASSWORD=
# run the migration files to generate the schema
php artisan migrate
# seed your databse
php artisan db:seed
# run the server
php artisan serve
# go into the project frontend part
npm install
# set your base url in axios instance
# start your development server
npm run dev
# php artisan product:create
{name : Product name} {description : Product description} {price : Product price} {categories* : Category IDs} {--image= : Image Src (optional)}
# php artisan test
Route:list
Endpoint | Description |
---|---|
POST /products | Create a product |
GET /products/{categoryID?} | Get a listing of products |
GET /category | Get a listing of categories |