Skip to content

Implement Daily Analytics Report Generation #52

@joelabreurojas

Description

@joelabreurojas

Goal

To provide automated, regular insights into application usage by creating a scheduled job that generates a daily analytics report and commits it back to the repository, creating a self-updating dashboard.

To-Do List

  • Create the Analytics Script:
    • In scripts/generate_analytics.py, write a Python script that connects to the production database.
    • The script should query for key daily metrics (e.g., new users, queries asked, most active chat).
    • The script should format these metrics into a clean analytics_report.md Markdown file.
  • Create the GitHub Actions Workflow:
    • In .github/workflows/daily_analytics.yml, create a new workflow.
    • Use the on: schedule: trigger with a cron syntax to run once a day (e.g., '0 1 * * *' for 1 AM UTC).
    • The workflow must check out the code, set up Python, and install dependencies.
    • Securely access the database: Pass the production DATABASE_URL to the script as an environment variable, sourcing it from a GitHub Secret.
    • Add a step to run the python scripts/generate_analytics.py script.
    • Add a final step using the ad-m/github-push-action@v0.6.0 action to automatically commit and push the generated analytics_report.md back to the main branch.

Acceptance Criteria

  • A new analytics_report.md file is automatically generated and committed to the repository every 24 hours.
  • The workflow runs successfully on schedule without exposing any credentials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions