A comprehensive ERP solution for restaurant and hospitality management with advanced POS, inventory control, workforce management, AI-powered features, and intelligent alerting capabilities.
LiteFlow is a full-featured Enterprise Resource Planning (ERP) system specifically designed for the restaurant and hospitality industry. Built with modern Java technologies and enterprise-grade security, LiteFlow streamlines operations across multiple business domains including point-of-sale transactions, kitchen operations, inventory tracking, employee scheduling, procurement management, AI-powered chatbots, and intelligent alert systems.
The system addresses critical pain points in restaurant management by providing:
- Real-time order processing with kitchen integration
- Intelligent inventory tracking with automated stock alerts and AI-powered forecasting
- Workforce management with attendance tracking, scheduling, and payroll calculation
- Secure multi-role access control with 2FA authentication and OAuth2 integration
- Procurement automation with supplier management, purchase orders, and invoice processing
- AI-powered chatbot for intelligent business insights and automation
- Smart alert system with multi-channel notifications (Email, Telegram, Slack, In-App)
- Payment gateway integration with VNPay for secure online payments
- Analytics and reporting with revenue tracking and demand forecasting
Key Concept: Unified platform that integrates front-of-house operations (POS, table management) with back-office functions (inventory, procurement, HR, analytics) and AI-powered features to optimize efficiency and reduce operational costs.
- Language: Java 16
- Framework: Jakarta EE 11 (Servlets, JSP, JSTL 3.0.1)
- ORM: Hibernate 6.4.4 + JPA 3.1.0
- Build Tool: Maven 3.6+
- Application Server: Apache Tomcat 10+
- Primary Database: Microsoft SQL Server
- JDBC Driver: MS SQL Server JDBC 12.6.1
- Caching Layer: Redis (Jedis 5.1.0)
- Password Hashing: BCrypt (jBCrypt 0.4)
- JWT Authentication: JJWT 0.11.5
- Two-Factor Authentication: TOTP (java-otp 0.4.0, totp 1.0)
- OAuth2: Google Sign-In Integration (Google API Client 2.8.0)
- AI Service: OpenAI GPT API (OkHttp 4.12.0)
- Configuration: AI Agent Configuration with dynamic prompts
- Features: Intelligent chatbot, demand forecasting, alert summarization
- Payment Gateway: VNPay integration
- Payment Methods: Cash, Card, Transfer, Wallet, VNPay
- Excel Processing: Apache POI 5.2.5
- Email Service: Jakarta Mail 2.0.1
- JSON Processing: Gson 2.10.1, Jackson Databind 2.17.2
- HTTP Client: OkHttp 4.12.0
- Scheduler: Quartz Scheduler 2.3.2
- Environment Variables: Dotenv Java 3.0.0
- Testing Framework: JUnit 5.10.0
- Mocking: Mockito 5.5.0
- Web Testing: Selenium WebDriver 4.15.0
- Code Coverage: JaCoCo 0.8.10
- In-Memory Database: H2 Database 2.2.224 (for testing)
- Multi-role access control (Admin, Manager, Cashier, Kitchen Staff, Employee)
- Secure login with BCrypt password hashing
- Two-Factor Authentication (2FA) with TOTP
- Google OAuth2 integration
- Password recovery via email OTP
- Session management with JWT tokens
- Audit logging for security tracking
- Real-time table/room management with status tracking
- Interactive menu browsing and order creation
- Multiple invoice management per table
- Split bill and payment processing
- Order history and session tracking
- Kitchen notification integration
- Real-time stock validation
- Discount and promotion management
- Real-time order queue display
- Order status workflow (Pending β Preparing β Ready β Served)
- Multi-station order distribution
- Priority order handling
- Kitchen notification system
- Order modification support
- Product catalog with variants (size, options)
- Stock level tracking with low-stock alerts
- Room/table-based inventory organization
- Dynamic pricing management
- Excel import/export functionality
- Product category management
- Stock movement tracking
- Inventory alerts and notifications
- Employee profile management
- Attendance tracking system
- Schedule management and shift planning
- Payroll calculation (paysheet generation)
- Employee compensation management (Fixed, Hourly, Per-Shift, Hybrid)
- Role-based access assignment
- Employee shift timesheet tracking
- Leave request management
- Forgot clock-in/out requests
- Supplier database management
- Purchase Order (PO) creation and tracking
- Automated PO creation from low-stock items
- Goods receipt recording
- Invoice matching and verification
- Procurement dashboard with analytics
- Supplier SLA tracking
- PO status tracking and alerts
- Intelligent Chatbot: GPT-powered assistant for business insights
- Demand Forecasting: AI-powered sales prediction and inventory planning
- Alert Summarization: GPT-generated alert summaries
- Intelligent Automation: Automated PO creation based on stock levels
- Revenue Analytics: AI-powered revenue analysis and insights
- Stock Alert Intelligence: Smart stock alerts with recommendations
- Multi-Channel Notifications: Email, Telegram, Slack, In-App
- Configurable Alerts: PO pending, low inventory, revenue drop, daily summary
- AI-Enhanced Alerts: GPT-powered alert summarization
- Scheduled Alerts: Cron-based periodic alerts
- Alert History: Comprehensive alert tracking and management
- User Preferences: Customizable alert preferences per user
- Priority Management: Low, Medium, High, Critical priority levels
- VNPay Integration: Secure online payment gateway
- Multiple Payment Methods: Cash, Card, Transfer, Wallet, VNPay
- Payment Transaction Tracking: Comprehensive payment history
- Invoice Generation: Automated invoice creation
- Payment Status Tracking: Pending, Processing, Completed, Failed, Refunded
- Real-time business metrics
- Sales performance tracking
- Inventory status overview
- Employee performance monitoring
- Revenue reports with date range filtering
- Category-based revenue analysis
- Demand forecasting analytics
- Low stock alerts and recommendations
- Internal notice management
- Notice creation and editing
- Notice visibility control
- Notice expiration management
- Employee attendance tracking
- Shift scheduling and assignment
- Personal schedule management
- Leave request processing
- Forgot clock-in/out requests
- Attendance flag recalculation
- Revenue reports with detailed analytics
- Sales invoice management
- Daily, weekly, monthly reports
- Category-based revenue analysis
- Employee performance reports
- Inventory reports
LiteFlow/
βββ src/
β βββ main/
β β βββ java/com/liteflow/
β β β βββ controller/ # Servlets (CashierServlet, ProductServlet, etc.)
β β β β βββ admin/ # Admin controllers
β β β β βββ alert/ # Alert system controllers
β β β β βββ api/ # API endpoints (ChatBot, DemandForecast, AIAgentConfig)
β β β β βββ auth/ # Authentication controllers
β β β β βββ cashier/ # Cashier/POS controllers
β β β β βββ dashboard/ # Dashboard controllers
β β β β βββ employee/ # Employee management controllers
β β β β βββ inventory/ # Inventory controllers
β β β β βββ notice/ # Notice board controllers
β β β β βββ payment/ # Payment controllers
β β β β βββ payroll/ # Payroll controllers
β β β β βββ procurement/ # Procurement controllers
β β β β βββ report/ # Report controllers
β β β β βββ sales/ # Sales controllers
β β β β βββ schedule/ # Schedule controllers
β β β β βββ timesheet/ # Timesheet controllers
β β β βββ dao/ # Data Access Objects
β β β β βββ ai/ # AI configuration DAOs
β β β β βββ alert/ # Alert system DAOs
β β β β βββ analytics/ # Analytics DAOs
β β β β βββ employee/ # Employee DAOs
β β β β βββ inventory/ # Inventory DAOs
β β β β βββ notice/ # Notice DAOs
β β β β βββ payroll/ # Payroll DAOs
β β β β βββ procurement/ # Procurement DAOs
β β β β βββ report/ # Report DAOs
β β β β βββ sales/ # Sales DAOs
β β β β βββ timesheet/ # Timesheet DAOs
β β β βββ model/ # Entity models
β β β β βββ ai/ # AI configuration models
β β β β βββ alert/ # Alert system models
β β β β βββ auth/ # Authentication models
β β β β βββ external/ # External data models
β β β β βββ inventory/ # Inventory models
β β β β βββ notice/ # Notice models
β β β β βββ payroll/ # Payroll models
β β β β βββ procurement/ # Procurement models
β β β β βββ timesheet/ # Timesheet models
β β β βββ service/ # Business logic layer
β β β β βββ ai/ # AI services (GPTService)
β β β β βββ alert/ # Alert services
β β β β βββ analytics/ # Analytics services
β β β β βββ auth/ # Authentication services
β β β β βββ employee/ # Employee services
β β β β βββ inventory/ # Inventory services
β β β β βββ notice/ # Notice services
β β β β βββ payment/ # Payment services
β β β β βββ payroll/ # Payroll services
β β β β βββ procurement/ # Procurement services
β β β β βββ report/ # Report services
β β β β βββ timesheet/ # Timesheet services
β β β βββ filter/ # Authentication & authorization filters
β β β βββ security/ # Security utilities (JWT, TOTP)
β β β βββ util/ # Helper utilities
β β β βββ job/ # Scheduled jobs (Quartz)
β β β βββ listener/ # Event listeners
β β βββ resources/
β β β βββ META-INF/
β β β βββ persistence.xml # JPA configuration
β β βββ webapp/
β β βββ auth/ # Login, signup, OTP pages
β β βββ cart/ # Cashier/POS interface
β β βββ employee/ # Employee management pages
β β βββ inventory/ # Inventory management
β β βββ kitchen/ # Kitchen display system
β β βββ procurement/ # Procurement module
β β βββ reception/ # Reception interface
β β βββ sales/ # Sales invoice pages
β β βββ payment/ # Payment result pages
β β βββ alert/ # Alert dashboard
β β βββ css/ # Stylesheets
β β βββ js/ # JavaScript files
β β βββ img/ # Images and logos
β β βββ uploads/ # Uploaded files
β β βββ includes/ # Header, footer components
β β βββ WEB-INF/
β β βββ web.xml # Servlet configuration
β β βββ beans.xml # CDI configuration
β βββ test/
β βββ java/com/liteflow/ # Unit & integration tests
β β βββ unit/ # Unit tests
β β βββ selenium/ # Selenium E2E tests
β βββ resources/
β βββ META-INF/
β βββ persistence.xml # Test JPA configuration
βββ database/
β βββ liteflow_schema.sql # Main database schema
β βββ liteflow_data.sql # Sample data
β βββ procurement_schema.sql # Procurement schema
β βββ procurement_data.sql # Procurement data
β βββ alert_system_schema.sql # Alert system schema
β βββ alert_system_data.sql # Alert system data
β βββ ai_agent_config_schema.sql # AI agent configuration schema
β βββ ai_agent_config_data.sql # AI agent configuration data
β βββ po_alert_notification_schema.sql # PO alert notification schema
β βββ telegram_.sql # Telegram configuration schema
β βββ telegram_data.sql # Telegram configuration data
βββ target/
β βββ LiteFlow.war # Deployable WAR file
β βββ site/jacoco/ # Code coverage reports
βββ prompts/ # AI-assisted development logs
βββ pom.xml # Maven configuration
βββ README.md # This file
Before running LiteFlow, ensure you have the following installed:
- Java Development Kit (JDK) 16 or higher
- Apache Maven 3.6+
- Microsoft SQL Server 2019 or later (recommended)
- Apache Tomcat 10+ (or compatible Jakarta EE server)
- Redis Server (optional, for caching)
- Git (for cloning the repository)
git clone https://github.com/your-username/LiteFlow.git
cd LiteFlow- Open SQL Server Management Studio (SSMS) or your preferred SQL client
- Execute the schema creation scripts in order:
-- Run main schema
USE master;
GO
CREATE DATABASE LiteFlowDBO;
GO
USE LiteFlowDBO;
GO
-- Run schema files
:r database/liteflow_schema.sql
:r database/procurement_schema.sql
:r database/alert_system_schema.sql
:r database/ai_agent_config_schema.sql
:r database/po_alert_notification_schema.sql
:r database/telegram_.sqlUSE LiteFlowDBO;
GO
-- Load initial data
:r database/liteflow_data.sql
:r database/procurement_data.sql
:r database/alert_system_data.sql
:r database/ai_agent_config_data.sql
:r database/telegram_data.sqlEdit the file: src/main/resources/META-INF/persistence.xml
<property name="jakarta.persistence.jdbc.url"
value="jdbc:sqlserver://localhost:1433;databaseName=LiteFlowDBO;encrypt=true;trustServerCertificate=true;"/>
<property name="jakarta.persistence.jdbc.user" value="YOUR_USERNAME"/>
<property name="jakarta.persistence.jdbc.password" value="YOUR_PASSWORD"/>Note: Replace YOUR_USERNAME and YOUR_PASSWORD with your SQL Server credentials.
Create a .env file in the project root:
# OpenAI API Key (for AI chatbot and features)
OPENAI_API_KEY=your_openai_api_key_here
# VNPay Configuration
VNPAY_TMN_CODE=your_tmn_code
VNPAY_HASH_SECRET=your_hash_secret
VNPAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html
# Telegram Bot Token (for alerts)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_email_password
# Google OAuth2 (already configured in web.xml)
# Google Client ID and Secret are in web.xmlIf using Redis for caching:
- Install and start Redis server on default port
6379 - No additional configuration needed (Jedis client auto-connects to localhost:6379)
# Clean and compile the project
mvn clean install
# Skip tests during build (optional)
mvn clean install -DskipTestsExpected output:
[INFO] BUILD SUCCESS
[INFO] Total time: 45.123 s
The WAR file will be generated at: target/LiteFlow.war
- Copy
target/LiteFlow.warto Tomcat'swebapps/directory - Start Tomcat:
# Windows
catalina.bat start
# Linux/Mac
./catalina.sh startAdd this to your pom.xml (if not already present):
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/LiteFlow</path>
</configuration>
</plugin>Then deploy:
mvn tomcat7:deployOnce Tomcat is running, open your browser and navigate to:
http://localhost:8080/LiteFlow
After loading sample data, use these accounts to test different roles:
| Role | Password | |
|---|---|---|
| Admin | admin@liteflow.com | 1 |
| Manager | manager@liteflow.com | Manager123! |
| Cashier | cashier@liteflow.com | Cashier123! |
| Kitchen | kitchen@liteflow.com | Kitchen123! |
# Run all unit tests
mvn test
# Run Selenium E2E tests
mvn test -Dtest=*SystemTest
# Generate code coverage report
mvn jacoco:report
# View coverage report
open target/site/jacoco/index.htmlExpected Coverage:
- Line Coverage: β₯70%
- Branch Coverage: β₯80%
- Method Coverage: β₯90%
- Navigate to Settings > AI Agent Config
- Configure OpenAI API key and model settings
- Set up custom prompts for different use cases
- Enable/disable AI features
- Navigate to Alert Dashboard
- Create alert configurations for different alert types
- Configure notification channels (Email, Telegram, Slack, In-App)
- Set up scheduled alerts with Cron expressions
- Configure AI-enhanced alert summarization
- Update VNPay credentials in
.envfile - Configure return URL in
VNPayUtil.java - Test payment flow in sandbox mode
- Update to production credentials for live deployment
- Update SMTP settings in
.envfile - Configure email templates in
MailUtil.java - Test email sending functionality
Solution:
- Verify SQL Server is running
- Check credentials in
persistence.xml - Ensure database
LiteFlowDBOexists - Check SQL Server authentication mode (SQL Server Authentication or Windows Authentication)
Solution:
- Change Tomcat port in
conf/server.xml - Or kill the process using port 8080:
# Windows
netstat -ano | findstr :8080
taskkill /PID <PID> /F
# Linux/Mac
lsof -ti:8080 | xargs kill -9Solution:
- Ensure WAR file is properly extracted in
webapps/LiteFlow/directory - Check Tomcat logs for deployment errors
- Verify
web.xmlconfiguration
Solution:
- Check that JWT secret key is properly configured
- Verify session management configuration
- Check token expiration settings
Solution:
- Verify OpenAI API key in
.envfile - Check API key permissions and quota
- Verify network connectivity to OpenAI API
Solution:
- Verify VNPay credentials in
.envfile - Check IP address whitelist in VNPay dashboard
- Verify return URL configuration
- Check hash calculation in
VNPayUtil.java
Solution:
- Verify SMTP credentials in
.envfile - Check SMTP server settings
- Verify email server firewall rules
- Check spam folder for test emails
POST /auth/login- User loginPOST /auth/signup- User registrationPOST /auth/logout- User logoutPOST /auth/send-otp- Send OTP for 2FAPOST /auth/verify-otp- Verify OTPPOST /auth/forgot-password- Request password resetPOST /auth/reset-password- Reset password
GET /api/cashier/tables- Get all tablesGET /api/cashier/menu- Get menu itemsPOST /api/cashier/order- Create orderPUT /api/cashier/order/{orderId}- Update orderPOST /api/cashier/payment- Process payment
GET /products- Get all productsPOST /products- Create productPUT /products/{productId}- Update productDELETE /products/{productId}- Delete productPOST /products/import- Import products from ExcelGET /products/export- Export products to Excel
GET /procurement/po- Get all purchase ordersPOST /procurement/po- Create purchase orderPUT /procurement/po/{poId}- Update purchase orderPOST /procurement/po/auto-create- Auto-create PO from low stockGET /procurement/supplier- Get all suppliersPOST /procurement/supplier- Create supplier
GET /api/payroll/list?month=X&year=Y- Get payroll listPOST /api/payroll/generate- Generate payrollPOST /api/payroll/mark-paid- Mark payroll as paidPOST /api/payroll/recalculate- Recalculate payroll
POST /api/chatbot- Send message to chatbotGET /api/ai-agent-config- Get AI agent configurationPUT /api/ai-agent-config- Update AI agent configuration
GET /alert/dashboard- Get alert dashboardPOST /alert/trigger- Trigger alertGET /alert/history- Get alert historyPUT /alert/preferences- Update alert preferences
- Follow Java naming conventions
- Use meaningful variable and method names
- Add Javadoc comments for public methods
- Keep methods focused and single-purpose
- Use SQL migration scripts in
database/directory - Always backup database before running migrations
- Test migrations on development environment first
- Write unit tests for all service classes
- Write integration tests for API endpoints
- Maintain test coverage above 70%
- Use mocking for external dependencies
- Create feature branches for new features
- Write descriptive commit messages
- Create pull requests for code review
- Merge to main only after approval
- π API Documentation
- π§ͺ Testing Guide
- ποΈ Database Schema
- π Development Logs
- π¨ UI/UX Guidelines
- π Alert System Documentation
- π€ AI Chatbot Documentation
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | October 2025 | Initial release with core ERP modules |
| 0.9.0 | September 2025 | Beta release with procurement module |
| 0.8.0 | August 2025 | Alpha release with POS and inventory |
- User authentication with 2FA
- POS system with table management
- Kitchen display system
- Basic inventory management
- Employee management
- Procurement module
- AI-powered chatbot
- Smart alert system
- Payment gateway integration (VNPay)
- Notice board
- Timesheet management
- Payroll calculation
- Revenue reporting
- Demand forecasting
- Advanced analytics dashboard
- Mobile responsive design
- REST API for mobile app integration
- Multi-language support (English, Vietnamese)
- Cloud deployment (AWS/Azure)
- Mobile application (iOS/Android)
- Advanced reporting with PDF export
- Integration with additional payment gateways
- Customer loyalty program
- Advanced AI features (predictive analytics)
- Real-time analytics dashboard
- WebSocket support for real-time updates
Development Team - FPT University SWP391 Project (Fall 2025)
| Member | Student ID | Role | Responsibilities |
|---|---|---|---|
| [Vu Duc Giang] | DE190556 | Project Lead & Backend Developer | System architecture, authentication, core servlets |
| [Huynh Quang Huy] | SE123457 | Frontend Developer | UI/UX design, JSP pages, CSS styling |
| [Dang Dong Hoa] | SE123458 | Database Administrator | Database design, SQL optimization, data migration |
| [Member 4] | SE123459 | QA Engineer | Testing strategy, unit tests, coverage reports |
| [Member 5] | SE123460 | DevOps & Integration | Deployment, CI/CD, documentation |
Note: This is a university project developed as part of the Software Project (SWP391) course at FPT University.
- Project Repository: GitHub - LiteFlow
- Issues & Bug Reports: GitHub Issues
- Documentation: Wiki
- Email: liteflow.team@fpt.edu.vn
Educational Use Only
This project is developed by students at FPT University as part of the SWP391 - Software Project course. All rights are owned by the development team.
- β Free to use for educational and learning purposes
- β Can be modified and extended for academic projects
- β Not licensed for commercial use without permission
- β Not for redistribution as a standalone product
For commercial licensing inquiries, please contact the development team.
- FPT University - For providing the learning environment and resources
- Instructor Team - For guidance and support throughout the project
- Open Source Community - For the amazing libraries and tools used in this project
- Stack Overflow & GitHub - For countless solutions and inspirations
- OpenAI - For providing GPT API for AI features
- VNPay - For providing payment gateway integration
Made with β€οΈ by the LiteFlow Team
β Star this repository if you find it helpful!
Report Bug Β· Request Feature Β· Documentation
Β© 2025 LiteFlow Development Team - FPT University