BehavioGraph is an advanced, context-aware monolithic web application that analyzes behavioral inputs and real-time environmental metadata to generate dynamic psychological predictions. By unifying an interactive frontend with an autonomous machine learning backend, it provides continuous insight into a user's motivational state.
- Complete user authentication and isolation (Registration, Login, Authorization).
- Users independently build their own database of behavioral history.
- Dual-Model Inference: The system dynamically trains two distinct
RandomForestclassifiers using the Django ORM natively via Pandas.- Personalized Mode: Inference drawn strictly from your individual habits traversing your own history nodes.
- Global Mode: A collective model trained collaboratively on all system users' anonymized entries.
- Asynchronous Training: Submitting a form dispatches a silent background thread to instantly re-train the models on the freshest dataset.
BehavioGraph doesn't just listen to what you say; it listens to your environment:
- Location & Weather: Seamlessly taps your browser's Geolocation API to fetch live weather conditions and temperatures via the Open-Meteo API.
- Device & OS: Automatically extracts and hashes your specific Operating System, Browser engine, and Device dimensions into the analytical pipeline.
- HTMX Driven: All submissions, forms, and results are swapped seamlessly within the DOM. It achieves true Single-Page Application (SPA) speed while operating purely on standard Django backend templates.
- Micro-Interactions: Leverages Alpine.js for handling lightweight UI state, form loading animations, and dynamic metadata toggles.
- Chart.js Visualizations: Review your personalized chronological history through dynamic graphical distributions.
- Glassmorphism Design: A meticulously crafted interface featuring frosted glass panels, smooth hover interactions, and floating ambient orbs.
- Persistent Theme Toggles: A fully implemented Light/Dark mode switch bound seamlessly to your browser's
localStorage.
- Python 3.10+
- Environment packages:
django,scikit-learn,xgboost,pandas,numpy
Clone the repository and initialize your environment:
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows use: .\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Apply Django migrations
python manage.py makemigrations
python manage.py migrate# Start the development server
python manage.py runserverNavigate to http://127.0.0.1:8000, register for a new account, and begin building your behavioral dataset!
prediction-app/
β
βββ app/ # Main Django App
β βββ models.py # Database schemas (UserInput, Auth integration)
β βββ views.py # Core Python logic and HTMX endpoints
β βββ forms.py # Django ModelForms w/ Hidden Alpine metadata vectors
β βββ ml_pipeline.py # The core Pandas/Scikit-Learn async trainer
β βββ ml_models/ # Directory holding real-time serialized .pkl models
β
βββ static/
β βββ style.css # Centralized Glassmorphism and UI definitions
β
βββ templates/
β βββ base.html # Master layout containing Alpine & Nav logic
β βββ index.html # The Prediction engine and Global/Personal ML toggles
β βββ history.html # The Chart.js historical dashboard
β βββ registration/ # Authentication endpoints (login, register)
β
βββ prediction_project/ # Django Core Configuration
This project is open-source and licensed under the MIT License.
Initiated & developed by mbubula6 (2026)