eDiscovery is a compliance platform designed to capture, store, and retrieve WhatsApp instant messenger conversations for businesses. It helps organizations comply with regulations like GDPR and HIPAA by providing secure archival and efficient retrieval of communications.
- Overview
- Architecture
- Prerequisites
- Local Development
- Building and Running
- Deployment
- Workflow
- API Endpoints
- Infrastructure
The eDiscovery platform provides:
- Automatic Message Capture: Seamless integration with WhatsApp using the
whatsmeowlibrary - Secure Data Storage: SQLite database for storing user credentials and WhatsApp device information
- Efficient Retrieval: RESTful API for accessing chats and messages
- QR Code Authentication: Easy device pairing via WhatsApp Web protocol
- User Authentication: JWT-based authentication with HTTP-only cookies
- Kubernetes Deployment: Production-ready deployment on AWS EKS or GCP GKE
The backend is written in Go 1.23 and provides a RESTful API server.
Key Components:
- Main Server (
src/main.go): HTTP server using Gorilla Mux router, runs on port 8080 - Database Layer (
src/database/): SQLite database management for user and device data - Handlers (
src/handlers/):signup.go- User registrationlogin.go- JWT authenticationusers.go- WhatsApp device managementchats.go- Chat list retrievalmessages.go- Message retrieval with paginationqrcode.go- WhatsApp QR code generation
- WhatsApp Integration (
src/meow/): WhatsApp client management usingwhatsmeowlibrary - Models (
src/models/): Data structures for API responses
Technology Stack:
- Go 1.23
- Gorilla Mux (HTTP routing)
- SQLite3 (database)
- JWT for authentication (
golang-jwt/jwt) - WhatsApp Web protocol (
go.mau.fi/whatsmeow)
The frontend is a static web application located in the static/ directory.
Pages:
index.html- Landing pagesignup.html- User registrationlogin.html- User authenticationusers.html- WhatsApp device listchats.html- Chat list for a devicemessages.html- Message view with paginationonboard.html- QR code device pairingdemo.html- Demo/presentation page
Technology Stack:
- HTML/CSS/JavaScript
- Client-side routing and API calls
- Go 1.23+ - For local development
- Docker - For containerization
- Docker Compose - For local stack with ELK
- Terraform 1.3+ - For infrastructure deployment
- kubectl - For Kubernetes interaction
- Helm 3+ - For Kubernetes package management
- AWS CLI - For AWS deployment
- gcloud CLI - For GCP deployment
git clone https://github.com/dkovacevic/ediscovery.git
cd ediscoverygo mod downloadgo run src/main.goThe server will start at http://localhost:8080.
Build the Docker image:
docker buildx build --platform linux/amd64 -t dejankovacevic/ediscovery:0.2.4 .Run the container:
docker run -p 8080:8080 -v $(pwd)/data:/opt/ediscovery/data dejankovacevic/ediscovery:0.2.4The docker-compose.yml includes the application along with ELK stack (Elasticsearch, Kibana, Filebeat) for log aggregation:
docker-compose up -dServices:
- eDiscovery API: http://localhost:8080
- Elasticsearch: http://localhost:9200
- Kibana: http://localhost:5601
# Create data directory for SQLite database
mkdir -p data
# Run the application
go run src/main.goThe project includes Terraform configuration for deploying to AWS EKS (Elastic Kubernetes Service).
Infrastructure Components:
- EKS Cluster - Kubernetes cluster on AWS
- VPC & Networking - Private and public subnets with NAT gateway
- NGINX Ingress Controller - Load balancer and TLS termination
- cert-manager - Let's Encrypt SSL certificate management
- Persistent Storage - EBS volumes for SQLite database
Deployment Steps:
cd terraform
# Initialize Terraform
terraform init
# Review the deployment plan
terraform plan
# Deploy infrastructure sequentially
./bootupThe bootup script executes:
terraform apply -target=module.aws_eks -auto-approve
terraform apply -target=module.ingress_helm -auto-approve
terraform apply -target=module.lh_kubernetes -auto-approve
kubectl get svc -n ingress-nginx
kubectl logs -n cert-manager deploy/cert-managerConfiguration:
Edit terraform/variables.tf to customize:
variable "region" {
default = "us-east-1" # AWS region
}
variable "cluster_name" {
default = "barbara" # EKS cluster name
}
variable "app" {
default = "ediscovery" # Application name
}Teardown:
cd terraform
./teardownThis destroys resources in reverse order:
terraform destroy -target=module.lh_kubernetes -auto-approve
terraform destroy -target=module.ingress_helm -auto-approve
terraform destroy -target=module.aws_eks -auto-approveCI/CD Pipeline:
GitHub Actions automatically builds and pushes images to Amazon ECR on push to main:
- Workflow:
.github/workflows/build.yaml - ECR Repository:
536697232357.dkr.ecr.us-east-1.amazonaws.com/ediscovery:latest
The project also supports GCP deployment via GitHub Actions.
CI/CD Pipeline:
- Workflow:
.github/workflows/build-gcr.yaml - GCR Repository:
gcr.io/bustling-syntax-439308-h6/ediscovery:latest
The workflow:
- Authenticates to GCP using service account
- Builds Docker image
- Pushes to Google Container Registry
Manual Deployment to GKE:
# Authenticate to GCP
gcloud auth login
# Configure kubectl
gcloud container clusters get-credentials <cluster-name> --region <region>
# Apply Kubernetes manifests
kubectl apply -f kube/User → /api/signup → Create Account → /api/login → Receive JWT Token
User → /api/code → Generate QR Code → Scan with WhatsApp → Device Paired
WhatsApp Messages → whatsmeow Client → SQLite Database → API → Frontend
API Flow:
- Get Devices:
GET /api/users- List paired WhatsApp devices - Get Chats:
GET /api/{lhid}/chats- List chats for a device - Get Messages:
GET /api/{lhid}/chats/{chatid}/messages- Retrieve messages
- SQLite Database: Stored in
data/device.db - Persistent Volume: Mounted at
/opt/ediscovery/datain Kubernetes - WhatsApp Sessions: Stored for maintaining device connections
Full API documentation is available in openAPI/openapi.yaml.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/signup |
Create new user account | No |
| POST | /api/login |
Authenticate and receive JWT | No |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/users |
Get all paired WhatsApp devices | Yes |
| GET | /api/code |
Generate QR code for pairing | Yes |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/{lhid}/chats |
Get all chats for a device | Yes |
| GET | /api/{lhid}/chats/{chatid}/messages |
Get messages from a chat (paginated) | Yes |
Authentication: JWT token via HTTP-only cookie (24-hour expiry)
- Deployment: 1 replica, persistent volume mount for database
- Service: NodePort on port 80 → container port 8080
- Ingress: NGINX with Let's Encrypt TLS
- PersistentVolumeClaim: 10Gi for SQLite database
- cert-manager: Automatic SSL certificate management
modules/eks: EKS cluster, VPC, subnets, node groups, EBS CSI drivermodules/helm: NGINX Ingress Controller, cert-managermodules/kubernetes: Deployment, service, ingress, persistent volumes
The docker-compose.yml includes ELK stack for local log aggregation:
- Elasticsearch: Log storage and search
- Kibana: Log visualization
- Filebeat: Log shipping from containers
- OpenAPI Specification:
openAPI/openapi.yaml - Kubernetes Manifests:
kube/directory - Investor Deck:
Deck.md
[License information not specified]
For issues and questions, please open an issue on GitHub.