A production-style PHP e-commerce application for selling foods, featuring secure authentication, role-based access control, and a fully containerized Docker environment.
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Docker Architecture
- Database Design
- Pages & Routes
- Security Architecture
- Admin Dashboard
- Screenshots
- Contributing
- License
Bloom & Basket is a PHP-based e-commerce platform designed for real-world deployment.
It delivers a complete shopping workflow — product browsing, cart management, checkout, and order tracking — alongside a protected administrative dashboard for inventory, users, and orders.
The entire stack is containerized using Docker, enabling deterministic builds and easy environment replication.
- Product catalog with categories, search, and filters
- Detailed product pages with pricing and availability
- Secure user registration and authentication
- Session-based shopping cart
- Checkout with address and order confirmation
- Personal order history and status tracking
- Sales and order overview dashboard
- Product and inventory management (CRUD)
- Order lifecycle management
- User and role administration
- Fully isolated admin routes
- Docker-based deployment
- MySQL relational database
- PDO with prepared statements
- Server-side session management
- Responsive frontend layout
| Layer | Technology |
|---|---|
| Backend | PHP 8.x |
| Database | MySQL 8.0 |
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Web Server | Apache (Docker) |
| Containerization | Docker & Docker Compose |
| Database Interface | PDO |
| Styling | Custom responsive CSS |
web_development/
├── docker-compose.yml
├── Dockerfile
├── .env.example
│
├── public/
│ ├── index.php
│ ├── assets/
│ ├── pages/
│ └── admin/
│
├── src/
│ ├── config/
│ ├── controllers/
│ ├── models/
│ └── helpers/
│
├── sql/
│ ├── schema.sql
│ └── seed_admin.sql
│
└── apache/
└── default.conf
- Docker 20.10+
- Docker Compose 2.0+
- Git
git clone https://github.com/Montasir00/web_development.git
cd web_development
cp .env.example .env
docker-compose up --build| URL | Purpose |
|---|---|
| http://localhost:8080 | Customer storefront |
| http://localhost:8080/admin/dashboard.php | Admin panel |
| http://localhost:8081 | phpMyAdmin (development) |
| Service | Image | Port | Role |
|---|---|---|---|
| app | php:8-apache | 8080 | Web server |
| db | mysql:8.0 | 3306 | Database |
| phpmyadmin | phpmyadmin/phpmyadmin | 8081 | DB admin UI |
- Normalized relational schema
- Foreign key enforcement
- Order → Order Items mapping
- Role-based user model
Roles: customer, admin
Order States: pending, processing, shipped, delivered, cancelled
| Route | Description |
|---|---|
/ |
Home |
/pages/shop.php |
Product catalog |
/pages/product.php |
Product detail |
/pages/cart.php |
Shopping cart |
/pages/checkout.php |
Checkout |
/pages/orders.php |
Order history |
| Route | Description |
|---|---|
/admin/dashboard.php |
Dashboard |
/admin/products.php |
Product management |
/admin/orders.php |
Order management |
/admin/users.php |
User management |
Implemented as a defense-in-depth model:
- PDO prepared statements (SQL injection prevention)
- bcrypt password hashing
- CSRF synchronizer tokens
- Session regeneration and idle timeout
- HttpOnly, Secure, SameSite cookies
- Output escaping against XSS
- Role-based access control
- Login rate limiting
- HTTPS and hardened security headers
Admin functionality is fully isolated and role-gated.
Capabilities include:
- Sales analytics
- Inventory management
- Order status control
- User role promotion
Add screenshots under docs/screenshots/ and reference them here.
- Fork the repository
- Create a feature branch
- Commit following conventional commits
- Open a pull request against
main
MIT License — see LICENSE for details.
Bloom & Basket
Bachelor in Data Analysis — Web Development Project
Academic Year 2025 / 2026