Skip to content

tsi-coop/tsi-dpdp-cms

Repository files navigation

TSI DPDP Consent Management System

An open-source consent management system compliant with India's DPDP Act, 2023.

Introduction

Launch Note

The Big Picture - Video

System Design

Functional Overview - Video

Managing the Data Lifecycle

Consent Enforcement Service - Video

DPO Console - Video

Solving Consent Fatigue via Portable Consent Artifacts (PCA) - A Proposal

DPDP Wallet Demonstration - Video

Verifiable Parent Consent - Video

Standardized Erasure Interface for DPDP Consent Managers - A Proposal

Securing Court-Ready Evidence under BSA Section 62

DPDP Inclusion: Interactive Voice Consent using Sarvam AI

Installation

Docker

  1. Clone the repository to a separate folder
    git clone https://github.com/tsi-coop/tsi-dpdp-cms.git tsi-dpdp-cms-eval
  2. Start the TSI DPDP CMS service
    cd tsi-dpdp-cms-eval
    sudo docker compose up -d

Binary

Check out v0.3 release

Post-Installation Steps

The system includes a pre-configured interactive tour designed for evaluators and administrators.

Access the Tour: Open your browser and navigate to: http://localhost:8080/tour

Follow the Guided Journey:

  1. System Setup: Initialize your environment and configure master admin credentials.

  2. Org Configuration: Onboard your Fiduciaries, link Apps, and publish Multilingual Data Policies.

  3. Consent Collector: Experience the notice and capture workflow from a Data Principal's perspective.

  4. Consent Verifier: Test real-time API validation used by Data Processors to ensure purpose-limited processing.

  5. User Dashboard: Exercise principal rights: view consent artifacts, withdraw permissions, and submit grievances.

  6. Enforcement Logic: View the visual logic for technical data deletion, retention periods, and audit trail integrity.

  7. DPO Console Tour: Comprehensive video walkthrough of the administrative console for managing compliance workflows.

  8. System Integration: API specifications for Data Fiduciaries and Processors to integrate CMS logic into backend technical stacks.

  9. Verifiable Parental Consent: Experience the Section 9 workflow: verifiable parental consent with OTP-based guardian identification for learners under 18.

  10. DPDP Wallet Demo: Experience portable privacy. Checkout the DPDP Wallet concept, then download your PCA from the User Dashboard to manage your processing rights independently.

  11. Password Recovery: Explore the "break-glass" account recovery mechanism using secure Master Recovery Keys.

  12. Legal Module: Explore the crystallization of immutable audit trails into cryptographically signed, BSA Section 62-compliant digital evidence artifacts for court and regulatory submission.

  13. Voice Consent Gateway: Experience hands-free, granular consent collection using Sarvam AI (TTS/STT) to obtain informed voice affirmations for processing purposes.

Developers

Prerequisites

Before you begin, ensure you have the following software installed on your development machine or server:

  • Java Development Kit (JDK) 17 or higher: Required to build and run the Java application.

    • Installation Steps:
      • Linux (Ubuntu/Debian):
        sudo apt update
        sudo apt install openjdk-17-jdk
      • Windows: Download the JDK 17 installer from Oracle (requires account) or Adoptium (Eclipse Temurin, recommended open-source distribution) and follow the installation wizard. Ensure JAVA_HOME environment variable is set and %JAVA_HOME%\bin is in your system's Path.
    • Verification:
      java -version
      javac -version
  • Apache Maven 3.6.0 or higher: Project build automation tool.

    • Installation Steps:
      • Linux (Ubuntu/Debian):
        sudo apt install maven
      • Windows: Download the Maven binary zip from the Apache Maven website, extract it, and add the bin directory to your system's Path environment variable.
    • Verification:
      mvn -v
  • Docker Desktop (For Docker based development): Essential for containerizing and running the application and database locally.

    • Installation Steps:
      • Windows: Download and install Docker Desktop from the official Docker website.
      • Linux: Follow the official Docker Engine installation guide for your specific distribution (e.g., Docker Docs). Install Docker Compose separately if using Docker Engine.
    • Configuration & Verification (Windows Specific):
      • Ensure WSL 2 is enabled and configured. Open PowerShell as Administrator and run wsl --install or wsl --update.
      • Verify virtualization (Intel VT-x / AMD-V) is enabled in your computer's BIOS/UEFI settings.
      • Start Docker Desktop and wait for the whale icon in the system tray to turn solid.
    • Verification:
      docker --version
      docker compose version # Or docker compose --version for older installations
  • Git: For cloning the repository.

    • Installation Steps:
      • Linux (Ubuntu/Debian):
        sudo apt install git
      • Windows: Download the Git for Windows installer from git-scm.com and follow the installation wizard.
    • Verification:
      git --version
  • Jetty (For Non Docker Development):Navigate to the Eclipse Jetty Downloads page.

    • Download the Jetty 11 (Standard) distribution (e.g., jetty-home-11.x.x.tar.gz or .zip).

    • Extract the archive to a permanent directory:

      Linux/macOS: /opt/jetty-home

      Windows: C:\jetty-home

