Skip to content

A microservice-based credential issuance and verification system built with Node.js, TypeScript, React, and Kubernetes. This is an assignment submission for Zupple Technologies

Notifications You must be signed in to change notification settings

Muhammedijas981/kube-credential

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Kube Credential

A microservice-based credential issuance and verification system built with Node.js, TypeScript, React, and Kubernetes. This is an assignment submission for Zupple Technologies

πŸš€ Features

  • Credential Issuance Service: Issue digital credentials with unique IDs
  • Credential Verification Service: Verify issued credentials
  • Scalable Architecture: Containerized microservices with Kubernetes
  • Responsive Web Interface: Built with React and Material-UI
  • Worker Tracking: Tracks which worker (pod) handles each request

πŸ“‹ Prerequisites

  • Node.js 18+
  • Docker 20.10+
  • Kubernetes (Minikube or cloud-based)
  • npm or yarn

πŸ—οΈ System Architecture

Components

  1. Frontend

    • React with TypeScript
    • Material-UI components
    • Two main pages: Issuance and Verification
  2. Backend Services

    • Issuance Service: Handles credential creation and storage
    • Verification Service: Validates credential authenticity
    • Database: SQLite for persistence
  3. Infrastructure

    • Containerized with Docker
    • Kubernetes for orchestration
    • Auto-scaling based on load

πŸ› οΈ Installation

1. Clone the Repository

git clone https://github.com/yourusername/kube-credential.git
cd kube-credential

2. Set Up Environment Variables

cp .env.example .env
# Edit .env with your configuration

3. Install Dependencies

# Install backend dependencies
cd services/issuance-service && npm install
cd ../verification-service && npm install

# Install frontend dependencies
cd ../../frontend
npm install

πŸš€ Running Locally

Start Backend Services

# In separate terminals
cd services/issuance-service && npm run dev
cd services/verification-service && npm run dev

Start Frontend

cd frontend
npm run dev

🐳 Docker & Kubernetes Deployment

Build Docker Images

# Build services
docker-compose build

# Or build individually
docker build -t kube-credential-issuance -f services/issuance-service/Dockerfile .
docker build -t kube-credential-verification -f services/verification-service/Dockerfile .
docker build -t kube-credential-frontend -f frontend/Dockerfile .

Deploy to Kubernetes

# Create namespace
kubectl create namespace kube-credential

# Apply configurations
kubectl apply -f k8s/issuance-service/
kubectl apply -f k8s/verification-service/
kubectl apply -f k8s/frontend/
kubectl apply -f k8s/ingress/

# Check deployment status
kubectl get all -n kube-credential

πŸ“š API Documentation

Issuance Service

  • POST /api/issue

    • Description: Issue a new credential

    • Request Body:

      {
        "subject": {
          "name": "string",
          "email": "string"
        },
        "issuer": "string",
        "data": {
          "course": "string",
          "grade": "string"
        }
      }

Verification Service

  • POST /api/verify

    • Description: Verify a credential

    • Request Body:

      {
        "subject": {
          "name": "string"
        },
        "issuer": "string",
        "data": {
          "course": "string",
          "grade": "string"
        }
      }

πŸ§ͺ Testing

Run Unit Tests

# Backend tests
cd services/issuance-service && npm test
cd ../verification-service && npm test

# Frontend tests
cd ../../frontend && npm test

API Testing Examples

# Issue a credential
curl -X POST http://localhost:3001/api/issue \
  -H "Content-Type: application/json" \
  -d '{
    "subject": {"name":"John Doe","email":"[email protected]"},
    "issuer": "Zupple Labs",
    "data": {"course":"Blockchain","grade":"A"}
  }'

# Verify a credential
curl -X POST http://localhost:3002/api/verify \
  -H "Content-Type: application/json" \
  -d '{
    "subject": {"name":"John Doe"},
    "issuer": "Zupple Labs",
    "data": {"course":"Blockchain","grade":"A"}
  }'

πŸ“Š Monitoring

# View logs
kubectl logs -n kube-credential -l app=issuance-service
kubectl logs -n kube-credential -l app=verification-service

# View pod status
kubectl get pods -n kube-credential

# View services
kubectl get svc -n kube-credential

πŸ‘ Acknowledgments

πŸ“ Implementation Notes

Key Features Implemented

  1. Microservices Architecture

    • Separate issuance and verification services
    • Independent scaling of services
    • Clear API boundaries
  2. Worker Tracking

    • Each request is tagged with worker ID
    • Easy debugging and monitoring
    • Load balancing across pods
  3. Frontend

    • Responsive design
    • Form validation
    • Clear user feedback
  4. Deployment

    • Containerized with Docker
    • Kubernetes manifests for production
    • Environment-based configuration

About

A microservice-based credential issuance and verification system built with Node.js, TypeScript, React, and Kubernetes. This is an assignment submission for Zupple Technologies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published