A full-featured B2C online store with admin panel, shopping cart, and PDF reports — built with Laravel 12.
📄 Read this in: English | Español
Academic Project Universidad Privada Domingo Savio — Ing. de Sistemas Course: Web Technology II · 2025
A complete B2C e-commerce platform covering the full cycle from product management to customer purchase.
Customer area:
- Browse and search the full product catalog
- Add items to a session-based shopping cart
- Register, log in, and manage your profile
- Complete purchases through a simple checkout flow
Admin panel:
- Role-based access control (admin / customer)
- Real-time dashboard with sales, top products, and top customers
- Full CRUD for products, categories, users, and orders
- Soft delete and reactivation for all entities
- Export products, users, and sales as PDF reports
| Category | Technology | Version |
|---|---|---|
| Core | Laravel | 12.x |
| Core | PHP | 8.4+ |
| Database | MySQL | 8.0+ |
| Frontend | Tailwind CSS | 3.x |
| Frontend | Alpine.js | 3.x |
| Frontend | Bootstrap | 5.x (CDN) |
| Frontend | Font Awesome | 6.x (CDN) |
| Build | Vite | 6.x |
| DomPDF | 3.1 | |
| Auth | Laravel Breeze | 2.x |
| Testing | PHPUnit | 11.5 |
| Member | Role | Contributions |
|---|---|---|
| Diego Vargas | Full-Stack Developer | Admin panel, business logic, project architecture |
| Damaris Mamani | Frontend Developer | Customer UI, responsive design, UX |
| Yordy Sanchez | Frontend Developer | Views, components, client-server integration |
ecommerce-b2c/
├── app/
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Admin/ # Admin CRUD controllers
│ │ │ ├── Auth/ # Authentication controllers
│ │ │ ├── CartController.php
│ │ │ └── HomeController.php
│ │ └── Middleware/
│ │ └── AdminMiddleware.php
│ └── Models/ # User, Product, Category, Sale, SaleDetail
├── resources/views/
│ ├── admin/ # Admin panel Blade views
│ ├── home/ # Customer storefront views
│ ├── cart/ # Shopping cart view
│ └── layouts/ # Shared layouts
├── routes/
│ ├── web.php # All web routes
│ └── auth.php # Auth routes (Breeze)
├── database/
│ ├── migrations/ # Schema definitions
│ ├── factories/ # Model factories
│ └── seeders/ # Database seeders
└── public/storage/ # Uploaded product images
- PHP 8.4+
- MySQL 8.0+
- Node.js 18+
- Composer 2.6+
-
Clone the repository:
git clone https://github.com/temps-code/ecommerce-b2c.git cd ecommerce-b2c -
Install PHP dependencies:
composer install
-
Install frontend dependencies and build assets:
npm install && npm run build -
Copy and configure the environment file:
cp .env.example .env php artisan key:generate
-
Update
.envwith your database credentials, then run migrations and seeders:php artisan migrate --seed
-
Create the storage symlink for uploaded images:
php artisan storage:link
-
Start the development server:
php artisan serve
The app will be available at
http://localhost:8000.
Key variables to set in your .env file:
| Variable | Description | Default |
|---|---|---|
APP_URL |
Application base URL | http://localhost |
DB_CONNECTION |
Database driver | mysql |
DB_HOST |
Database host | 127.0.0.1 |
DB_PORT |
Database port | 3306 |
DB_DATABASE |
Database name | — |
DB_USERNAME |
Database user | — |
DB_PASSWORD |
Database password | — |
| Method | Route | Description |
|---|---|---|
| GET | / |
Homepage — featured products |
| GET | /productos |
Full product catalog |
| GET | /product/{id} |
Product detail |
| GET | /about |
About page |
| GET | /cart |
Shopping cart |
| POST | /cart/add/{id} |
Add product to cart |
| POST | /cart/update/{id} |
Update item quantity |
| POST | /cart/remove/{id} |
Remove item from cart |
| POST | /cart/checkout |
Complete purchase |
| Method | Route | Description |
|---|---|---|
| GET | /login |
Login page |
| POST | /login |
Authenticate user |
| GET | /register |
Registration page |
| POST | /register |
Create new account |
| POST | /logout |
Log out |
| Method | Route | Description |
|---|---|---|
| GET | /admin/dashboard |
Admin dashboard with metrics |
| GET / POST | /admin/products |
List / create products |
| GET / PUT / DELETE | /admin/products/{id} |
Show / update / delete product |
| GET / POST | /admin/categories |
List / create categories |
| GET / PUT / DELETE | /admin/categories/{id} |
Show / update / delete category |
| GET / POST | /admin/users |
List / create users |
| GET / PUT / DELETE | /admin/users/{id} |
Show / update / delete user |
| GET | /admin/sales |
List all sales |
| GET | /admin/sales/{id} |
Sale detail |
| GET | /admin/reports/products |
Export products as PDF |
| GET | /admin/reports/users |
Export users as PDF |
| GET | /admin/reports/sales |
Export sales as PDF |
The seeders create a complete working dataset:
php artisan db:seed| Seeder | Description |
|---|---|
UserSeeder |
Admin user + sample customers |
CategorySeeder |
Sample product categories |
ProductSeeder |
Product catalog with images |
SaleSeeder |
Sample orders |
SaleDetailSeeder |
Order line items |
After seeding, log in as admin using the credentials defined in
UserSeeder.
