AI-Powered National Security & Smart Policing Intelligence Platform
Technical Whitepaper β’ System Architecture β’ Documentation β’ Getting Started
The AI-Powered National Security and Smart Policing Intelligence Platform (NSSPIP) is a sovereign intelligence and incident management platform that moves security agencies from reactive response to proactive threat prevention.
NSSPIP fuses:
- Live incident reports
- Smart surveillance and computer vision signals
- Geospatial crime patterns
- OSINT and sentiment indicators
into a single operational picture for commanders, analysts, and dispatchβbacked by forensic-grade audit trails and explainable AI.
Run a full demo locally as a Command Center dashboard:
# Clone the repository
git clone https://github.com/arapgechina24-lgtm/NSSPIP.git
cd NSSPIP
# Install dashboard dependencies
npm install
# (Optional) Set up the Python AI engine
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-local.txt
# Run development server
npm run devVisit http://localhost:3000 to open the NSSPIP Command Center.
For cloud deployment (Vercel) and database provisioning, see DEPLOY_GUIDE.md and DEPLOY_VARS.md.
- Real-time Threat Map: Heatmaps and incident overlays for high-risk zones.
- Multi-Panel Intelligence Views: Incidents, risk analytics, surveillance, and OSINT feeds.
- Operational Filters: Slice by county, incident type, severity, and time window.
- Regional Risk Score (0β100) derived from historical crime geometry and contextual indicators.
- Explainable Factors: Time-of-day, incident density, critical infrastructure proximity, and sentiment.
- Support in the roadmap for scenario simulations (e.g., mock riot progression).
- Integration points for YOLOv8-style object detection on CCTV feeds.
- Detection of abandoned objects, weapons, and anomalous crowd behavior.
- Hooks for automatically surfacing detections into the Command Center.
- Every material AI decision surfaces contributing factors, confidence, and context, reducing βblack-boxβ risk.
- Designed to support court-admissible justification and internal review.
- SHA-256 hashing for incident timelines and key artifacts.
- Forensic IDs that bind together events, analyst actions, and model outputs.
- A foundation for tamper-evident, end-to-end chain-of-custody.
NSSPIP is designed with legal compliance and auditability from day one:
- Aligned with the Kenya Data Protection Act (2019) for handling sensitive, person-linked data.
- Supports audit trails suited for internal affairs, judicial oversight, and external regulators.
- Documentation in:
docs/DATA_STRATEGY.mddocs/TECHNICAL_WHITEPAPER.mddocs/USER_MANUAL.md
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript 5, React 19 |
| Styling | Tailwind CSS 4, Shadcn UI |
| AI Engine | Python 3.9 (FastAPI, scikit-learn, NLTK, CV stack) |
| Database | PostgreSQL + Prisma ORM (geospatial-ready) |
| Auth | NextAuth.js v5 with Prisma adapter |
| CI/CD | GitHub Actions (Node + Python + semantic-release) |
Detailed diagrams and contracts:
docs/SYSTEM_ARCHITECTURE.mddocs/ERD.mddocs/API.md
At a high level, NSSPIP is composed of:
- Perception Layer β incident reports, CCTV feeds, OSINT, and telemetry.
- Cognition Layer β risk scoring, XAI rationale, and alert prioritization.
- Integrity & Response Layer β hashing, audit logs, and operational dispatch.
flowchart TB
subgraph Perception["π Perception Layer"]
Reports["Citizen / Officer Reports"]
CCTV["CCTV & Smart Cameras"]
OSINT["OSINT / News & Social"]
end
subgraph Cognition["π§ Cognition Layer"]
RiskEngine["Predictive Risk Engine"]
CV["Computer Vision Models"]
XAI["XAI Rationale Service"]
end
subgraph Integrity["βοΈ Integrity & Audit"]
Hashing["SHAβ256 Evidence Hashing"]
Audit["Immutable Incident Timeline"]
end
subgraph Response["π¨ Command & Response"]
Dashboard["NSSPIP Command Center"]
Dispatch["Dispatch / Tasking"]
end
Reports --> RiskEngine
CCTV --> CV --> RiskEngine
OSINT --> RiskEngine
RiskEngine --> XAI
RiskEngine --> Dashboard
Dashboard --> Dispatch
RiskEngine --> Hashing --> Audit --> Dashboard
See docs/SYSTEM_ARCHITECTURE.md for full sequence diagrams and data flows.
Disclaimer: NSSPIP is a demonstration and research platform. Any production roll-out requires formal legal, security, and privacy review.
The design is informed by:
- π°πͺ Kenya Computer Misuse and Cybercrimes Act (2018) β incident handling and CII protection.
- π°πͺ Kenya Data Protection Act (2019) β PII handling, retention, and access controls.
- π Common international security frameworks (e.g. NIST-style controls), discussed in the technical whitepaper.
Core environment configuration (see DEPLOY_VARS.md for details and examples):
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string used by Prisma. |
AUTH_SECRET |
Yes | 32-byte secret for NextAuth session encryption. |
NEXTAUTH_URL |
Yes | Public URL of the deployment (e.g. https://nsspip.vercel.app). |
To configure these on Vercel, follow the checklist in DEPLOY_VARS.md.
The detailed roadmap lives in ROADMAP.md. At a glance:
| Phase | Focus Area | Status |
|---|---|---|
| Sprint 1 | Architecture & Data Engineering | In progress / documented |
| Sprint 2 | Core AI Engine (risk, CV, NLP) | Planned / in progress |
| Sprint 3 | Command Center & Integrations | Partially complete |
| Sprint 4 | Testing, Forensics & Demo Prep | Upcoming |
See ROADMAP.md for sprint dates, risks, and milestones.
Contributions that improve security posture, reliability, UX, or AI explainability are welcome.
Before opening a pull request:
- Read
CONTRIBUTING.mdfor branching conventions, commit styles, and PR requirements. - Use synthetic or mock data only; do not upload real operational or personally identifiable data.
- For suspected security issues, follow the private disclosure process in
SECURITY.md.
This project is licensed under the MIT License β see LICENSE for full terms.
By contributing, you agree that your contributions will be licensed under the same MIT license.
βIn national security, time is the only currency. NSSPIP buys time.β