This project was developed as a straightforward backend assignment with the goal of securing an opportunity for a job with a company specializing in SAAS-based e-commerce platforms. The primary aim of this task was to evaluate my ability to accomplish tasks and acquire knowledge within a limited timeframe.
- Clone this repo
git clone [email protected]:hex0gen/store-backend-test-task.git store.local
- Install all dependencies trough composer
cd store.local && composer install
- Copy configuration example and setup APP_URL (basiclly http://store.local) & DB credentials
cp .env.example .env
- Generate APP_KEY
php artisan key:
- Run migration
php artisan migrate
5.Run database seeder to make placeholder data
php artisan db:seed
docker pull hexogen/store-local
docker build -t store-local .
docker run -d -p 80:80 store-local
I used YARC! on Chrome to make requests to API. Chrome Extension
POST URL:
http://store.local/api/v1/register
Payload:
{"name": "user", "email": "[email protected]", "password": "12345678", "password_confirmation": "12345678"}
POST URL:
http://store.local/api/v1/login
Payload:
{"name": "user", "password": "12345678"}
POST URL:
http://store.local/api/v1/users/list
Headers
Authorization Bearer {authorization_token}
POST URL:
http://store.local/api/v1/products/list
POST URL:
http://store.local/api/v1/products/create
Payload:
{
"name": "Название продукта",
"price": 99.99,
"image_path": "<путь к изображению>",
"description": "Описание продукта",
"is_available": 1
}
POST URL:
http://store.local/api/v1/products/{product_id}/edit
Payload:
{
"name": "Название продукта",
"price": 99.99,
"image_path": "<путь к изображению>",
"description": "Описание продукта",
"is_available": 0,
"categories": ["Category 1", "Subcategory 2"]
}
POST URL:
http://store.local/api/v1/products/{product_id}/remove
POST URL:
http://store.local/api/v1/category/create
Payload:
{
"parent_id": 1,
"slug": "cat1",
"display_name": "Категория 1"
}
POST URL:
http://store.local/api/v1/cart/create
Payload:
{
"user_id": 1,
"data": [1, 2]
}
POST URL:
http://store.local/api/v1/cart/{product_id}/remove
Payload:
{
"user_id": 1,
"data": [1, 2]
}