A web application for managing products and categories, including functionality for creating, deleting, and browsing products with pagination. This project is built using Laravel for the backend and Vue.js with TypeScript for the frontend.
-
Backend (Laravel)
- Create, and delete products and categories.
- Paginated product listing with sorting and filtering.
-
Frontend (Vue.js)
- Form for creating products.
- Paginated product listing.
- Image upload functionality.
- Backend: Laravel 10, PHP (8.1.28), MySQL
- Frontend: Vue.js, TypeScript
- Image Storage: Local storage
-
Clone the repository:
git clone https://github.com/benodeveloper/cod-network-coding-challenge.git cd cod-network-coding-challenge/backend
-
Install dependencies:
composer install
-
Set up the environment file:
cp .env.example .env
-
Generate the application key:
php artisan key:generate
-
Run the migrations and seed the database:
php artisan migrate --seed
-
Start the Laravel development server:
php artisan serve
-
Clone the repository:
git clone https://github.com/benodeveloper/cod-network-coding-challenge.git cd cod-network-coding-challenge/frontend
-
Install dependencies:
npm install
-
Start the Vue development server:
npm run dev
-
Products
GET /api/products
: List all products with pagination.POST /api/products
: Create a new product.
-
Categories
GET /api/categories
: List all categories.
The frontend application is built with Vue.js and TypeScript. It includes:
- ProductForm.vue: A form for creating products.
- ProductList.vue: Displays a paginated list of products with sorting and filtering.
- Create Product: Allows users to input product details and upload an image.
- Product List: Displays products with pagination, sorting by name and price, and filtering by category.
Backend testing can be done using PHPUnit. Run tests with:
php artisan test