Skip to content

Troy96/cred-sys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cred Sys

A credential issuance and verification system.

Author Information

Architecture Overview

This application consists of:

  • Issuance Service: Node.js/TypeScript API for issuing credentials
  • Verification Service: Node.js/TypeScript API for verifying credentials
  • Database: SQLite for each service (production can use PostgreSQL/MySQL)
  • Container Orchestration: Kubernetes with Docker containers

Design Decisions & Assumptions

Architecture Decisions:

  1. Microservices: Separated issuance and verification for independent scaling.
  2. Database: SQLite for simplicity (easy to migrate to PostgreSQL/MySQL).
  3. State Management: Each service maintains its own data store.
  4. Communication: HTTP REST APIs with JSON payloads.
  5. Container Strategy: One service per container for better isolation.

Key Assumptions:

  1. Credentials are JSON objects with flexible schema.
  2. Worker ID is derived from Kubernetes pod name.
  3. No authentication required.
  4. Simple duplicate detection based on credential hash.
  5. No data synchronization between services required.

Key Technologies:

  • TypeScript: Type safety and better development experience
  • Express.js: Lightweight and familiar Node.js framework
  • SQLite: Zero-configuration, file-based database
  • Docker: Industry standard containerization
  • Kubernetes: Robust orchestration and scaling capabilities

Quick Start

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose
  • kubectl (for K8s deployment)
  • Git

Local Development

# Clone the repository
git clone <repository-url>
cd cred-sys

# Install dependencies and start services
npm run install:all
npm run dev

# Run tests
npm run test:all

# Build Docker images
npm run docker:build

Kubernetes Deployment

# Deploy to Kubernetes cluster
kubectl apply -f k8s/

# Check deployment status
kubectl get pods
kubectl get services

API Endpoints

Issuance Service (Port 3001)

  • POST /api/credentials - Issue a new credential
  • GET /api/health - Health check

Verification Service (Port 3002)

  • POST /api/verify - Verify a credential
  • GET /api/health - Health check

Project Structure

cred-sys/
├── README.md
├── docker-compose.yml
├── backend/
│   ├── issuance-service/    # Credential issuance API
│   ├── verification-service/ # Credential verification API
├── k8s/                     # Kubernetes deployment files
├── scripts/                 # Build and deployment scripts

Testing Strategy

  • Unit tests for all services and components
  • Integration tests for API endpoints - Still needs development
  • Docker container health checks

Monitoring & Logging

  • Health check endpoints for all services
  • Structured logging with Winston

About

Microservices-based credential issuance and verification system in TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published