Skip to content

mr-tanta/ndpr-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nigerian Data Protection Compliance Toolkit (NDPR-Toolkit)

npm version License: MIT

An open-source toolkit that helps Nigerian developers implement Nigeria Data Protection Regulation (NDPR) and Data Protection Act (DPA) compliant features in their web applications.

Installation

npm install @tantainnovative/ndpr-toolkit
# or
yarn add @tantainnovative/ndpr-toolkit
# or
pnpm add @tantainnovative/ndpr-toolkit

Project Vision

This toolkit simplifies regulatory compliance for startups and businesses operating in Nigeria by providing ready-to-use components and tools for implementing data protection requirements.

Key Components

1. Consent Management System

New in v1.0.7: Complete flexibility with headless mode, custom UI support, and event-driven architecture.

Features:

  • Flexible Implementation: Use pre-built UI, headless mode, or hybrid approach
  • Full Customization: Override any component or behavior
  • Event-Driven: Subscribe to consent changes with event listeners
  • TypeScript Support: Fully typed with generic support for custom categories
  • Granular Consent: Analytics, marketing, functional, and custom categories
  • Audit Trail: Time-stamped consent history tracking

Quick Start:

import { ConsentManager } from '@tantainnovative/ndpr-toolkit';

// Basic usage with pre-built UI
function App() {
  return (
    <ConsentManager>
      {/* Your app content */}
    </ConsentManager>
  );
}

// Headless mode with custom UI
function HeadlessApp() {
  return (
    <ConsentManager headless>
      <YourCustomBanner />
      <YourCustomSettings />
    </ConsentManager>
  );
}

See full consent management documentation

2. Data Subject Rights Portal

  • Pre-built UI components for handling:
    • Right to access personal data
    • Right to rectification
    • Right to erasure ("right to be forgotten")
    • Right to restrict processing
    • Right to data portability
    • Dashboard for data controllers to manage requests
    • Local storage requestService to track and update requests in demos

3. Privacy Policy Generator

  • Interactive wizard to create NDPR-compliant privacy policies
  • Template system with customizable sections
  • Auto-update notifications when regulatory requirements change
  • Version history tracking

4. Data Protection Impact Assessment (DPIA) Tool

  • Questionnaire-based tool to help organizations assess data processing risks
  • Risk scoring matrix
  • Mitigation recommendation engine
  • Exportable reports for compliance documentation

5. Breach Notification Module

  • Templates for mandatory breach notifications
  • Workflow for documenting breach details
  • Timeline tracking to ensure 72-hour notification compliance
  • Notification delivery to authorities via API (if available)

6. Data Subject Request Service

  • Lightweight requestService storing requests in browser localStorage for demos
  • Helper methods to update request status and retrieve history

Quick Start

Using the Toolkit in Your Project

import { ConsentManager, useConsent } from '@tantainnovative/ndpr-toolkit';

function App() {
  return (
    <ConsentManager onConsentChange={(consent) => console.log('Consent updated:', consent)}>
      <YourApp />
    </ConsentManager>
  );
}

function YourApp() {
  const { consentState, openSettings } = useConsent();
  
  return (
    <div>
      {consentState.analytics && <AnalyticsScript />}
      <button onClick={openSettings}>Manage Cookies</button>
    </div>
  );
}

Development

To contribute or run the demo locally:

# Clone the repository
git clone https://github.com/tantainnovative/ndpr-toolkit.git
cd ndpr-toolkit

# Install dependencies
pnpm install

# Run development server
pnpm dev

Open http://localhost:3000 to see the demo.

Deployment

GitHub Pages

This project is configured to deploy automatically to GitHub Pages using GitHub Actions. When you push changes to the main branch, the following will happen:

  1. The GitHub Actions workflow will build the project
  2. The built files will be deployed to GitHub Pages
  3. Your site will be available at https://[your-username].github.io/ndpr-toolkit/

To manually deploy to GitHub Pages:

# Build the project
npm run build

# Deploy to GitHub Pages (if you have gh-pages installed)
npm run deploy

Configuration

The GitHub Pages deployment is configured in the following files:

  • next.config.ts - Contains the Next.js configuration for static export
  • .github/workflows/deploy.yml - Contains the GitHub Actions workflow for automated deployment

Technical Stack

  • Next.js with App Router
  • TypeScript
  • Tailwind CSS
  • React

Privacy & Analytics

This documentation site uses PostHog, an open-source, privacy-friendly analytics platform, to understand which features are most helpful to users. We collect only aggregated, anonymous data such as:

  • Page views and popular demo pages
  • Feature usage patterns
  • Geographic data (country level only)

What we DON'T collect:

  • Personal identifiable information (PII)
  • Individual user tracking
  • Form inputs or sensitive data
  • Email addresses or contact information

PostHog is configured with person_profiles: 'identified_only', meaning we only create user profiles if you explicitly identify yourself. By default, all analytics are anonymous and aggregated.

You can opt-out of analytics by:

  1. Using browser extensions that block analytics
  2. Enabling "Do Not Track" in your browser
  3. Disabling JavaScript for this site

License

MIT License

Author

Abraham Esandayinze Tanta

Senior Software Engineer with over a decade of experience in ethical hacking, software development, Linux and network administration. Based in Lagos, Nigeria.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Support

If you find this toolkit helpful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting bugs and issues
  • 💡 Suggesting new features
  • 🤝 Contributing to the codebase

About

An open-source toolkit that helps Nigerian developers implement NDPR and DPA compliant features in their web applications.

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages