Skip to content

young-bossman/clothify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

πŸ“Έ Preview

πŸ” Authentication

Login Page


πŸ›οΈ Storefront

Storefront

Products Listing

Storefront Search


πŸŒ™ Dark Mode

Dark Mode Home

Dark Mode Search

Dark Mode Active Search


πŸ“¦ Product Management

Products Management


🧾 Orders Management

Orders Page


πŸ“Š Admin Dashboard

Dashboard


πŸ’³ Checkout

Checkout Page

Features

  • 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-App request 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

Tech Stack

  • 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

Screens

  • /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

API Overview

All API routes are versioned under /api/v1.

Public

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

Authenticated

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

Admin / Staff

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

Getting Started

Requirements

  • PHP 8.2 or higher
  • Composer
  • Node.js and npm
  • SQLite or MySQL
  • Docker Desktop, if using the container setup

Local Setup

Clone the repository and install dependencies:

composer install
npm install

Create the environment file and application key:

cp .env.example .env
php artisan key:generate

Create the SQLite database if you are using the default .env.example database settings:

touch database/database.sqlite

Run migrations:

php artisan migrate

Link public storage for product images:

php artisan storage:link

Start the app:

composer run dev

The Laravel server will run at http://127.0.0.1:8000 and Vite will serve frontend assets.

Docker Setup

Start the containers:

docker compose up -d --build

The 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=secret

Then run migrations inside the app container:

docker compose exec app php artisan migrate
docker compose exec app php artisan storage:link

Admin Account

The 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=AdminSeeder

or, with Docker:

docker compose exec app php artisan db:seed --class=AdminSeeder

After the first login, remove ADMIN_PASSWORD from .env.

Project Structure

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

Testing

Run the test suite:

composer test

Build frontend assets:

npm run build

License

This project is open-source under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors