Skip to main content

AI User Activity Monitor — open-source Django user activity dashboard by Nitesh Kumar Singh (nkscoder)

Project description

ai-user-activity-monitor

Author: Nitesh Kumar Singh · GitHub: @nkscoder
Repository: github.com/nkscoder/ai-user-activity-monitor

Open-source Django user activity monitor — page views, logins, search terms, time-on-page, and staff dashboards. Built by Nitesh Kumar Singh (nkscoder) as a reusable activity app for any Django project.

AI User Activity Monitor — staff analytics dashboard

Maintainer Nitesh Kumar Singh — nkscoder.in
Repo ai-user-activity-monitor
PyPI pypi.org/project/ai-user-activity-monitor
Django app activity
Version 1.0.4
License MIT

Screenshots

Analytics dashboard

Online users, login frequency, app-section visits, time-on-page charts, and a live activity feed.

Dashboard — charts, online users, live feed

User list & search

Searchable user table with pagination, last activity, login counts, and Excel export.

User list — search, pagination, export

PyPI note: README images use absolute GitHub URLs so they render on pypi.org/project/ai-user-activity-monitor.


Features

  • Automatic page view and POST action logging (middleware)
  • Time on page via client-side beacon (page-time endpoint)
  • Search term capture from common query params (search, q, query, …)
  • Staff dashboard: online users, login frequency charts, app-section visits, live feed
  • User list with search, pagination, Excel export
  • Per-user activity detail and time-by-path breakdown
  • Dynamic section labels from installed Django apps and model verbose_name
  • Uses AUTH_USER_MODEL (no hardcoded user app)

Requirements

Package Version
Python 3.10+
Django 4.2+
openpyxl 3.1+ (Excel export)

Uses Django AUTH_USER_MODEL everywhere. Your user model should support is_staff / is_superuser for dashboard access.


Quick install

From PyPI (recommended)

pip install ai-user-activity-monitor

PyPI: pypi.org/project/ai-user-activity-monitor

From GitHub

pip install git+https://github.com/nkscoder/ai-user-activity-monitor.git

Editable / local development

git clone https://github.com/nkscoder/ai-user-activity-monitor.git
cd ai-user-activity-monitor
pip install -e ".[dev]"

Note: PyPI package name is ai-user-activity-monitor; Django app label is activity.

settings.py

INSTALLED_APPS = [
    # ...
    "activity.apps.ActivityConfig",
]

MIDDLEWARE = [
    # ...
    "activity.middleware.RequestIdMiddleware",
    "activity.middleware.ActivityLogMiddleware",
]

TEMPLATES[0]["OPTIONS"]["context_processors"] += [
    "activity.context_processors.activity_request_id",
    "activity.context_processors.activity_open_source",
]

urls.py

urlpatterns = [
    # ...
    path("user/activity/", include("activity.urls")),
]

Run migrations:

python manage.py makemigrations activity
python manage.py migrate

Configuration (ACTIVITY_*)

Setting Default Description
ACTIVITY_GITHUB_URL https://github.com/nkscoder/ai-user-activity-monitor Open-source repo link
ACTIVITY_HOMEPAGE_URL https://nkscoder.in Author site
ACTIVITY_AUTHOR_NAME Nitesh Kumar Singh Display name
ACTIVITY_AUTHOR_HANDLE nkscoder Handle / brand
ACTIVITY_SEARCH_PLACEHOLDER generic search hint User list search box
ACTIVITY_PATH_LABEL_RULES [] Optional (regex, label) overrides
ACTIVITY_EXCLUDED_APP_LABELS None (auto) App labels hidden from charts
ACTIVITY_EXCLUDED_CHART_SECTIONS () Extra section titles to hide
ACTIVITY_USER_SEARCH_FIELDS None (auto) Char/email fields on user model
ACTIVITY_USER_EXPORT_COLUMNS None (auto) Excel columns
ACTIVITY_USER_LIST_COLUMNS None (auto) User list table columns
ACTIVITY_USER_IDENTIFIER_FIELDS None (auto) Primary identifier fields
ACTIVITY_SESSION_CONTEXT_KEYS () Session keys passed into templates

Section names are resolved automatically, e.g. URL /tickets/… → app verbose_name, /tickets/ticket/… → app + model verbose_name_plural.


URLs

Path Name Description
dashboard/user-activity/ user_activity_dashboard Main analytics dashboard
dashboard/users/ activity_user_list Searchable user list
dashboard/users/<id>/ activity_user_detail Per-user logs
dashboard/users/export-excel/ export_user_list_excel Excel download
page-time/ page_time Duration beacon (POST)
license/ activity_license MIT license page

Publish to PyPI (maintainers)

See PUBLISHING.md for build, TestPyPI, and production upload steps.


About Nitesh Kumar Singh (nkscoder)

Nitesh Kumar Singh develops reusable Django packages under nkscoder. ai-user-activity-monitor is published on GitHub for teams who need user activity analytics without vendor lock-in.


License

Copyright © 2026 Nitesh Kumar Singh (nkscoder).

Released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_user_activity_monitor-1.0.4.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_user_activity_monitor-1.0.4-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file ai_user_activity_monitor-1.0.4.tar.gz.

File metadata

  • Download URL: ai_user_activity_monitor-1.0.4.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ai_user_activity_monitor-1.0.4.tar.gz
Algorithm Hash digest
SHA256 eba7cfdc10da52c6b0bb06693f3669e78851701b692fb35c72ee69fb47d6db0c
MD5 6c3a7d5bf58fca19815a267dcc3d8f5b
BLAKE2b-256 81491f2e6b468024ce2a1091bc93e4a3a81b7022a97387664496c7becd1def2d

See more details on using hashes here.

File details

Details for the file ai_user_activity_monitor-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_user_activity_monitor-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fac214c0b616b07f676a0f0245513793d5501b2b566c3ab46a37bf555f3ae3d1
MD5 b6872269d37e1da6703084f9e673a33d
BLAKE2b-256 384dea5e1cfe9ca06abc742931a500012308a98004351d3d1ea74fb434649ca8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page