A multi-page web dashboard that turns Sales.xlsx and Prices.xlsx into plain-English business recommendations. Built by the Society for AI in Enterprise Systems (SAIES) at California State University, Los Angeles.
Live demo: https://saies-sales-ai-dashboard.onrender.com/
- Overview — KPI summary, recommended product focus, and sales trend chart
- Product Insights — Per-product status (Healthy, Growth Opportunity, Needs Attention) with filters and search
- Forecast — Next-month revenue, profit, and unit predictions based on historical sales
- Price Impact — Slider-based simulator for testing price change scenarios
- Ask Sales AI — Plain-English Q&A grounded in the uploaded data, powered by Gemini with a Groq fallback
- Carbon Impact — CO2e emissions breakdown by type, scope, carrier, and time period
- Data Upload — Upload your own Sales, Prices, and Carbon Emissions files; preview the cleaned and matched data. The app auto-detects the data format and currency.
The live dashboard reads from saies_warehouse.db, a SQLite warehouse rebuilt by:
python etl_star_schema.pyThe ETL builds a star schema with explicit primary keys, foreign keys, and indexes on every fact-table foreign key. dim_date includes BI-friendly calendar attributes such as year, quarter, month name, week number, day of week, weekend flags, and period-end flags. Carbon emissions are loaded from Carbon Emissions.xlsx into fact_carbon during the same build, with emission type and scope normalized into dimensions.
SQLite is used for the local and Render demo because it ships as a single file with the app. MySQL design artifacts remain in mysql/ for the advisor-facing ERD/schema package; use mysql/saies_warehouse_schema.sql if the deployment needs to be moved to a MySQL server.
Advisor-facing warehouse documentation:
docs/warehouse_erd.mddocs/data_dictionary.mddocs/validation_report.mdmysql/saies_warehouse_schema.sqlmysql/saies_warehouse_model.mwbmysql/saies_warehouse_erd_all_diagrams.pdf
Optional MySQL load path:
pip install -r requirements-mysql.txt
python etl_star_schema.py
python scripts/load_mysql_warehouse.py --user root --password your_mysql_passwordThe MySQL loader recreates the saies_warehouse schema from mysql/saies_warehouse_schema.sql, copies the rows from saies_warehouse.db, and prints validation totals. The website still uses SQLite unless you intentionally change the runtime configuration.
- Python 3.9 or later
- The following packages:
pip install pandas openpyxl requests
- Clone the repository:
git clone https://github.com/bta5-csula/saies-control-tower.git
cd saies-control-tower- Create a
.envfile in the project root with your API keys:
GEMINI_API_KEY=your_gemini_key_here
GROQ_API_KEY=your_groq_key_here
The app works without API keys — keyword-based answers will still run. The AI chat falls back to Groq if Gemini is unavailable, and to keyword answers if neither key is set.
- Run the server:
python server.pyThen open http://127.0.0.1:8000 in your browser.
The app auto-detects the uploaded file format. Two schemas are supported out of the box:
| File | ERPSim format | LAX / general format |
|---|---|---|
| Sales | MATERIAL_NUMBER, SIM_CALENDAR_DATE, QUANTITY, NET_VALUE, COST | Date, Material/Product, Quantity, Revenue, Cost |
| Prices | MATERIAL_NUMBER, SIM_CALENDAR_DATE, PRICE | Date, Material/Product, Price_USD_per_kg, Distribution_Channel |
| Carbon (optional) | TYPE, SUBTYPE, SCOPE, TOTAL_CO2E_EMISSIONS | Scope_1/2/3_CO2e_kg columns per row |
The app ships with default sample data. Use the Data Upload page to replace it with your own files for the current session. Additional sample datasets are in sample_data/ for testing.
The app is designed to run on Render as a Python web service:
- Build command:
pip install pandas openpyxl requests - Start command:
python server.py - Environment variables: Set
GEMINI_API_KEYandGROQ_API_KEYin the Render dashboard
Render injects a PORT environment variable automatically; the server reads it on startup.