neko-defense-unified-gateway
v1.0.0
Published
πΎ Unified API Gateway for Neko Defense Microservices - Six-personality orchestration system integrating forensic intelligence, worker defense, frame generation, and legal RAG systems
Downloads
28
Maintainers
Readme
πΎβ¨ Neko Defense Unified API Gateway β¨πΎ
Version: 1.0.0 Six-Personality Collaborative API Gateway
π Overview
The Neko Defense Unified API Gateway is a professional NestJS microservice that provides a single entry point for all Neko Defense ecosystem services. Built with RULE 5 compliance (modules for orchestration only, services for external interactions), this gateway integrates four published microservices into a cohesive, unified API.
π― Integrated Microservices
1. π¬ Forensic Intelligence (Port 3002)
- Package:
neko-forensic-intelligence - Purpose: Six-personality collaborative forensic analysis
- Features: ISO compliance, chain of custody, multi-hash verification
2. βοΈ Worker Defense RAG (Port 3004)
- Package:
chilean-worker-defense-rag - Purpose: Chilean worker rights protection via RAG
- Features: Legal precedent search, 9 case types, Spanish localization
3. π¬ Frame Generator (Port 3000)
- Package:
neko-video-frame-generator - Purpose: Educational video frame generation
- Features: RULE 44 compliant frames, kawaii emojis, 11 graphics types
4. π Chilean Law RAG (Port 3001)
- Package:
chilean-law-rag-nestjs - Purpose: Chilean legal code queries
- Features: Vector search, Spanish queries, article citations
π Quick Start
Installation
# Install from NPM
npm install neko-defense-unified-gateway
# Or clone repository
git clone https://github.com/JavierCollipal/neko-defense-unified-gateway.git
cd neko-defense-unified-gateway
npm installConfiguration
Create .env file:
# API Gateway
PORT=3100
NODE_ENV=development
# JWT Authentication
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=24h
# Microservice URLs
FORENSIC_SERVICE_URL=http://localhost:3002
WORKER_DEFENSE_SERVICE_URL=http://localhost:3004
FRAME_GENERATOR_SERVICE_URL=http://localhost:3000
LAW_RAG_SERVICE_URL=http://localhost:3001
# MongoDB (for logging)
MONGODB_URI=mongodb+srv://username:[email protected]/neko-defense-system
# Rate Limiting
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100Start Gateway
# Development
npm run start:dev
# Production
npm run build
npm run start:prodGateway runs on http://localhost:3100 Swagger docs at http://localhost:3100/api
π‘ API Endpoints
Gateway Information
GET /
# Get gateway information and integrated servicesHealth Monitoring
GET /health
# Check gateway health
GET /health/services
# Check all microservices health statusForensic Intelligence
POST /forensic/investigate
# Start comprehensive forensic investigation
GET /forensic/investigate/:id
# Get investigation report by IDWorker Defense RAG
POST /worker-defense/intake
# Submit Chilean worker rights case
GET /worker-defense/cases/:id
# Get case details and analysisFrame Generator
POST /frames/generate
# Generate single educational video frame
POST /frames/generate-batch
# Generate multiple frames in batchChilean Law RAG
GET /legal/query?q=despido%20injustificado
# Query Chilean legal codes
GET /legal/codes
# List available legal codesπ Six-Personality System
Each integrated microservice benefits from six-personality collaborative analysis:
- πΎ NEKO-ARC: Technical architecture & API design
- π MARIO: Workflow orchestration
- π‘οΈ NOEL: Validation & precision testing
- πΈ GLAM: Spanish content & worker advocacy
- π§ HANNIBAL: Forensic analysis
- π§ TETORA: Multi-perspective synthesis
ποΈ Architecture (RULE 5 Compliant)
src/
βββ main.ts # NestJS entry point
βββ app.module.ts # Root module (orchestration)
βββ gateway/
β βββ gateway.module.ts # Gateway module (orchestration ONLY)
β βββ gateway.controller.ts # REST API endpoints
β βββ gateway.service.ts # Service (external interactions)
βββ health/
βββ health.module.ts # Health module (orchestration ONLY)
βββ health.controller.ts # Health endpoints
βββ health.service.ts # Service (external interactions)π Security Features
- β Rate Limiting: Configurable request throttling
- β Input Validation: class-validator for all DTOs
- β CORS: Configurable cross-origin resource sharing
- β JWT Ready: Authentication infrastructure (optional)
- β Error Handling: Graceful error propagation from microservices
π Testing
# Unit tests
npm run test
# Test with coverage
npm run test:cov
# E2E tests
npm run test:e2eπ NPM Publishing
This package is published to NPM following RULE 48:
- Repository: PRIVATE
- NPM Package: PUBLIC
- Install:
npm install neko-defense-unified-gateway
π¦ Dependencies
- @nestjs/common: ^10.0.0
- @nestjs/core: ^10.0.0
- @nestjs/swagger: ^7.0.0
- @nestjs/axios: ^3.0.0
- @nestjs/throttler: ^5.0.0
π― Use Cases
1. Unified API for All Services
Single endpoint for forensic investigations, worker defense cases, frame generation, and legal queries.
2. Health Monitoring
Monitor status of all integrated microservices from one location.
3. Rate Limiting & Security
Centralized rate limiting and security policies for all services.
4. Microservice Orchestration
Coordinate multi-service workflows (e.g., forensic evidence β worker defense case).
π Related Packages
- neko-forensic-intelligence
- chilean-worker-defense-rag
- neko-video-frame-generator
- chilean-law-rag-nestjs
π License
MIT
πΎ Created By
Six-Personality Collaborative System
- πΎ NEKO-ARC - Technical Architecture
- π MARIO - Workflow Orchestration
- π‘οΈ NOEL - Testing & Validation
- πΈ GLAM - Spanish Content & Worker Rights
- π§ HANNIBAL - Forensic Analysis
- π§ TETORA - Multi-Perspective Synthesis
Generated with Claude Code πΎβ¨
Co-Authored-By: Claude [email protected]