Build

Using Docker

Follow these steps to get the TSI DPDP CMS solution running on your local machine using Docker Compose:

  1. Change Docker to Dev mode:

    To build from local source, uncomment the block below in docker-compose.yml

    build:
      context: .
      dockerfile: Dockerfile
  2. Clone the Repository:

    git clone https://github.com/tsi-coop/tsi-dpdp-cms.git
    cd tsi-dpdp-cms
  3. Create .env File: This file stores sensitive configurations (passwords, API keys, etc.) and is NOT committed to Git.

    cp .example .env

    Now, edit the newly created .env file and fill in the placeholder values.

  4. Build the Java WAR File: Navigate to the project root and build your Java application.

    mvn clean package

    This will create target/tsi_dpdp_cms.war

  5. Initialize PostgreSQL Database Schema: The postgres Docker image only runs initialization scripts on its first startup when the data directory is empty. To ensure your schema is loaded:

    docker compose down -v 
  6. Build and Start Docker Services: This command will build your application's Docker image and start both the PostgreSQL database and the Jetty application.

    docker compose up --build -d
    • --build: Ensures Docker images are rebuilt, picking up any changes in your Java code or Dockerfile.
    • -d: Runs the containers in detached mode (in the background).
  7. Verify Services and Check Logs:

    • Check if containers are running: docker ps
    • Monitor PostgreSQL logs for schema initialization: docker compose logs -f postgres_db
    • Monitor Jetty application logs for successful deployment: docker compose logs -f jetty_app

Using Scripts (without docker)

These steps describe how to install and run the TSI DPDP CMS solution directly on a Linux/Windows server without using Docker.

  1. Clone the Repository:

    git clone https://github.com/tsi-coop/tsi-dpdp-cms.git
    cd tsi-dpdp-cms
  2. PostgreSQL Database Setup:

    • Log in as the PostgreSQL superuser (e.g., postgres user on Linux).
    sudo -i -u postgres psql
    • Create the database and user:
    CREATE DATABASE <<your-db-name-here>>;
    CREATE USER <<your-db-user-here>> WITH ENCRYPTED PASSWORD '<<your_db_password_here>>';
    • Connect to the new database and grant permissions: (Note: These steps are required for PostgreSQL 15+ compatibility)
    \c <<your-db-name-here>>
    ALTER SCHEMA public OWNER TO <<your-db-user-here>>;
    GRANT ALL PRIVILEGES ON SCHEMA public TO <<your-db-user-here>>;
    GRANT ALL PRIVILEGES ON DATABASE <<your-db-name-here>> TO <<your-db-user-here>>;
    • Exit the postgres user: exit
    • Initialize Schema: Execute the db/init.sql script to create the necessary tables.
    psql -U <<your-db-user-here>> -d <<your-db-name-here>> -h localhost -f /path/to/tsi-dpdp-cms/db/init.sql
  3. Build WAR:

    cd /path/to/tsi-dpdp-cms
    mvn clean package

    This will generate target/tsi-dpdp-cms.war.

  4. Deploy Solution (linux):

    cd /path/to/tsi-dpdp-cms/server
    cp .example .env

    Now, edit the newly created .env file and fill in the placeholder values.

    ./set-base.sh #Sets the jetty base directory
    ./serve.sh # Copies the target/tsi-dpdp-cms.war to $JETTY_BASE/webapps/ROOT.war. Starts the server in 8080
  5. Deploy Solution (windows):

    cd /path/to/tsi-dpdp-cms/server
    copy .example .env

    Now, edit the newly created .env file and fill in the placeholder values.

    set-base.bat #Sets the jetty base directory
    serve.bat # Copies the target/tsi_dpdp_cms.war to %JETTY_BASE%/webapps/ROOT.war. Starts the server in 8080
  6. Validation Step: To confirm server status.

    curl -I http://localhost:8080

License

TSI DPDP CMS is licensed under the Apache 2.0 license

About

An open-source consent management system compliant with India's DPDP Act, 2023

Topics

Resources

License

Stars

Watchers

Forks

Packages