A web-based business intelligence and data synchronization system for Mode Fashion Group retail operations. Built with Yii Framework, it provides real-time visibility into store revenue, inventory tracking, and seamless data synchronization between warehouses, stores, and cashier systems.
- Revenue Management: Track daily revenue per store with date range filtering
- Sales Analytics: Sales recaps, weekly reports, and global summaries
- Inventory Tracking: Monitor item history, distribution, and stock levels
- Data Synchronization: Real-time sync between warehouse (Sisgud), cashier (Sikasir), and central server
- Reporting: Generate revenue reports with chart visualizations
- User Management: Role-based access control (RBAC) with session management
- β Multi-store revenue tracking and grouping
- β Item distribution management
- β Sales transaction history
- β Store IP address tracking
- β Automated data synchronization
- β Interactive charts and visualizations
- β Secure authentication and authorization
- Framework: Yii 1.1.x (PHP)
- Database: MySQL
- Language: PHP 8.3+
- Web Server: Nginx + PHP-FPM
- Frontend: Chart.js, jQuery
- Container: Docker
- Orchestration: Kubernetes
- PHP 8.3+ with required extensions (pdo_mysql, gd, zip, mcrypt, redis)
- MySQL 5.7+ or 8.0+
- Composer (for dependencies)
- Docker & Docker Compose (for containerized deployment)
- Kubernetes cluster (for K8s deployment)
-
Clone the repository
git clone <repository-url> cd mfg-dashboard
-
Configure database
- Create MySQL database:
mode_dashboard - Import schema:
docs/dashboard.sql - Update
protected/config/main.phpwith database credentials
- Create MySQL database:
-
Set up Yii Framework
- Ensure Yii framework is available at
../../framework/yii.php(relative to index.php) - Or update the path in
index.php
- Ensure Yii framework is available at
-
Configure application
- Copy
protected/config/main.phpand update database settings - Set up environment variables (see KUBERNETES_ENV.md)
- Copy
-
Run with Docker Compose
docker-compose up -d
-
Access the application
- Open browser:
http://localhost - Default credentials: Check
docs/daftar_auth.txt
- Open browser:
# Build image
docker build -t mfg-dashboard:latest -f build/Dockerfile .
# Run container
docker run -d -p 80:80 \
-e DB_HOST=mysql-host \
-e DB_NAME=mode_dashboard \
-e DB_USER=user \
-e DB_PASSWORD=password \
mfg-dashboard:latestThe application supports configuration via environment variables for Kubernetes deployment:
Database Configuration:
DB_HOST- MySQL hostnameDB_NAME- Database nameDB_USER- Database usernameDB_PASSWORD- Database passwordDB_CHARSET- Character set (default: utf8)DB_PORT- Database port (optional)
Application Parameters:
APP_SALT- Password encryption saltAPP_TIMEZONE- Application timezone (default: Asia/Jakarta)APP_TIMEOUT- Session timeout in seconds (default: 900)APP_ADMIN_EMAIL- Administrator emailAPP_COMPANY_NAME- Company nameAPP_PAGINATION_SIZE- Pagination size (default: 10)
See KUBERNETES_ENV.md for complete documentation.
protected/config/main.php- Main application configurationprotected/config/console.php- Console application configurationprotected/config/test.php- Test environment configuration
Complete Kubernetes manifests are available in the k8s/ directory.
Quick Deploy:
# 1. Create secrets
kubectl create secret generic mfg-dashboard-secret \
--from-literal=DB_HOST=mysql-service \
--from-literal=DB_PASSWORD=your-password \
--from-literal=APP_SALT=your-salt \
--namespace=mfg-dashboard
# 2. Deploy application
kubectl apply -f k8s/See k8s/README.md and k8s/DEPLOYMENT_GUIDE.md for detailed instructions.
The project uses GitHub Actions for automated builds and deployments.
Setup:
-
Add Docker Hub secrets to GitHub:
DOCKER_USERNAMEDOCKER_PASSWORD
-
Push a tag to trigger build:
git tag v1.0.0 git push origin v1.0.0
See .github/DOCKER_HUB_SETUP.md for setup instructions.
mfg-dashboard/
βββ protected/ # Application core
β βββ config/ # Configuration files
β βββ controllers/ # MVC Controllers
β βββ models/ # Data models
β βββ views/ # View templates
β βββ components/ # Custom components
βββ themes/ # UI themes (ace, classic)
βββ css/ # Stylesheets
βββ images/ # Static images
βββ k8s/ # Kubernetes manifests
βββ build/ # Build files and Dockerfiles
βββ docs/ # Documentation and SQL files
βββ .github/ # GitHub Actions workflows
# PHPUnit tests
phpunit tests/Gii code generator is available at:
- URL:
http://localhost/index.php?r=gii - Password:
123456(change in production!)
Import database schema:
mysql -u user -p mode_dashboard < docs/dashboard.sql- KUBERNETES_ENV.md - Environment variables reference
- k8s/README.md - Kubernetes deployment guide
- k8s/DEPLOYMENT_GUIDE.md - Detailed deployment instructions
- GITHUB_ACTIONS_MIGRATION.md - CI/CD migration guide
- .github/DOCKER_HUB_SETUP.md - Docker Hub setup
- memory-bank/ - Project documentation and context
- Role-based access control (RBAC)
- Session timeout management (15 minutes default)
- Password encryption with custom salt
- Secure API endpoints for synchronization
- Input validation and sanitization
Important: Change default passwords and secrets before production deployment!
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Copyright Β© Mode Fashion Group. All Rights Reserved.
For issues, questions, or contributions:
- Check documentation in
docs/andmemory-bank/ - Review Kubernetes deployment guides in
k8s/ - Check CI/CD setup in
.github/
- v2.0 - Kubernetes support, environment variable configuration
- v1.0 - Initial release with core functionality
Built with β€οΈ for Mode Fashion Group