β οΈ Note: The application is hosted on Render's free tier. The server may go to sleep after inactivity. Please wait ~60 seconds for the initial load if the site is slow.π Live Demo: https://diamond-store-web.onrender.com
A production-ready jewelry e-commerce platform with modern DevOps practices, payment integration, and cloud deployment.
Diamond Store is a comprehensive full-stack e-commerce application developed as a University Course Project (3 months). It simulates a real-world luxury jewelry store, demonstrating end-to-end development capabilities from system design to production deployment using modern cloud infrastructure.
πΉ Live Demo Video (YouTube)
- ποΈ Product Catalog - Browse, search, and filter jewelry by category, price, and material
- π Shopping Cart - Complete cart management with real-time updates
- π³ Payment Integration - Multiple payment methods (VNPay, MoMo, Cash on Delivery)
- π§ Email Notifications - Automated order confirmation emails via PHPMailer
- π Order Management - Track and update order status
- π¦ Inventory Control - CRUD operations for products and categories
- π₯ Customer Management - View customer data and order history
- π Analytics - Sales reports and business insights
Admin Dashboard:
- URL: diamond-store-web.onrender.com/admincp/login.php
- Username:
admin - Password:
123
Customer Account:
- Email:
demo@gmail.com - Password:
password123! - (Or you can register a new account freely)
- PHP 8.0 - Core application logic
- MySQL 8.0 - Relational database with Railway cloud hosting
- Apache 2.4 - Web server with mod_rewrite
- Composer - Dependency management (PHPMailer)
- HTML5/CSS3 - Responsive UI design
- JavaScript (Vanilla) - Interactive features
- Font Awesome - Icon library
- Docker - Containerization with multi-stage builds
- Render.com - Web application hosting (free tier)
- Railway - MySQL database hosting (free tier)
- Git/GitHub - Version control with CI/CD auto-deployment
- VNPay - Vietnamese payment gateway
- MoMo - Mobile wallet integration
- VNPay - IPN callback handling for secure payments
- MoMo - Mobile wallet payment verification
- PHPMailer - SMTP service for order confirmations
βββββββββββββββββββ
β GitHub Repo β
β (Source Code) β
ββββββββββ¬βββββββββ
β Auto-deploy on push
βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Render.com βββββββΊβ Railway MySQL β
β (Docker App) β β (Database Host) β
β Port: 80 β β Port: 28967 β
βββββββββββββββββββ ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β End Users β
β (Public Access) β
βββββββββββββββββββ
- Docker & Docker Compose
- Git
# 1. Clone repository
git clone https://github.com/phu-boop/diamond-store-fullstack.git
cd diamond-store-fullstack
# 2. Start with Docker Compose
docker-compose up -d
# 3. Import database
docker exec -i diamond-store-db mysql -uroot -prootpassword web_mysqli < web_mysqli.sql
# 4. Access application
open http://localhost:8080- URL:
http://localhost:8080/admincp/login.php - Username:
admin - Password:
123
Database (Railway)
# Connection URL format
mysql://root:password@host:28967/railwayWeb Application (Render)
- Runtime: Docker
- Auto-deploy: Enabled on main branch
- Environment Variables: 6 configured (DB credentials, BASE_URL)
- Code Changes β Push to GitHub
- Automatic Build β Render detects commit and triggers Docker build
- Container Deploy β New container replaces old one (zero-downtime)
CI/CD Pipeline:
- CI (GitHub Actions): Automatically builds the Docker image on every push to ensure code integrity and build success.
- CD (Render): Automatically deploys the successful build to the production environment.
-
Containerization
- Custom Dockerfile with optimized layer caching
- Multi-stage builds for dependency management
- Challenge: Configuring Apache to serve properly behind Render's load balancer and handling variable port bindings.
- Solution: Reconfigured
000-default.confto bind to0.0.0.0and optimized the Dockerfile with multi-stage builds to reduce image size and build time.
-
Database Migration
- Migrated from localhost MySQL to cloud Railway
- Dynamic port configuration (28967 instead of default 3306)
- Challenge: Handling secure database connections across different environments (Dev vs Prod).
- Solution: Implemented robust environment variable management for DB credentials and successfully migrated data from local MySQL to Railway's cloud instance.
-
Dependency Management
- Composer integration for PHPMailer library
- Proper autoloading instead of manual requires
.gitignorefor vendor directory exclusion
-
Network Configuration
- Fixed Apache VirtualHost binding issues
- Custom
000-default.conffor wildcard interfaces Listen 0.0.0.0:80for external accessibility
diamond-store-fullstack/
βββ admincp/ # Admin panel
β βββ config/ # Database configuration
β βββ modules/ # Admin features (products, orders, etc.)
βββ pages/ # Customer-facing pages
β βββ main/ # Main shopping flow
β βββ header.php # Navigation
βββ assets/ # Static resources (CSS, JS, images)
βββ mail/ # Email functionality (PHPMailer)
βββ Dockerfile # Container configuration
βββ docker-compose.yml # Local development stack
βββ render.yaml # Render.com deployment config
βββ composer.json # PHP dependencies
βββ web_mysqli.sql # Database schema & seed data
β
PHP object-oriented programming
β
MySQL database design & optimization
β
RESTful API integration (VNPay, MoMo IPN handling)
β
Email automation (PHPMailer/SMTP)
β
Session management & authentication
β
Docker containerization
β
Cloud deployment (Render + Railway)
β
CI/CD pipeline setup
β
Environment variable management
β
Web server configuration (Apache)
β
Git version control
β
Dependency management (Composer)
β
Configuration file management
β
Documentation writing
β
Problem-solving & debugging
- tbl_sanpham - Product catalog (130+ items)
- tbl_danhmuc - Product categories
- tbl_giohang - Shopping cart & orders
- tbl_khachhang - Customer accounts
- tbl_vanchuyen - Shipping information
- tbl_khuyenmai - Promotional campaigns
- tbl_admin - Admin users
Total Records: 200+ customers, 127+ orders, 130+ products
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ ORDER_DETAIL : contains
PRODUCT ||--o{ ORDER_DETAIL : includes
CATEGORY ||--o{ PRODUCT : categorizes
ADMIN ||--o{ PRODUCT : manages
(Ascii representation of core relationships)
- Password hashing (MD5)
β οΈ Security Note: MD5 hashing is used due to the specific constraints of this course project. In a real-world production environment, bcrypt or Argon2 would be implemented for enhanced security.
- SQL injection prevention via prepared statements
- Environment variable-based secrets (no hardcoded credentials)
.gitignorefor sensitive files
- Docker layer caching for faster builds
- Composer autoloader optimization (
--optimize-autoloader) - Apache
mod_rewritefor clean URLs - Database indexing on foreign keys
- Upgrade password hashing to bcrypt/Argon2
- Implement Redis for session storage
- Add unit tests (PHPUnit)
- Migrate to Laravel/Symfony framework
- Implement CI/CD testing pipeline
- Add monitoring (Sentry/New Relic)
- Cloud Deployment: Gained hands-on experience deploying containerized PHP applications on Render and managing remote SQL databases on Railway.
- Payment Integration: Understood the complexities of integrating real-world payment gateways (VNPay, MoMo) including handling IPN callbacks and signature verification.
- DevOps: Learned to optimize Dockerfiles with multi-stage builds and manage environment-sensitive configurations.
- Troubleshooting: Developed strong debugging skills by resolving cross-environment issues (local vs cloud) such as Apache port binding and CORS.
Nguyα» n LΓͺ Anh PhΓΊ
- π§ Email: phudz25022005@gmail.com
- π GitHub: @phu-boop
- πΌ LinkedIn: Nguyα» n LΓͺ Anh PhΓΊ
This project is licensed under the MIT License.
- Payment integration: VNPay, MoMo APIs
- Icons: Font Awesome
- Hosting: Render.com (Web), Railway (Database)
- Email: PHPMailer library
β If you find this project interesting, please give it a star!

