Skip to content

abx15/laravel-react-ecommerce

πŸ›’ OpenShop - Professional E-Commerce Platform

License CI Laravel React Docker

A production-grade, fully open-source E-Commerce platform built with Laravel 11 (API) and React 18. Designed for scalability, security, and exceptional developer experience.

πŸš€ Key Features

🎯 Core Functionality

  • Multi-role Authentication: Users, Admins, and Super Admins
  • Product Catalog: Complete CRUD with image uploads and categories
  • Shopping Cart: Persistent cart with real-time updates
  • Order Management: Full order lifecycle with status tracking
  • Payment Integration: Secure Razorpay payments with server-side verification
  • Responsive Design: Mobile-first approach with Tailwind CSS

Backend (Laravel API)

  • Authentication: Laravel Sanctum token-based authentication
  • RBAC: Role-Based Access Control via Spatie Permissions
  • API Standards: RESTful design with proper HTTP codes
  • Security: Input validation, rate limiting, and CORS protection

Frontend (React)

  • Modern Stack: React 18, Vite, Tailwind CSS
  • State Management: Context API with custom hooks
  • Admin Dashboard: Complete admin panel for store management
  • SPA Architecture: Seamless client-side routing

πŸ›  Tech Stack

| Component | Technology |

Info Details
Backend PHP 8.2+, Laravel 11, MySQL 8
Frontend React 18, Vite, Tailwind CSS, Headless UI
Auth Laravel Sanctum, Spatie Permission
DevOps Docker, GitHub Actions, Vercel

πŸ“‚ Project Structure

ecomer/
β”œβ”€β”€ backend/                 # Laravel API Backend
β”œβ”€β”€ frontend/                # React Frontend
β”œβ”€β”€ .github/                 # CI/CD & Community Files
β”œβ”€β”€ docker/                  # Docker Configs
β”œβ”€β”€ vercel.json              # Vercel Deployment Config
β”œβ”€β”€ Dockerfile               # Production Frontend Build
└── README.md                # Documentation

πŸš€ Quick Start (Local Development)

Prerequisites

  • PHP 8.2+ & Composer
  • Node.js 18+ & NPM
  • MySQL 8+

1. Clone & Setup

git clone https://github.com/abx15/laravel-react-ecommerce.git
cd laravel-react-ecommerce

2. Backend Setup

cd backend
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
php artisan storage:link
php artisan serve

3. Frontend Setup

cd frontend
npm install
npm run dev

Access the app at http://localhost:5175.

🐳 Docker Usage

We provide a production-ready Docker setup for the frontend.

Build and Run

# Build the image
docker build -t ecomer-frontend .

# Run the container
docker run -p 8080:80 ecomer-frontend

Access the frontend at http://localhost:8080.

πŸ”„ CI/CD Pipeline

This repository uses GitHub Actions for continuous integration:

  • Frontend Build: Linting and building the React application.
  • Backend Tests: Running PHPUnit tests with a MySQL service.

Check .github/workflows/ci.yml for details.

☁️ Deployment

Vercel (Frontend)

This project is configured for Vercel. The vercel.json ensures that client-side routing works correctly.

  1. Import project to Vercel.
  2. Set Root Directory to frontend (or keep root and set Build Command npm run build in frontend).
  3. Deploy!

Environment Variables

See backend/.env.example and frontend/.env.example for required variables.

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

πŸ’– Support & Sponsorship

If you find this project useful, please consider sponsoring:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Maintained by Arun Kumar Bind

About

Production-ready full-stack e-commerce application using Laravel (API), React, Tailwind CSS, MySQL, Sanctum auth, and Razorpay payments.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors