How dhruvsharma-05/cafetrends works
Project type and purpose
• CafeTrends is a data-analytics dashboard application (a single‐page “full-stack” web app) built with Streamlit. Its purpose is to ingest college canteen transaction data, compute RFM metrics, segment customers via K-Means, and deliver interactive visualizations and business insights.
File structure
Root directory
• 07RetailIndustryAnalytics.pdf – research inspiration
• Analysis.ipynb – exploratory analysis notebook
• app.py – main Streamlit application (entry point)
• requirements.txt – Python dependencies
• README.md – project overview, tech stack, instructions
Data folder
• CSV files (monthly/aggregate transactions)
• Stock items.xlsx – catalog of stock codes
Key points
• app.py drives the UI, data loading, processing, clustering, and visualization.
• Python modules (Pandas, Scikit-learn, Plotly) supply data-science and charting capabilities.
• All data is file-based under /Data. No external databases or microservices.
README for additional insights
• Tech stack: Streamlit (UI), Pandas (ETL), Scikit-learn (ML), Plotly (Viz), K-Means (clustering).
• Features: RFM segmentation, 3D interactive plots, lifetime value prediction, revenue stream analysis.
• Deployment: run locally via streamlit run app.py.
a. Main components
1. Client Browser / Streamlit Frontend
2. Streamlit Application Server (app.py)
3. Data Loader & Preprocessor (Pandas)
4. ML Engine (Scikit-learn + K-Means clustering)
5. Visualization Module (Plotly charts)
6. Data Storage (local CSV / XLSX files)
b. Relationships & interactions
– Browser ↔ Streamlit server: user inputs (date ranges, filters) → app.py
– app.py loads raw files from Data/ → passes to Pandas
– Preprocessed data → fed into ML Engine → segmentation results
– app.py consolidates results → Plotly produces interactive figures
– Streamlit serves charts & tables back to Browser
c. Architectural patterns / design principles
– Monolithic, layered design (UI layer, business logic layer, data layer)
– MVC-like separation:
• Model = data files + Pandas DataFrames + cluster labels
• View = Streamlit UI + Plotly outputs
• Controller = app.py coordinating workflow
– Reusability: Analysis.ipynb acts as exploratory sandbox, app.py is production code
d. Technologies / frameworks
– Python 3.8+
– Streamlit (UI framework)
– Pandas (data ETL)
– Scikit-learn (RFM computation, K-Means)
– Plotly (2D/3D interactive visualizations)
Final advice
• Steps—even intermediate ones like RFM feature calculation.