The filter was using fail-open logic (skipping the date check when
msg.Timestamp was falsy), so messages missing a Timestamp bypassed
the filter entirely. Per-User Report aggregates all filtered messages,
making the bug visible as all-time totals regardless of selected range.
Changed both the message and conversation date filter blocks to
fail-closed: when a date range is active, records without a parseable
timestamp are excluded. Also added a backend warning log to surface
any enriched messages that still lack a Timestamp after the
StartTime fallback (commit
|
||
|---|---|---|
| backend | ||
| frontend | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| deploy.sh | ||
| email_analysis.py | ||
| README.md | ||
| run.sh | ||
| test_user_mapping.js | ||
| USER_FILTERING_NOTES.md | ||
Oliver Agency Reporting Module
A web-based reporting module to display usage analytics for conversations and messages with various filtering options and CSV export functionality.
Project Structure
/backend: Python Flask backend API/frontend: React + Vite frontend application
Environment Setup
Before running the application, you need to configure environment variables:
-
Copy the example environment file:
cp .env.example .env -
Edit
.envwith your configuration:- DOMAIN: Your deployment domain (e.g.,
yourdomain.com) - BASE_PATH: Application base path (default:
/dashboard/) - AZURE_TENANT_ID: Azure AD tenant identifier
- AZURE_CLIENT_ID: Azure AD application (client) identifier
- BACKEND_PORT: Backend server port (default:
5001) - MAKE_WEBHOOK_URL: Make.com webhook endpoint
- VITE_* variables: Duplicate the above values with
VITE_prefix for frontend
- DOMAIN: Your deployment domain (e.g.,
-
Azure AD Setup:
- Create an app registration in Azure Portal
- Add redirect URIs for your deployment domain
- Copy the Tenant ID and Client ID to your
.envfile
Getting Started
Quick Start (Recommended)
Run both backend and frontend together:
./run.sh
This script automatically loads environment variables from .env and starts both servers.
Backend
-
Navigate to the backend directory:
cd backend -
Activate the virtual environment:
source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Load environment variables and start the development server:
# Load environment variables set -a && source ../.env && set +a # Start server python app.py
The API will be available at http://localhost:{BACKEND_PORT} (default: 5001).
Frontend
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install -
Start the development server:
npm run dev
The application will be available at http://localhost:5173.
Features
- Dashboard displaying conversation and message volume over time
- Filter data by user, assistant, brand/TOV, and date range
- Export filtered data to CSV
- Interactive graph with assistant-specific coloring
API Endpoints
GET /api/data: Returns all conversations and messages data