@tantainnovative/ndpr-toolkit 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/CNAME +1 -0
- package/CONTRIBUTING.md +87 -0
- package/README.md +84 -447
- package/RELEASE-NOTES-v1.0.0.md +140 -0
- package/RELEASE-NOTES-v1.0.1.md +69 -0
- package/SECURITY.md +21 -0
- package/components.json +21 -0
- package/next-env.d.ts +5 -0
- package/package.json +70 -52
- package/public/NDPR TOOLKIT.svg +1 -0
- package/public/favicon/android-chrome-192x192.png +0 -0
- package/public/favicon/android-chrome-512x512.png +0 -0
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/favicon-16x16.png +0 -0
- package/public/favicon/favicon-32x32.png +0 -0
- package/public/favicon/site.webmanifest +1 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/ndpr-toolkit-logo.svg +108 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
- package/dist/components/breach/BreachReportForm.d.ts +0 -66
- package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
- package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
- package/dist/components/consent/ConsentBanner.d.ts +0 -79
- package/dist/components/consent/ConsentManager.d.ts +0 -73
- package/dist/components/consent/ConsentStorage.d.ts +0 -41
- package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
- package/dist/components/dpia/DPIAReport.d.ts +0 -40
- package/dist/components/dpia/StepIndicator.d.ts +0 -64
- package/dist/components/dsr/DSRDashboard.d.ts +0 -58
- package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
- package/dist/components/dsr/DSRTracker.d.ts +0 -56
- package/dist/components/policy/PolicyExporter.d.ts +0 -65
- package/dist/components/policy/PolicyGenerator.d.ts +0 -54
- package/dist/components/policy/PolicyPreview.d.ts +0 -71
- package/dist/hooks/useBreach.d.ts +0 -97
- package/dist/hooks/useConsent.d.ts +0 -63
- package/dist/hooks/useDPIA.d.ts +0 -92
- package/dist/hooks/useDSR.d.ts +0 -72
- package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
- package/dist/index.d.ts +0 -31
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/setupTests.d.ts +0 -2
- package/dist/types/breach.d.ts +0 -239
- package/dist/types/consent.d.ts +0 -95
- package/dist/types/dpia.d.ts +0 -196
- package/dist/types/dsr.d.ts +0 -162
- package/dist/types/privacy.d.ts +0 -204
- package/dist/utils/breach.d.ts +0 -14
- package/dist/utils/consent.d.ts +0 -10
- package/dist/utils/dpia.d.ts +0 -12
- package/dist/utils/dsr.d.ts +0 -11
- package/dist/utils/privacy.d.ts +0 -12
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## 1.0.0 (2025-05-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* initial implementation of NDPR-Toolkit with all key components ([b41aeef](https://github.com/tantainnovative/ndpr-toolkit/commit/b41aeefe3184ce69ed09f3d8c0fdacb860a98427))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* resolve ESLint errors for successful build ([3f78939](https://github.com/tantainnovative/ndpr-toolkit/commit/3f7893902cc7ec67913a7e19f6a804d01e69896e))
|
|
16
|
+
* resolve type errors for successful build ([b827186](https://github.com/tantainnovative/ndpr-toolkit/commit/b8271865a77b097f0ce839ad13555b4bfe12fe2e))
|
package/CNAME
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ndprtoolkit.com.ng
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Contributing to NDPR-Toolkit
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to the Nigerian Data Protection Compliance Toolkit! This document outlines the process for contributing to this project.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and considerate of others.
|
|
8
|
+
|
|
9
|
+
## How to Contribute
|
|
10
|
+
|
|
11
|
+
### Reporting Bugs
|
|
12
|
+
|
|
13
|
+
If you find a bug, please create an issue in the GitHub repository with the following information:
|
|
14
|
+
|
|
15
|
+
1. A clear, descriptive title
|
|
16
|
+
2. Steps to reproduce the bug
|
|
17
|
+
3. Expected behavior
|
|
18
|
+
4. Actual behavior
|
|
19
|
+
5. Screenshots (if applicable)
|
|
20
|
+
6. Environment information (browser, OS, etc.)
|
|
21
|
+
|
|
22
|
+
### Suggesting Features
|
|
23
|
+
|
|
24
|
+
We welcome feature suggestions! Please create an issue with:
|
|
25
|
+
|
|
26
|
+
1. A clear, descriptive title
|
|
27
|
+
2. Detailed description of the proposed feature
|
|
28
|
+
3. Any relevant examples or mockups
|
|
29
|
+
4. Explanation of why this feature would be useful to the project
|
|
30
|
+
|
|
31
|
+
### Pull Requests
|
|
32
|
+
|
|
33
|
+
We follow a standard GitHub workflow:
|
|
34
|
+
|
|
35
|
+
1. Fork the repository
|
|
36
|
+
2. Create a new branch for your feature or bug fix
|
|
37
|
+
3. Make your changes
|
|
38
|
+
4. Write or update tests as needed
|
|
39
|
+
5. Ensure all tests pass
|
|
40
|
+
6. Commit your changes using conventional commit messages
|
|
41
|
+
7. Push to your fork
|
|
42
|
+
8. Submit a pull request
|
|
43
|
+
|
|
44
|
+
### Commit Message Convention
|
|
45
|
+
|
|
46
|
+
We use conventional commits to automate versioning and changelog generation. Please format your commit messages as follows:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
<type>(<scope>): <description>
|
|
50
|
+
|
|
51
|
+
[optional body]
|
|
52
|
+
|
|
53
|
+
[optional footer(s)]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Types include:
|
|
57
|
+
- `feat`: A new feature
|
|
58
|
+
- `fix`: A bug fix
|
|
59
|
+
- `docs`: Documentation changes
|
|
60
|
+
- `style`: Code style changes (formatting, etc.)
|
|
61
|
+
- `refactor`: Code changes that neither fix bugs nor add features
|
|
62
|
+
- `perf`: Performance improvements
|
|
63
|
+
- `test`: Adding or updating tests
|
|
64
|
+
- `chore`: Changes to the build process or auxiliary tools
|
|
65
|
+
|
|
66
|
+
Example:
|
|
67
|
+
```
|
|
68
|
+
feat(consent): add ability to customize consent banner colors
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Development Setup
|
|
72
|
+
|
|
73
|
+
1. Clone your fork of the repository
|
|
74
|
+
2. Install dependencies: `npm install`
|
|
75
|
+
3. Start the development server: `npm run dev`
|
|
76
|
+
4. Make your changes
|
|
77
|
+
5. Run tests: `npm test`
|
|
78
|
+
|
|
79
|
+
## Release Process
|
|
80
|
+
|
|
81
|
+
Releases are managed by the maintainers using semantic versioning. The process is automated through GitHub Actions.
|
|
82
|
+
|
|
83
|
+
## Questions?
|
|
84
|
+
|
|
85
|
+
If you have any questions about contributing, please open an issue with your question.
|
|
86
|
+
|
|
87
|
+
Thank you for contributing to the NDPR-Toolkit!
|
package/README.md
CHANGED
|
@@ -1,467 +1,104 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **RegulatoryReportGenerator**: Create NDPR-compliant breach notification reports
|
|
53
|
-
- **BreachNotificationManager**: Manage the entire breach notification workflow
|
|
54
|
-
|
|
55
|
-
### Enterprise Features
|
|
56
|
-
|
|
57
|
-
- **Advanced Conditional Logic**: Support for complex conditional blocks in policy templates
|
|
58
|
-
- **Professional Formatting**: Enterprise-ready formatting for all exported documents
|
|
59
|
-
- **Comprehensive Type System**: Full TypeScript support with detailed interfaces and type definitions
|
|
60
|
-
- **Modular Architecture**: Use only the components you need with tree-shakable imports
|
|
61
|
-
- **Accessibility**: WCAG 2.1 AA compliant components for inclusive user experiences
|
|
62
|
-
|
|
63
|
-
## Installation
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# Using npm
|
|
67
|
-
npm install @tantainnovative/ndpr-toolkit
|
|
68
|
-
|
|
69
|
-
# Using yarn
|
|
70
|
-
yarn add @tantainnovative/ndpr-toolkit
|
|
71
|
-
|
|
72
|
-
# Using pnpm
|
|
73
|
-
pnpm add @tantainnovative/ndpr-toolkit
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### React 19 Compatibility
|
|
77
|
-
|
|
78
|
-
If you're using React 19 and encounter peer dependency warnings with other packages in your project, you can use the `--legacy-peer-deps` flag:
|
|
1
|
+
# Nigerian Data Protection Compliance Toolkit (NDPR-Toolkit)
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Project Vision
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## Key Components
|
|
10
|
+
|
|
11
|
+
### 1. Consent Management System
|
|
12
|
+
- User-friendly consent banners and modals with customizable styling
|
|
13
|
+
- Granular consent options (necessary, functional, analytics, marketing)
|
|
14
|
+
- Consent storage and retrieval mechanisms
|
|
15
|
+
- Consent change history tracking
|
|
16
|
+
- Time-stamped audit trails
|
|
17
|
+
|
|
18
|
+
### 2. Data Subject Rights Portal
|
|
19
|
+
- Pre-built UI components for handling:
|
|
20
|
+
- Right to access personal data
|
|
21
|
+
- Right to rectification
|
|
22
|
+
- Right to erasure ("right to be forgotten")
|
|
23
|
+
- Right to restrict processing
|
|
24
|
+
- Right to data portability
|
|
25
|
+
- Dashboard for data controllers to manage requests
|
|
26
|
+
- Local storage requestService to track and update requests in demos
|
|
27
|
+
|
|
28
|
+
### 3. Privacy Policy Generator
|
|
29
|
+
- Interactive wizard to create NDPR-compliant privacy policies
|
|
30
|
+
- Template system with customizable sections
|
|
31
|
+
- Auto-update notifications when regulatory requirements change
|
|
32
|
+
- Version history tracking
|
|
33
|
+
|
|
34
|
+
### 4. Data Protection Impact Assessment (DPIA) Tool
|
|
35
|
+
- Questionnaire-based tool to help organizations assess data processing risks
|
|
36
|
+
- Risk scoring matrix
|
|
37
|
+
- Mitigation recommendation engine
|
|
38
|
+
- Exportable reports for compliance documentation
|
|
39
|
+
|
|
40
|
+
### 5. Breach Notification Module
|
|
41
|
+
- Templates for mandatory breach notifications
|
|
42
|
+
- Workflow for documenting breach details
|
|
43
|
+
- Timeline tracking to ensure 72-hour notification compliance
|
|
44
|
+
- Notification delivery to authorities via API (if available)
|
|
45
|
+
### 6. Data Subject Request Service
|
|
46
|
+
- Lightweight requestService storing requests in browser localStorage for demos
|
|
47
|
+
- Helper methods to update request status and retrieve history
|
|
48
|
+
|
|
49
|
+
## Getting Started
|
|
50
|
+
|
|
51
|
+
First, run the development server:
|
|
79
52
|
|
|
80
53
|
```bash
|
|
81
|
-
npm
|
|
54
|
+
npm run dev
|
|
55
|
+
# or
|
|
56
|
+
yarn dev
|
|
57
|
+
# or
|
|
58
|
+
pnpm dev
|
|
59
|
+
# or
|
|
60
|
+
bun dev
|
|
82
61
|
```
|
|
83
62
|
|
|
84
|
-
|
|
63
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
85
64
|
|
|
86
|
-
|
|
87
|
-
legacy-peer-deps=true
|
|
88
|
-
```
|
|
65
|
+
## Deployment
|
|
89
66
|
|
|
90
|
-
|
|
67
|
+
### GitHub Pages
|
|
91
68
|
|
|
92
|
-
|
|
69
|
+
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:
|
|
93
70
|
|
|
94
|
-
|
|
71
|
+
1. The GitHub Actions workflow will build the project
|
|
72
|
+
2. The built files will be deployed to GitHub Pages
|
|
73
|
+
3. Your site will be available at `https://[your-username].github.io/ndpr-toolkit/`
|
|
95
74
|
|
|
96
|
-
|
|
97
|
-
import { ConsentBanner, ConsentManager, ConsentStorage, useConsent } from '@tantainnovative/ndpr-toolkit';
|
|
75
|
+
To manually deploy to GitHub Pages:
|
|
98
76
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
options={[
|
|
103
|
-
{
|
|
104
|
-
id: 'necessary',
|
|
105
|
-
label: 'Necessary Cookies',
|
|
106
|
-
description: 'Essential cookies for the website to function.',
|
|
107
|
-
required: true
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: 'analytics',
|
|
111
|
-
label: 'Analytics Cookies',
|
|
112
|
-
description: 'Cookies that help us understand how you use our website.',
|
|
113
|
-
required: false
|
|
114
|
-
}
|
|
115
|
-
]}
|
|
116
|
-
storageKey="my-app-consent"
|
|
117
|
-
autoLoad={true}
|
|
118
|
-
autoSave={true}
|
|
119
|
-
>
|
|
120
|
-
<AppContent />
|
|
121
|
-
<ConsentBanner
|
|
122
|
-
position="bottom"
|
|
123
|
-
privacyPolicyUrl="/privacy-policy"
|
|
124
|
-
showPreferences={true}
|
|
125
|
-
onSave={(consents) => console.log('Consent saved:', consents)}
|
|
126
|
-
/>
|
|
127
|
-
</ConsentManager>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function AppContent() {
|
|
132
|
-
// Use the useConsent hook to manage consent state
|
|
133
|
-
const { consents, hasConsented, updateConsent } = useConsent();
|
|
134
|
-
|
|
135
|
-
// Check if user has given consent for analytics
|
|
136
|
-
if (hasConsented('analytics')) {
|
|
137
|
-
// Initialize analytics
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div>
|
|
142
|
-
{/* Your app content */}
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Privacy Policy Generator
|
|
149
|
-
|
|
150
|
-
```jsx
|
|
151
|
-
import { PolicyGenerator, PolicyPreview, PolicyExporter, usePrivacyPolicy } from '@tantainnovative/ndpr-toolkit';
|
|
152
|
-
|
|
153
|
-
function PrivacyPolicyPage() {
|
|
154
|
-
const { policy, updateVariableValue, generatePolicy } = usePrivacyPolicy();
|
|
155
|
-
const [generatedPolicy, setGeneratedPolicy] = useState(null);
|
|
156
|
-
|
|
157
|
-
// Define your variables
|
|
158
|
-
const variables = {
|
|
159
|
-
organizationName: 'Acme Corporation',
|
|
160
|
-
websiteUrl: 'https://acme.com',
|
|
161
|
-
contactEmail: 'privacy@acme.com',
|
|
162
|
-
lastUpdated: new Date().toLocaleDateString()
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<div>
|
|
167
|
-
{!generatedPolicy ? (
|
|
168
|
-
<PolicyGenerator
|
|
169
|
-
templates={[
|
|
170
|
-
{
|
|
171
|
-
id: 'standard',
|
|
172
|
-
name: 'Standard Privacy Policy',
|
|
173
|
-
description: 'A comprehensive privacy policy suitable for most websites and applications.',
|
|
174
|
-
sections: [
|
|
175
|
-
{
|
|
176
|
-
id: 'introduction',
|
|
177
|
-
title: 'Introduction',
|
|
178
|
-
template: 'This Privacy Policy explains how {{organizationName}} collects, uses, and protects your personal data when you visit {{websiteUrl}}.',
|
|
179
|
-
required: true,
|
|
180
|
-
included: true
|
|
181
|
-
},
|
|
182
|
-
// More sections...
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
]}
|
|
186
|
-
variables={variables}
|
|
187
|
-
onComplete={(data) => {
|
|
188
|
-
// Generate policy with variables
|
|
189
|
-
const result = generatePolicyText(data.sections, variables);
|
|
190
|
-
setGeneratedPolicy({
|
|
191
|
-
title: `Privacy Policy for ${variables.organizationName}`,
|
|
192
|
-
content: result.fullText,
|
|
193
|
-
lastUpdated: new Date()
|
|
194
|
-
});
|
|
195
|
-
}}
|
|
196
|
-
/>
|
|
197
|
-
) : (
|
|
198
|
-
<>
|
|
199
|
-
<PolicyPreview
|
|
200
|
-
policy={generatedPolicy}
|
|
201
|
-
variables={variables}
|
|
202
|
-
onVariableChange={(newVariables) => {
|
|
203
|
-
// Update variables and regenerate policy
|
|
204
|
-
}}
|
|
205
|
-
/>
|
|
206
|
-
|
|
207
|
-
<PolicyExporter
|
|
208
|
-
policy={generatedPolicy}
|
|
209
|
-
formats={['html', 'pdf', 'markdown']}
|
|
210
|
-
filename="privacy-policy"
|
|
211
|
-
/>
|
|
212
|
-
</>
|
|
213
|
-
)}
|
|
214
|
-
</div>
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Component Categories
|
|
220
|
-
|
|
221
|
-
### Consent Management
|
|
222
|
-
- `ConsentBanner`: Cookie consent banner with customizable options
|
|
223
|
-
- `ConsentManager`: Component for managing consent preferences
|
|
224
|
-
- `ConsentStorage`: Storage mechanism for consent settings with support for localStorage, sessionStorage, and cookies
|
|
225
|
-
- `useConsent`: Hook for managing consent state
|
|
226
|
-
|
|
227
|
-
### Data Subject Rights
|
|
228
|
-
- `DSRRequestForm`: Form for submitting data subject rights requests
|
|
229
|
-
- `DSRDashboard`: Admin dashboard for managing DSR requests
|
|
230
|
-
- `DSRTracker`: Component for tracking the status of DSR requests
|
|
231
|
-
- `useDSR`: Hook for managing DSR state
|
|
232
|
-
- Types: `DSRType`, `DSRStatus`, `DSRRequest` for type-safe implementation
|
|
233
|
-
|
|
234
|
-
### DPIA (Data Protection Impact Assessment)
|
|
235
|
-
- `DPIAQuestionnaire`: Interactive questionnaire for conducting DPIAs
|
|
236
|
-
- `DPIAReport`: Component for generating DPIA reports
|
|
237
|
-
- `StepIndicator`: Progress indicator for multi-step processes
|
|
238
|
-
- `useDPIA`: Hook for managing DPIA state
|
|
239
|
-
- Types: `DPIAQuestion`, `DPIASection`, `DPIARisk`, `DPIAResult` for structured assessments
|
|
240
|
-
|
|
241
|
-
### Breach Notification
|
|
242
|
-
- `BreachReportForm`: Form for reporting data breaches
|
|
243
|
-
- `BreachRiskAssessment`: Tool for assessing breach risk and severity
|
|
244
|
-
- `BreachNotificationManager`: Component for managing breach notifications
|
|
245
|
-
- `RegulatoryReportGenerator`: Tool for generating regulatory reports for NITDA
|
|
246
|
-
- `useBreach`: Hook for managing breach notification state
|
|
247
|
-
- Types: `BreachReport`, `RiskAssessment`, `NotificationRequirement` for compliance with 72-hour notification requirements
|
|
248
|
-
|
|
249
|
-
### Privacy Policy
|
|
250
|
-
- `PolicyGenerator`: Component for generating privacy policies
|
|
251
|
-
- `PolicyPreview`: Preview component for privacy policies
|
|
252
|
-
- `PolicyExporter`: Tool for exporting privacy policies to different formats
|
|
253
|
-
- `generatePolicyText`: Utility for creating dynamic policies with variable support
|
|
254
|
-
- `usePrivacyPolicy`: Hook for managing privacy policy state
|
|
255
|
-
|
|
256
|
-
## Implementation Guides
|
|
257
|
-
|
|
258
|
-
### Setting Up Consent Management
|
|
259
|
-
|
|
260
|
-
```jsx
|
|
261
|
-
// 1. Wrap your application with ConsentManager
|
|
262
|
-
import { ConsentManager } from 'ndpr-toolkit';
|
|
263
|
-
|
|
264
|
-
function App() {
|
|
265
|
-
return (
|
|
266
|
-
<ConsentManager
|
|
267
|
-
options={[
|
|
268
|
-
{ id: 'necessary', label: 'Necessary', description: '...', required: true },
|
|
269
|
-
{ id: 'analytics', label: 'Analytics', description: '...', required: false },
|
|
270
|
-
{ id: 'marketing', label: 'Marketing', description: '...', required: false }
|
|
271
|
-
]}
|
|
272
|
-
storageKey="my-app-consent"
|
|
273
|
-
autoLoad={true}
|
|
274
|
-
autoSave={true}
|
|
275
|
-
>
|
|
276
|
-
<YourApp />
|
|
277
|
-
</ConsentManager>
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// 2. Add the ConsentBanner to your layout
|
|
282
|
-
import { ConsentBanner } from 'ndpr-toolkit';
|
|
283
|
-
|
|
284
|
-
function Layout({ children }) {
|
|
285
|
-
return (
|
|
286
|
-
<>
|
|
287
|
-
{children}
|
|
288
|
-
<ConsentBanner
|
|
289
|
-
position="bottom"
|
|
290
|
-
privacyPolicyUrl="/privacy-policy"
|
|
291
|
-
showPreferences={true}
|
|
292
|
-
/>
|
|
293
|
-
</>
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// 3. Use the consent values in your components
|
|
298
|
-
import { useConsent } from 'ndpr-toolkit';
|
|
299
|
-
|
|
300
|
-
function AnalyticsComponent() {
|
|
301
|
-
const { hasConsented } = useConsent();
|
|
302
|
-
|
|
303
|
-
useEffect(() => {
|
|
304
|
-
if (hasConsented('analytics')) {
|
|
305
|
-
// Initialize analytics
|
|
306
|
-
}
|
|
307
|
-
}, [hasConsented]);
|
|
308
|
-
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Implementing a Data Subject Rights Portal
|
|
314
|
-
|
|
315
|
-
```jsx
|
|
316
|
-
import { DSRRequestForm, DSRTracker, DSRDashboard, useDSR } from '@tantainnovative/ndpr-toolkit';
|
|
317
|
-
|
|
318
|
-
// 1. Create a form for data subjects to submit requests
|
|
319
|
-
function DSRPortal() {
|
|
320
|
-
const { submitRequest } = useDSR();
|
|
321
|
-
|
|
322
|
-
const handleSubmit = (formData) => {
|
|
323
|
-
const request = submitRequest({
|
|
324
|
-
type: formData.type,
|
|
325
|
-
subject: {
|
|
326
|
-
name: formData.name,
|
|
327
|
-
email: formData.email,
|
|
328
|
-
phone: formData.phone
|
|
329
|
-
},
|
|
330
|
-
details: formData.details
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
// Show confirmation with tracking ID
|
|
334
|
-
alert(`Your request has been submitted. Your tracking ID is: ${request.id}`);
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
return (
|
|
338
|
-
<DSRRequestForm
|
|
339
|
-
onSubmit={handleSubmit}
|
|
340
|
-
requestTypes={[
|
|
341
|
-
{ id: 'access', label: 'Access my data' },
|
|
342
|
-
{ id: 'rectification', label: 'Correct my data' },
|
|
343
|
-
{ id: 'erasure', label: 'Delete my data' },
|
|
344
|
-
{ id: 'restriction', label: 'Restrict processing of my data' },
|
|
345
|
-
{ id: 'portability', label: 'Data portability' },
|
|
346
|
-
{ id: 'objection', label: 'Object to processing' }
|
|
347
|
-
]}
|
|
348
|
-
/>
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// 2. Create an admin dashboard for managing requests
|
|
353
|
-
import { DSRDashboard } from '@tantainnovative/ndpr-toolkit';
|
|
354
|
-
|
|
355
|
-
function AdminDashboard() {
|
|
356
|
-
const { requests, updateRequest, deleteRequest } = useDSR();
|
|
357
|
-
|
|
358
|
-
return (
|
|
359
|
-
<DSRDashboard
|
|
360
|
-
requests={requests}
|
|
361
|
-
onUpdateRequest={updateRequest}
|
|
362
|
-
onDeleteRequest={deleteRequest}
|
|
363
|
-
/>
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### Setting Up a Breach Notification System
|
|
369
|
-
|
|
370
|
-
```jsx
|
|
371
|
-
import { BreachReportForm, BreachRiskAssessment, RegulatoryReportGenerator, useBreach } from '@tantainnovative/ndpr-toolkit';
|
|
372
|
-
|
|
373
|
-
// 1. Create a form for reporting breaches
|
|
374
|
-
function BreachReporting() {
|
|
375
|
-
const { submitBreachReport } = useBreach();
|
|
376
|
-
|
|
377
|
-
const handleSubmit = (formData) => {
|
|
378
|
-
const report = submitBreachReport({
|
|
379
|
-
title: formData.title,
|
|
380
|
-
description: formData.description,
|
|
381
|
-
category: formData.category,
|
|
382
|
-
discoveredAt: Date.now(),
|
|
383
|
-
reporter: {
|
|
384
|
-
name: formData.reporterName,
|
|
385
|
-
email: formData.reporterEmail,
|
|
386
|
-
department: formData.department
|
|
387
|
-
},
|
|
388
|
-
affectedSystems: formData.systems,
|
|
389
|
-
dataTypes: formData.dataTypes,
|
|
390
|
-
status: 'ongoing'
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
// Redirect to risk assessment
|
|
394
|
-
navigate(`/breach/${report.id}/assess`);
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
return (
|
|
398
|
-
<BreachReportForm
|
|
399
|
-
onSubmit={handleSubmit}
|
|
400
|
-
categories={[
|
|
401
|
-
{ id: 'unauthorized-access', label: 'Unauthorized Access' },
|
|
402
|
-
{ id: 'data-loss', label: 'Data Loss' },
|
|
403
|
-
{ id: 'system-compromise', label: 'System Compromise' }
|
|
404
|
-
]}
|
|
405
|
-
/>
|
|
406
|
-
);
|
|
407
|
-
}
|
|
77
|
+
```bash
|
|
78
|
+
# Build the project
|
|
79
|
+
npm run build
|
|
408
80
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const { performRiskAssessment, determineNotificationRequirements } = useBreach();
|
|
412
|
-
|
|
413
|
-
const handleAssessment = (assessmentData) => {
|
|
414
|
-
const assessment = performRiskAssessment({
|
|
415
|
-
breachId,
|
|
416
|
-
assessor: {
|
|
417
|
-
name: 'Jane Smith',
|
|
418
|
-
role: 'Data Protection Officer',
|
|
419
|
-
email: 'jane@example.com'
|
|
420
|
-
},
|
|
421
|
-
...assessmentData
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
const requirements = determineNotificationRequirements({
|
|
425
|
-
breachId,
|
|
426
|
-
riskAssessmentId: assessment.id
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
// Show notification requirements
|
|
430
|
-
if (requirements.nitdaNotificationRequired) {
|
|
431
|
-
// Deadline is 72 hours from discovery
|
|
432
|
-
const deadline = new Date(requirements.nitdaNotificationDeadline);
|
|
433
|
-
alert(`NITDA notification required by ${deadline.toLocaleString()}`);
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
return (
|
|
438
|
-
<BreachRiskAssessment
|
|
439
|
-
breachId={breachId}
|
|
440
|
-
onComplete={handleAssessment}
|
|
441
|
-
/>
|
|
442
|
-
);
|
|
443
|
-
}
|
|
81
|
+
# Deploy to GitHub Pages (if you have gh-pages installed)
|
|
82
|
+
npm run deploy
|
|
444
83
|
```
|
|
445
84
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
For detailed documentation, visit [https://ndpr-toolkit.tantainnovative.com/docs](https://ndpr-toolkit.tantainnovative.com/docs)
|
|
85
|
+
#### Configuration
|
|
449
86
|
|
|
450
|
-
|
|
87
|
+
The GitHub Pages deployment is configured in the following files:
|
|
88
|
+
- `next.config.ts` - Contains the Next.js configuration for static export
|
|
89
|
+
- `.github/workflows/deploy.yml` - Contains the GitHub Actions workflow for automated deployment
|
|
451
90
|
|
|
452
|
-
|
|
91
|
+
## Technical Stack
|
|
453
92
|
|
|
454
|
-
-
|
|
455
|
-
-
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
- [Privacy Policy Generator](https://ndpr-toolkit.tantainnovative.com/docs/components/privacy-policy-generator)
|
|
459
|
-
- [React Hooks](https://ndpr-toolkit.tantainnovative.com/docs/components/hooks)
|
|
93
|
+
- Next.js with App Router
|
|
94
|
+
- TypeScript
|
|
95
|
+
- Tailwind CSS
|
|
96
|
+
- React
|
|
460
97
|
|
|
461
|
-
##
|
|
98
|
+
## License
|
|
462
99
|
|
|
463
|
-
|
|
100
|
+
MIT License
|
|
464
101
|
|
|
465
|
-
##
|
|
102
|
+
## Developed by
|
|
466
103
|
|
|
467
|
-
|
|
104
|
+
Tanta Innovative - Positioning as a thought leader in regulatory tech solutions for Nigeria
|