Business analytics portfolio platform with forecasting, dashboards and bilingual chatbot workflows.
- React 18.3 - UI library
- TypeScript 5.5 - Type-safe JavaScript
- Vite 5.4 - Build tool and dev server
- TailwindCSS 3.4 - Utility-first CSS framework
- React Query 5.59 - Data fetching and caching
- Recharts - Data visualization
- i18next - Internationalization (ES/EN)
- Spring Boot 3.2 - Java microservices framework
- Java 17 - Programming language
- Maven 3.9 - Build automation
- Spring Cloud Gateway - API Gateway and routing
- JPA/Hibernate - ORM for database access
- Python 3.9+ - Programming language
- PyTorch 2.5 - Deep learning framework
- FastAPI 0.115 - Modern Python web framework
- Scikit-learn - Machine learning utilities
- Pandas - Data manipulation
- MySQL 8.0 - Relational database
- Connection Pooling - HikariCP
- Docker - Containerization (ready)
- SonarQube - Code quality and security analysis
- Vercel - Frontend deployment platform
- GitHub Actions - CI/CD automation
- Maven Wrapper - Build consistency
- Vitest 2.1 - Frontend unit testing
- JUnit 5 - Backend unit testing
- Playwright 1.48 - E2E testing and automation
- fast-check - Property-based testing
- Coverage - Code coverage reporting
Watch the platform in action (includes Dashboard, Sales, Customers, Products, Forecasts, Documents, and Chatbot):
π₯ Watch Full Demo on YouTube | π₯ Download MP4 (4.1MB)
- Node.js 18+
- Python 3.9+
- MySQL 8.0+
- Java 17+ (for API Gateway)
- Maven 3.6+
- ffmpeg (for demo recording)
# 1. Set MySQL password
export MYSQL_PASSWORD=your_password
# 2. Initialize database
./scripts/setup-database.sh
# 3. Start all services
./scripts/start-system.sh
# 4. Access application
# Frontend: http://localhost:5173
# API Gateway: http://localhost:8080
# AI Service: http://localhost:8000./scripts/stop-system.sh| Service | Port | Description |
|---|---|---|
| Frontend | 5173 | React application |
| API Gateway | 8080 | Request routing |
| AI Service | 8000 | ML models & chatbot |
| Customer Service | 8081 | Customer management |
| Product Service | 8082 | Product catalog |
| Sales Service | 8083 | Sales transactions |
| Analytics Service | 8084 | Business analytics |
| Document Service | 8085 | File uploads |
BusinessAI-Analytics/
βββ README.md # Complete documentation (this file)
βββ package.json # Demo dependencies
βββ sonar-project.properties # SonarQube config
βββ preview.png # Demo video thumbnail
βββ demo.webm # Demo video file
β
βββ scripts/ # All executable scripts
β βββ start-system.sh # Start all services
β βββ stop-system.sh # Stop all services
β βββ setup-database.sh # Initialize database
β βββ check-system.sh # Health check
β βββ run-demo.sh # Full demo recording
β βββ test-recording.sh # Quick test
β βββ demo-interactive.ts # Browser automation
β βββ tsconfig.demo.json # TypeScript config
β
βββ frontend/ # React + TypeScript UI
β βββ README.md # Frontend documentation
βββ api-gateway/ # Spring Boot API Gateway
β βββ README.md # Gateway documentation
βββ ai-service/ # Python AI/ML service (PyTorch)
β βββ README.md # AI service documentation
βββ analytics-service/ # Spring Boot analytics
βββ customer-service/ # Spring Boot customer management
βββ product-service/ # Spring Boot product management
βββ sales-service/ # Spring Boot sales management
βββ document-service/ # Spring Boot document management
βββ database/ # MySQL schema and migrations
β βββ README.md # Database documentation
βββ logs/ # Service logs
- README.md (this file) - Complete project documentation including:
- Quick start guide and setup instructions
- Architecture and features overview
- Deployment strategy and Git workflow
- Code quality and security guidelines
- Troubleshooting and maintenance
- CI-CD-SECURITY-FIXES.md - Comprehensive CI/CD and security documentation:
- CI/CD pipeline configuration and fixes
- Security vulnerability analysis and solutions
- Quality metrics and improvements
- Verification procedures and troubleshooting
- Service READMEs - Detailed documentation for each service:
frontend/README.md- React app, API client, hooksapi-gateway/README.md- Routing, CORS, configurationai-service/README.md- AI models, chatbot, forecastingdatabase/README.md- Schema, queries, data generation
- Business metrics visualization
- Sales, costs, and profit trends
- Interactive date filtering
- Real-time data updates
- PyTorch-based forecasting
- Revenue and profit predictions
- Trend analysis and insights
- Historical data analysis
- Spanish/English support
- Natural language queries
- Business intelligence insights
- Data source attribution
- Product management
- Customer management
- Sales tracking
- Document uploads
- Transaction history
- Real-time updates
- Performance optimized
- Card-based UI
π₯ See Example: Latest Demo on YouTube - 4-minute complete platform demonstration
# 1. Start all services
./scripts/start-system.sh
# 2. Run automatic recording
npm run demo:video
# 3. Get your video
# Location: ./recordings/
# Format: WebM (1920x1080)
# Duration: 4-5 minutes# Install ffmpeg (if needed)
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
# High quality (recommended for YouTube)
ffmpeg -i recordings/your-video.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 192k demo-video.mp4
# Batch convert all videos
for file in recordings/*.webm; do
ffmpeg -i "$file" -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 192k "${file%.webm}.mp4"
doneβ
Login Screen (8 seconds)
β
Dark Mode Toggle - Light/Dark theme switching
β
Language Switch - English/Spanish
β
Demo Login - Credentials entry
β
Dashboard (5 seconds) - Business metrics
β
Dashboard Filter - Dynamic data updates
β
AI Forecasts (15+ seconds) - Scrolling predictions
β
Chatbot - 10 questions (5 EN + 5 ES)
β
Clients - Customer list
β
Products - Catalog + create product
β
Register Sale - Sale form
β
Sales Infinite Scroll - Transaction history
Recommended Settings:
- Title: BusinessAI Analytics Platform - Full Demo
- Description: Include feature list and timestamps
- Tags: business analytics, AI, dashboard, forecasting, chatbot
- Category: Science & Technology
- Visibility: Public/Unlisted as needed
Video Timestamps (for description):
0:00 - Login Screen
0:08 - Dark Mode Toggle
0:16 - Language Switch
0:24 - Demo Login
0:31 - Dashboard Overview
0:36 - Dashboard Filter
0:42 - AI Forecasts
1:02 - Chatbot Demo (10 questions)
2:02 - Clients View
2:07 - Products & Create
2:14 - Register Sale
2:19 - Sales Infinite Scroll
./scripts/test-recording.shOutput: ~/Downloads/test-recording.mp4
./scripts/run-demo.shOutput: ~/Downloads/demo.mp4 (1920x1080, ~80-100 MB)
- β All 7 navigation tabs visible
- β Automated browser interaction
- β Screen recording with ffmpeg
- β Graceful shutdown and file saving
- β Full width content (no white space)
- Dashboard (6s) - Real-time business metrics
- Analytics (8s) - AI-powered forecasting
- Chatbot (42s) - 6 Spanish business questions
- Products (12s) - CRUD operations demo
- Customers (12s) - Customer management
- Sales (7s) - Transaction history
- Documents (4s) - Document management
- ffmpeg installed:
brew install ffmpeg - Screen recording permission granted
- MySQL running
- Ports available: 5173, 8080, 8000, 8081-8085
- ~100MB free disk space
cd frontend
npm install
npm run devcd ai-service
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.pycd api-gateway
./mvnw spring-boot:runcd <service-name>
./mvnw spring-boot:run- API Gateway (8080) - Request routing and load balancing
- Frontend (5173) - React SPA
- AI Service (8000) - ML models and chatbot
- Analytics Service (8084) - Business analytics
- Customer Service (8081) - Customer management
- Product Service (8082) - Product catalog
- Sales Service (8083) - Sales transactions
- Document Service (8085) - File uploads
- MySQL 8.0
- Schema:
businessai - Tables: customers, products, sales, documents, business_metrics
- Frontend: React, TypeScript, Vite, Recharts
- Backend: Spring Boot, Java 17
- AI/ML: Python, PyTorch, FastAPI
- Database: MySQL 8.0
- Automation: Playwright, ffmpeg
export MYSQL_PASSWORD=your_password
export OPENAI_API_KEY=your_key # Optional for AI features- Host: localhost
- Port: 3306
- Database: businessai
- User: root
| Script | Description |
|---|---|
scripts/start-system.sh |
Start all services |
scripts/stop-system.sh |
Stop all services |
scripts/setup-database.sh |
Initialize database |
scripts/run-demo.sh |
Record full demo (2-3 min) |
scripts/test-recording.sh |
Test recording (10s) |
scripts/check-system.sh |
Verify system health |
./scripts/check-system.shtail -f logs/*.log# Quick test
./scripts/test-recording.sh
# Full demo
./scripts/run-demo.sh# Check if ports are in use
lsof -i :8080,5173,8000
# Kill processes if needed
./scripts/stop-system.sh --force# Verify MySQL is running
brew services list | grep mysql
# Restart MySQL
brew services restart mysql
# Check connection
mysql -u root -p$MYSQL_PASSWORD -e "SHOW DATABASES;"Video file not created:
# Check screen recording permission
# System Preferences β Security & Privacy β Screen Recording
# Verify ffmpeg
which ffmpeg
ffmpeg -version
# Check logs
cat /tmp/ffmpeg_recording.log | tail -30Video won't play:
# Check file size
ls -lh ~/Downloads/demo.mp4
# Verify with ffprobe
ffprobe ~/Downloads/demo.mp4
# Try VLC player
open -a VLC ~/Downloads/demo.mp4- Browser window should be 1920x1080
- All 7 tabs should fit horizontally
- Check
demo-interactive.tsviewport settings - Verify
Navigation.csstab padding
- β
Cryptographically Secure Random - Using
crypto.randomUUID()for ID generation - β
Security Headers -
X-Content-Type-Options: nosniff,X-Frame-Options: DENY - β Environment Variables - All sensitive data externalized
- β MySQL Password Protection - No hardcoded credentials
- β API Gateway Authentication - Configurable authentication layer
- β CORS Configuration - Properly configured in all services
- β
Input Validation -
@Validannotations on all endpoints - β Proper Exception Logging - SLF4J framework, no sensitive data exposure
- β Parameterized SQL Queries - JPA prevents SQL injection
- β Production Logging - No console output in production builds
| Component | Security Rating | Hotspots | Status |
|---|---|---|---|
| Frontend | A | 0 | β Pass |
| AI Service | A | ~3 | β Pass (legitimate) |
| Java Services | A | ~2 | β Pass (legitimate) |
| Database | A | 0 | β Pass |
Note: Remaining security hotspots are legitimate (test data generation) and properly documented with NOSONAR comments.
- Never commit secrets - Use environment variables
- Review security headers - Ensure all HTTP responses include security headers
- Validate all inputs - Use Spring validation annotations
- Use parameterized queries - Never concatenate SQL strings
- Log securely - No sensitive data in logs
- Keep dependencies updated - Regular security audits
- Follow OWASP guidelines - Security by design
For detailed security analysis and fixes, see CI-CD-SECURITY-FIXES.md
Latest Update: May 3, 2026 - CI/CD Pipeline & Security Fixes
All critical issues have been identified and FIXED. The platform now meets enterprise-grade security and quality standards.
| Category | Status | Rating | Details |
|---|---|---|---|
| Security | β Pass | A | Cryptographically secure, proper headers |
| Reliability | β Pass | A | Proper error handling, no console logging in production |
| Maintainability | β Pass | A | Clean code, well-documented |
| Coverage | β Pass | 80%+ | Comprehensive test coverage |
| Security Hotspots | β Pass | ~5 | All legitimate and documented |
| Duplicated Code | β Pass | <3% | Minimal duplication |
| Type Safety | β Pass | A | TypeScript strict mode |
| SQL Injection | β Pass | A | Parameterized queries only |
Build Failures Now Properly Reported
- Removed
continue-on-error: truefrom critical build steps - Quality gates now enforced automatically
- Build failures block deployment
Benefits: Immediate visibility into issues, prevents bad code deployment
1. Secure Random ID Generation (S2245)
- Replaced
Math.random()withcrypto.randomUUID() - Cryptographically secure random generation
- Files:
frontend/src/components/ui/Input.tsx
2. Production Console Logging (S2228)
- Wrapped console statements with
import.meta.env.DEVchecks - No sensitive data exposure in production
- Files:
AuthContext.tsx,ReactErrorBoundary.tsx
3. Security Headers Added
X-Content-Type-Options: nosniff- Prevents MIME sniffingX-Frame-Options: DENY- Prevents clickjacking- Files:
frontend/src/lib/api.ts,frontend/src/lib/sonarqube/client.ts
Benefits: Enhanced security posture, OWASP compliance, protection against common web vulnerabilities
Critical Issues (3 files)
- Replaced
printStackTrace()with SLF4J logger - Proper log aggregation and structured logging
High Priority Issues (6 files)
- Changed DEBUG logging to INFO level in production
- Reduced log volume and sensitive data exposure
β
Separation of Concerns - Clean architecture with layers
β
DRY Principle - No code duplication
β
SOLID Principles - Proper abstraction and interfaces
β
RESTful Design - Consistent API design
β
Error Handling - Global exception handlers
β
Configuration - Externalized configuration
β
Documentation - Comprehensive README files
β
Testing - Unit, integration, and E2E tests
β No Security Vulnerabilities Found
- Authentication: Environment variables for sensitive data
- SQL Injection: All queries use JPA/parameterized statements
- Error Handling: No sensitive data exposed in error messages
- Logging: No credentials or PII logged
- CORS: Properly configured in API Gateway
- Input Validation: @Valid annotations on all endpoints
β Optimized for Production
- Database indexing on key fields
- Connection pooling configured
- JPA lazy loading enabled
- Query result caching
- Pagination for large datasets
- Infinite scroll optimization
- Monitoring: Add Prometheus metrics endpoints
- Tracing: Implement distributed tracing (Zipkin/Jaeger)
- Rate Limiting: Add API rate limiting
- Caching: Add Redis for session/data caching
- Documentation: Generate OpenAPI/Swagger docs
- CI/CD: Add automated quality gates
CI Pipeline (.github/workflows/ci.yml)
- β Frontend build, lint, type-check, test
- β AI service build and test
- β Java services build and test (all 6 services)
- β Integration tests
- β Security scanning (Trivy)
- β Quality gate enforcement
SonarQube Analysis (.github/workflows/sonarqube.yml)
- β Frontend analysis (TypeScript)
- β AI service analysis (Python)
- β Java services analysis (all 6 services)
- β Quality gate checks
- β Automatic failure on quality issues
| Metric | Threshold | Status |
|---|---|---|
| Security Rating | A | β Pass |
| Maintainability Rating | A | β Pass |
| Reliability Rating | A | β Pass |
| Line Coverage | >= 80% | β Pass |
| Duplicated Lines Density | <= 3% | β Pass |
| New Blocker Issues | 0 | β Pass |
| New Critical Issues | 0 | β Pass |
| New Security Hotspots Reviewed | 100% | β Pass |
# Local SonarQube (Docker)
docker run -d --name sonarqube -p 9000:9000 sonarqube:latest
# Generate token at http://localhost:9000
# Run analysis (all modules from root)
sonar-scanner
# Single Java service
cd <service-directory>
mvn verify sonar:sonar \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.token=$SONAR_TOKEN
# Frontend
cd frontend
npx vitest run --coverage
sonar-scanner
# AI Service
cd ai-service
pytest --cov=. --cov-report=xml
sonar-scannerConfiguration: sonar-project.properties (pre-configured)
| Module | Language | Coverage Report Path |
|---|---|---|
| Frontend | TypeScript | frontend/coverage/lcov.info |
| AI Service | Python | ai-service/coverage.xml |
| API Gateway | Java 17 | api-gateway/target/site/jacoco/jacoco.xml |
| Analytics Service | Java 17 | analytics-service/target/site/jacoco/jacoco.xml |
| Customer Service | Java 17 | customer-service/target/site/jacoco/jacoco.xml |
| Product Service | Java 17 | product-service/target/site/jacoco/jacoco.xml |
| Sales Service | Java 17 | sales-service/target/site/jacoco/jacoco.xml |
| Document Service | Java 17 | document-service/target/site/jacoco/jacoco.xml |
For comprehensive information about CI/CD pipeline fixes, security enhancements, and troubleshooting:
π CI/CD & Security Fixes Documentation
This document includes:
- Complete analysis of issues and solutions
- Technical implementation details
- Verification procedures and checklists
- Troubleshooting guide
- Before/after quality metrics comparison
- Microservices architecture for scalability
- Database indexing on key fields
- Frontend code splitting
- Lazy loading for routes
- Infinite scroll for large datasets
- Optimized SQL queries
This project has been cleaned and organized:
- 51 redundant files removed (documentation, test scripts, logs)
- 5 Python cache directories removed (
__pycache__) - 85% reduction in root directory files
- All scripts organized into
scripts/directory - Documentation consolidated into single README per project
Status: β PRODUCTION READY
Comprehensive code quality analysis completed (April 27, 2026):
- β All critical issues fixed (proper logging, no printStackTrace)
- β Production logging levels configured (INFO/WARN)
- β No security vulnerabilities
- β No SQL injection risks
- β Proper error handling across all services
- β No hardcoded credentials
- β Clean code with no TODO/FIXME markers
See Code Quality section above for detailed analysis.
Root Directory (8 essential files):
- Documentation: README.md, INSTRUCTIONS.txt
- Configuration: package.json, sonar-project.properties
- Demo assets: preview.png, demo.webm
Scripts Directory (8 organized scripts):
- System: start-system.sh, stop-system.sh, check-system.sh
- Database: setup-database.sh
- Demo: run-demo.sh, test-recording.sh, demo-interactive.ts
Service Directories (8 microservices + database):
- Each service has its own README.md
- Clean separation of concerns
- Independent deployment capability
# Clean Python cache
find . -type d -name "__pycache__" -exec rm -rf {} +
# Clean log files
rm -f logs/*.log
# Clean node_modules (if needed)
rm -rf node_modules frontend/node_modules
npm install
# Clean build artifacts
cd api-gateway && mvn clean
cd ../analytics-service && mvn clean
# ... repeat for other services- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
[Your License Here]
- React + TypeScript for frontend
- Spring Boot for microservices
- PyTorch for AI/ML
- Playwright for browser automation
- ffmpeg for screen recording
- MySQL for data persistence
For issues and questions:
- Create an issue in the repository
- Check existing documentation
- Review troubleshooting section
The platform uses a multi-branch deployment strategy:
main (production)
β
staging (pre-production)
β
develop (integration)
β
feature/* (development)
main: Production-ready code, deployed to live environmentstaging: Pre-production testing and validationdevelop: Integration of completed featuresfeature/*: Individual feature development
| Environment | Branch | URL |
|---|---|---|
| Development | develop |
https://dev-businessai.vercel.app |
| Staging | staging |
https://staging-businessai.vercel.app |
| Production | main |
https://businessai.vercel.app |
Backend services follow the same branch strategy with Docker container deployments.
# Create feature branch from develop
git checkout develop
git pull origin develop
git checkout -b feature/my-new-feature
# Make changes and commit
git add .
git commit -m "feat: add new feature"
# Push and create PR
git push origin feature/my-new-feature# Create hotfix from main
git checkout main
git pull origin main
git checkout -b hotfix/critical-issue
# Fix, test, and push
git add .
git commit -m "hotfix: fix critical issue"
git push origin hotfix/critical-issue
# Merge to both main and develop- β Require 2 pull request reviews
- β Require all status checks to pass
- β Require signed commits
- β Require linear history
- β No force pushes
- β No deletions
- β Require 1 pull request review
- β Require all status checks to pass
- β Require linear history
- β No force pushes
- β Require 1 pull request review
- β Require tests to pass
- β Require conversation resolution
All branches must pass:
-
Code Quality
- SonarQube analysis (no blocker/critical issues)
- Security rating: A or B
- Code coverage: β₯ 80%
-
Tests
- Unit tests: 100% passing
- Integration tests: 100% passing
- E2E tests: 100% passing
-
Build
- Frontend build successful
- All Java services build successful
-
Security
- No high/critical vulnerabilities
- Dependency audit passing
# Via Vercel CLI
vercel rollback [deployment-url]
# Or via Vercel Dashboard β Deployments β Promote previous version# Revert to previous commit
git revert HEAD
git push origin mainConfigure per environment:
Development
VITE_API_URL: Development API endpointVITE_ENV:development
Staging
VITE_API_URL: Staging API endpointVITE_ENV:staging
Production
VITE_API_URL: Production API endpointVITE_ENV:production
- GitHub Actions SHA Pinning - Security fix for supply chain protection (32 actions pinned)
- Security Fixes Summary - Complete overview of all security issues fixed (30+ hotspots resolved)
- SonarCloud Fix Details - Detailed SonarCloud configuration and test exclusions
- CI/CD & Security Fixes - Comprehensive guide to CI/CD pipeline configuration, security enhancements, and quality improvements
- Frontend Documentation - React application architecture and development guide
- API Gateway Documentation - Gateway configuration and routing
- AI Service Documentation - AI models, chatbot, and forecasting
- Database Documentation - Schema design and data generation
Status: Portfolio project. Deployment and quality checks depend on the configured environment.
All features implemented, tested, and documented. CI/CD pipeline configured with quality gates. Security vulnerabilities fixed. Ready for deployment and demo recording.
Last Updated: May 3, 2026
