Author: Lincoln Madaraka
Role: Red Giant Laravel Full-Stack Intern Assessment
Due: Sunday, Oct 5, 2025 at 5:00 pm (EAT)
- Project Overview
- Setup Instructions
- Seeded Users & Products
- File Structure & Description
- Usage
- Screenshots for SQL Queries
- Video Demo
Mini Shop Lite is a Laravel 10/11 full-stack application that allows:
- Admin: manage products, view orders, manage users.
- Customer: browse products, add to cart, checkout, view orders.
- API Endpoints: public
GET /api/productsand authenticatedPOST /api/orders. - Validation: clean input validation, proper error handling, and stock management.
- Frontend: Blade templates with Tailwind CSS for responsive and clean UI.
- Clone the repo:
git clone https://github.com/Lincoln-Madaraka/mini-shop.git
cd mini-shop- Install dependencies:
composer install
npm install
npm run dev- Create .env file (copy .env.example) and set database connection:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=minishop
DB_USERNAME=postgres/<if-different-change>
DB_PASSWORD=<your-db-password>- Run migrations and seeders:
php artisan migrate:fresh --seed- Serve the app locally:
php artisan serve-
Access at http://127.0.0.1:8000
-
Seeded Users & Products
Users
Role Email Password
Admin admin@demo.com password
Customer customer@demo.com password- Products
- There are some sample products seeded using ProductSeeder.php
- Images stored in public/import/assets
- Products include snacks, electronics, beverages, and detergents
minishop/
├── app/
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Admin/ # Admin CRUD: products, users, orders
│ │ │ ├── Api/ # ProductController.php: GET /api/products
│ │ │ │ # OrderController.php: POST /api/orders
│ │ │ ├── Auth/ # Breeze authentication controllers
│ │ │ └── Shop/ # Customer shopping: CartController.php, CheckoutController.php, OrderController.php, ProductController.php
│ │ ├── Middleware/ # Role-based access control
│ │ └── Requests/ # Validation rules for forms
│ ├── Models/
│ │ ├── User.php # User roles and authentication
│ │ ├── Role.php # Role constants/logic
│ │ ├── Product.php # Product logic and stock
│ │ ├── Order.php # Orders table
│ │ └── OrderItem.php # Individual order items
├── database/
│ ├── migrations/ # Database tables: users, products, orders, order_items
│ └── seeders/ # DatabaseSeeder.php: seeds users
│ # ProductSeeder.php: seeds products
├── resources/views/ # Blade templates
│ ├── admin/ # Admin panel pages
│ ├── auth/ # Login/Register
│ ├── shop/ # Customer catalog, cart, checkout
│ └── layouts/ # Base layouts
├── routes/
│ ├── web.php # Web routes
│ └── api.php # API routes: GET /api/products, POST /api/orders
├── public/ # Entry point, product images
├── artisan # Laravel CLI
├── composer.json # PHP dependencies
├── tailwind.config.js # Optional styling
└── README.mdFrontend
- Log in as Admin:
Email: admin@demo.com
Password: password- Manage products, users, and orders
- Log in as Customer:
Email: customer@demo.com
Password: password- Browse catalog, add products to cart, checkout.
- GET Products
curl -i http://127.0.0.1:8000/api/productsReturns JSON list of all products with id, name, price, stock, and description.
- POST Orders
curl -i -X POST "http://127.0.0.1:8000/api/orders" \
-H "Accept: application/json" \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"product_id":1,"qty":2},
{"product_id":3,"qty":1}
]
}'- Requires a Sanctum token for authentication
- Returns JSON with order details, user ID, total, and item breakdown
Top Selling Products
This screenshot shows the top 5 products based on total quantity sold.
Total Revenue per Day (Last 7 Days)
Shows total revenue per day including days with no orders.
Customer Orders & Lifetime Spend
Displays each customer’s total number of orders and lifetime spend.

Video Demo: https://drive.google.com/file/d/1gsKXa-P8aqc1owIYReZRndzBgT5y74FS/view