Crime Statistics Analytics Dashboard

Crime statistics dashboard: rates per 100,000, heat map, region comparison, trend forecast with back-test, anomaly alerts, CSV import and export. Python, Flask, NumPy, SQLite, Chart.js.

  • Price: ₹1,999
  • Category: Web App
  • Technology: Python, Flask, NumPy, Bootstrap 5, SQLite, Chart.js
  • Includes: Source code + database
  • Suitable for: BCA / B.Sc CS, MCA / M.Sc CS, B.E / B.Tech CSE & IT

Project overview

This is a full analytics website that runs on a normal PC. There are two roles. The analyst and the admin see the dashboard (recorded crimes of a year, change against the year before, rate per 100,000 people, highest-rate region, most common crime, a stacked chart of crimes by year and type, a doughnut of the types and a bar chart of the top regions), the regions table (cases, rate and change, sortable), the heat map (rate per 100,000 for every region and crime type, darker = higher), the comparison of up to four regions over the years (all types or one type), the trend and forecast page (a straight line through the yearly cases, extended 3 years with a range, and a back-test: the line is fitted without the last two years and its error on them is shown as MAPE), the anomaly page (a year is unusual when it is far from the trend of the earlier years of that region and type) and the records page with filters, paging and CSV export. The admin also adds or changes a number, deletes a record, adds regions and crime types, changes a population, imports a CSV file (new regions and types are created, bad rows are skipped and explained), manages users and reads the audit log. Security: hashed passwords, a lock after 5 wrong passwords, CSRF tokens in every form, role checks on every page, 15-minute idle logout, escaped text. 16 rule tests and 100 web checks are included.

Modules

  1. Login, roles and users: Admin and analyst roles; hashed passwords; lock after 5 wrong passwords; admin adds users, resets passwords, closes and opens logins (the last admin is protected).
  2. Data: Regions with population, crime types, yearly numbers of cases; validation of every field; add, change and delete; CSV import with a row report; CSV export with filters and paging.
  3. Dashboard and regions: Totals, change against the year before, rate per 100,000, top region and crime type; stacked, doughnut and bar charts; regions table with sorting.
  4. Heat map and comparison: Rate for every region and crime type with four colour levels; up to four regions compared over the years.
  5. Trend and forecast: Least-squares trend line, three years ahead with a 95 percent range, back-test on the last two years (MAPE), a clear note that it is a trend and not a prediction of events.
  6. Anomalies: Trend-adjusted score of a year against the earlier years of the same region and type; at least 4 earlier years and 20 cases; sorted by size.
  7. Audit log: Every important action (login, records, import, regions, users) is written to an audit log.

Requirements

  • Python 3.11
  • Internet once, to install the libraries (about 2 minutes)
  • Windows 10 / 11

How to run this project

  1. Install Python 3.11 from python.org and tick "Add python.exe to PATH" during setup.
  2. Extract the zip and open the project folder (STUDENT_GUIDE.md explains every step in simple words).
  3. Double-click `1_INSTALL.bat` once and wait until it says [OK] (about 2 minutes; it downloads the libraries into a private .venv folder).
  4. Double-click `2_RUN.bat` to start the project. Your browser opens http://127.0.0.1:5000 by itself. If it does not start, double-click `CHECK_SETUP.bat` and read what it says.
  5. Log in as admin / admin123 (analyst: analyst1 / demo123).
  6. Show the Heat map and Trend and forecast (Riverton, Cyber crime); open Anomalies for Harborview vehicle theft in 2023. In Records and Data filter and export a CSV; log in as analyst1 to show that an analyst cannot edit.

More Web App projects