s # Clothify
Clothify is a full-stack e-commerce application built with Laravel, Sanctum, Blade, Vite, and Tailwind CSS. It combines a customer-facing storefront with an admin/staff dashboard for managing products, categories, stock, and orders.
The project is designed as an API-first Laravel app: Blade renders the main screens, while modular JavaScript talks to versioned API endpoints under /api/v1.
- Customer storefront with product browsing, search, category filtering, price filtering, sorting, pagination, and product detail modals
- Shopping cart drawer with quantity updates and checkout flow
- Delivery checkout fields tailored for Ghana, including region, landmark, and Ghana Post GPS support
- User registration and login with Laravel Sanctum session authentication for the web
- Optional mobile-style token authentication using an
X-Mobile-Apprequest header - Role-based access control for admin and staff dashboard routes
- Admin dashboard with total products, total orders, revenue, low-stock counts, low-stock items, and recent orders
- Product management with create, edit, delete, image upload, active/inactive state, categories, and variants
- Stock adjustment endpoint with stock movement history support
- Order management with filters, detail modal, status updates, payment status updates, and deletion
- Docker setup with PHP, Nginx, MySQL, and phpMyAdmin
- Backend: Laravel 12, PHP 8.2
- Auth: Laravel Sanctum
- Frontend: Blade, Vite, Tailwind CSS 4, vanilla JavaScript modules
- Database: Mysql
- Tooling: Composer, npm, PHPUnit, Laravel Pint-ready dependencies
- Containers: Docker Compose, Nginx, MySQL 8, phpMyAdmin
/login- user login/register- customer registration/shop- customer storefront/dashboard- admin/staff overview dashboard/products- admin/staff product and variant management/orders- admin/staff order management
All API routes are versioned under /api/v1.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/register |
Create a customer account |
POST |
/api/v1/login |
Log in with session auth or mobile token auth |
GET |
/api/v1/products |
List products with filters, search, sorting, and pagination |
GET |
/api/v1/products/{product} |
Get product details with category and variants |
GET |
/api/v1/categories |
List product categories |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/logout |
Log out current user |
GET |
/api/v1/me |
Get the current user profile |
POST |
/api/v1/orders |
Place a customer order |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/stats |
Dashboard metrics |
POST |
/api/v1/products |
Create a product |
PUT |
/api/v1/products/{product} |
Update a product |
DELETE |
/api/v1/products/{product} |
Delete a product |
POST |
/api/v1/products/{product}/adjust-stock |
Adjust stock and log movement |
POST |
/api/v1/product-variants |
Create a product variant |
POST |
/api/v1/categories |
Create a category |
DELETE |
/api/v1/categories/{category} |
Delete a category |
GET |
/api/v1/orders |
List orders |
GET |
/api/v1/orders/{order} |
View an order |
PATCH |
/api/v1/orders/{order}/status |
Update order status |
PATCH |
/api/v1/orders/{order}/payment-status |
Update payment status |
DELETE |
/api/v1/orders/{order} |
Delete an order |
- PHP 8.2 or higher
- Composer
- Node.js and npm
- SQLite or MySQL
- Docker Desktop, if using the container setup
Clone the repository and install dependencies:
composer install
npm installCreate the environment file and application key:
cp .env.example .env
php artisan key:generateCreate the SQLite database if you are using the default .env.example database settings:
touch database/database.sqliteRun migrations:
php artisan migrateLink public storage for product images:
php artisan storage:linkStart the app:
composer run devThe Laravel server will run at http://127.0.0.1:8000 and Vite will serve frontend assets.
Start the containers:
docker compose up -d --buildThe app will be available at:
- App:
http://localhost:8000 - phpMyAdmin:
http://localhost:8080 - MySQL host port:
3307
For Docker, use MySQL settings similar to:
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=ecommerce
DB_USERNAME=root
DB_PASSWORD=secretThen run migrations inside the app container:
docker compose exec app php artisan migrate
docker compose exec app php artisan storage:linkThe project includes an AdminSeeder that reads credentials from .env.
ADMIN_NAME="Admin User"
ADMIN_EMAIL="admin@example.com"
ADMIN_PASSWORD="use-a-strong-password"The admin password must be at least 12 characters. After adding the values, run:
php artisan db:seed --class=AdminSeederor, with Docker:
docker compose exec app php artisan db:seed --class=AdminSeederAfter the first login, remove ADMIN_PASSWORD from .env.
app/Http/Controllers/API/V1 Versioned API controllers
app/Http/Middleware Role-based access middleware
app/Models Eloquent models for users, products, orders, variants, categories, and stock
database/migrations Database schema
database/seeders Seeders, including admin user setup
resources/views Blade pages and layout components
resources/js Modular frontend JavaScript
resources/css Tailwind and storefront styling
routes/api.php API routes
routes/web.php Blade page routes
docker/ PHP and Nginx container config
Run the test suite:
composer testBuild frontend assets:
npm run buildThis project is open-source under the MIT license.










