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.

Note: This solution is currently in Public Preview. While we encourage developers to integrate it for sandbox testing and experimentation, please be aware it is not yet production-ready. We highly value your feedback. Please email us with any questions or issues you encounter.

Getting Started

Launch Note

The Big Picture

System Design

Installation Walkthrough

Functional Overview

Managing the Data Lifecycle

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 (or Docker Engine + Docker Compose): 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

Installation Steps (Docker)

Follow these steps to get the TSI Aadhaar Vault Plus solution running on your local machine using Docker Compose:

  1. Clone the Repository:

    git clone https://github.com/tsi-coop/tsi-dpdp-cms.git
    cd tsi-dpdp-cms
  2. 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.

  3. 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

  4. 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 
  5. 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).
  6. 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

Installation Steps (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>>';
    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.wat. Starts the server in 8080

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published