Helix Platform Documentation
Welcome to the Helix Platform developer documentation. This documentation covers everything you need to know about building, deploying, and maintaining the Helix microservices platform.
📚 Documentation Structure
🚀 Getting Started
Start here if you're new to the Helix platform.
- Introduction - Platform overview and quick start guide
🏗️ Architecture
Understand the platform's technical architecture.
- Build Architecture - Nx monorepo and build system
- Docker Setup - Container architecture and Docker Compose
- Database & Prisma - 3-tier database architecture and Prisma ORM
💻 Development
Tools, workflows, and guidelines for development.
- Make Commands Reference - Complete Makefile command guide
- Development Guidelines - Do's and don'ts for coding
- Adding API Integrations - How to add external API integrations
- Adding New Services - Step-by-step guide to create new microservices
🚢 Deployment
Production deployment and infrastructure management.
- Deployment Guide - Complete deployment guide with CI/CD
- Terraform Overview - Infrastructure as Code with Terraform
🔧 Microservices
Documentation for each microservice in the platform.
Core Services
- API Gateway - Central entry point for all API requests
- Auth Service - Authentication and authorization via WorkOS
- Tenant Service - Multi-tenant management
AI Services
- KIRA Service - AI assistant powered by OpenAI
- VERA Service - Web research agent powered by Tavily
Supporting Services
- Admin Service - Administrative operations
- File Service - File storage and management
- Template Service - Template for creating new services
- CleverScreen Service - Screen recording and management
📦 Shared Libraries
Reusable code that ALL services use - Don't duplicate generic functionality!
Understanding Shared Libraries
Shared libraries contain generic, reusable code used across all microservices. Before writing ANY generic code, check if it exists here or should be added here.
When to Use Shared Libraries
✅ USE existing shared libraries when:
- You need authentication guards, validators, or middleware
- You need common types, interfaces, or constants
- You need utility functions (retry logic, crypto, date formatting)
- You're implementing pagination, error handling, or logging
- You need database connection management
When to ADD to Shared Libraries
✅ ADD NEW CODE to shared libraries when:
- The functionality is generic and could be used by multiple services
- It's a NestJS component (guard, pipe, decorator, filter, middleware)
- It's a utility function with zero service-specific logic
- It's a common type, interface, or constant used across services
- You find yourself copying code between services
❌ DON'T add to shared libraries when:
- Code is service-specific or domain-specific
- Code depends on service-specific models or business logic
- It's a one-off implementation
- It tightly couples services together
Available Library Categories
- Constants (
@helix/shared/constants) - Error codes, defaults, rate limits - Decorators (
@helix/shared/decorators) -@CurrentUser(),@TenantId()parameter decorators - Guards (
@helix/shared/guards) - JWT auth, roles, scopes, tenant access - Filters (
@helix/shared/filters) - Exception handling (HTTP, Prisma) - Middleware (
@helix/shared/middleware) - Auth, logging, tenant context, rate limiting - Pipes (
@helix/shared/pipes) - Pagination, UUID validation, data transformation - Validators (
@helix/shared/validators) - Zod schemas for validation - Utils (
@helix/shared/utils) - Retry logic, crypto, circuit breakers, date formatting - Types (
@helix/shared/types) - Shared TypeScript types - Interfaces (
@helix/shared/interfaces) - Cross-service interfaces
Creating a New Shared Library
When you need a new category of shared code:
# Generate a new shared library
nx generate @nx/node:library <library-name> --directory=libs/shared/<library-name>
# Example: Creating a new "transformers" library
nx generate @nx/node:library transformers --directory=libs/shared/transformers
After creating:
- Add exports to
libs/shared/<library-name>/src/index.ts - Update
tsconfig.base.jsonpaths if needed (Nx usually handles this) - Import using
@helix/shared/<library-name>in services - Document the library's purpose in a README.md
Golden Rule: If it's generic and reusable, it belongs in /libs/shared/. Use existing libraries first, extend them second, create new ones only when necessary.
🎯 Quick Links
For New Developers
- Read the Introduction
- Set up local environment with Docker Setup
- Learn available Make Commands
- Review Development Guidelines
- Explore the API Gateway as the entry point
For DevOps
- Review Deployment Guide
- Understand Terraform Overview
- Check infrastructure costs in Deployment Guide
For Backend Developers
- Understand Build Architecture
- FIRST: Check Shared Libraries before writing generic code
- Follow Development Guidelines
- Learn how to Add New Services
- Use Database & Prisma for data access
For Integrations
- Read Adding API Integrations
- Understand secret management in Deployment Guide
- Follow security patterns in Development Guidelines
🏗️ Platform Architecture
┌─────────────────────── Helix Platform ───────────────────────┐
│ │
│ ┌────────────────── API Gateway ──────────────────┐ │
│ │ - Request routing │ │
│ │ - Rate limiting │ │
│ │ - Request ID tracking │ │
│ └──────────────---──┬─────────────────────────────┘ │
│ │ │
│ ┌──────────-────────┼─── Microservices ───────────┐ │
│ │ │ │ │
│ │ ┌────────────-───▼────┐ ┌────────────────┐ │ │
│ │ │ Auth Service │ │ Tenant Service │ │ │
│ │ └─────────────────────┘ └────────────────┘ │ │
│ │ │ │
│ │ ┌────────────────┐ ┌────────────────┐ │ │
│ │ │ KIRA (AI) │ │ VERA (Search) │ │ │
│ │ └────────────────┘ └────────────────┘ │ │
│ │ │ │
│ │ ┌────────────────┐ ┌────────────────┐ │ │
│ │ │ File Service │ │ Admin Service │ │ │
│ │ └────────────────┘ └────────────────┘ │ │
│ └──────────────────────────────────────────────---┘ │
│ │
│ ┌─────────────── Data Layer ───────────-───┐ │
│ │ - PostgreSQL (3-tier architecture) │ │
│ │ - Redis (caching & pub/sub) │ │
│ │ - S3 (file storage) │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────--───────────┘
📊 Technology Stack
Backend
- Runtime: Node.js 20+
- Framework: NestJS
- Language: TypeScript (strict mode)
- Database: PostgreSQL 15
- Cache: Redis 7
- ORM: Prisma
Infrastructure
- Container: Docker + Docker Compose
- Orchestration: ECS Fargate
- IaC: Terraform
- CI/CD: GitHub Actions
- Monitoring: CloudWatch
- Secrets: AWS Secrets Manager
Development
- Monorepo: Nx
- Testing: Jest
- Linting: ESLint
- Formatting: Prettier
🎓 Learning Paths
Path 1: Frontend Developer
Goal: Integrate with Helix APIs
- Start: API Gateway - Understand API structure
- Read: Auth Service - Learn authentication
- Review: Development Guidelines - Security patterns
Path 2: Backend Developer
Goal: Build new services and features
- Start: Development Guidelines - Core principles
- Learn: Build Architecture - Nx monorepo
- Practice: Adding New Service - Create service
- Reference: Shared Libraries - ALWAYS check before writing generic code
- Study: Database & Prisma - Data access
Path 3: DevOps Engineer
Goal: Deploy and maintain infrastructure
- Start: Terraform Overview - Infrastructure basics
- Deep Dive: Deployment Guide - Complete deployment
- Learn: Docker Setup - Container architecture
- Practice: Deploy to staging using GitHub Actions
Path 4: Platform Architect
Goal: Understand and evolve the platform
- Read: Build Architecture - System design
- Study: Database & Prisma - Data architecture
- Review: All Services - Service boundaries
- Understand: Shared Libraries - Code organization
- Plan: Adding New Service - Extensibility
🤝 Contributing
When contributing to the platform:
- Follow existing patterns - Check similar services for reference
- Use shared libraries - Don't duplicate generic functionality
- Write tests - Aim for >80% coverage
- Document changes - Update relevant docs
- Follow TypeScript strict mode - No
anytypes - Review Development Guidelines - Essential do's and don'ts
📋 Common Tasks
I want to...
...start developing locally → See Make Commands Reference
...add a new API integration → See Adding API Integrations
...create a new microservice → See Adding New Service
...understand the database structure → See Database & Prisma
...deploy to staging → See Deployment Guide
...use shared code (guards, pipes, etc.) → See Shared Libraries section above
...run tests
→ Run make test or see Make Commands
...troubleshoot Docker issues → See Docker Setup and Make Commands
📞 Support
- Architecture questions: Check Architecture docs
- Development help: See Development Guidelines
- Make commands: See Make Commands Reference
- Deployment issues: See Deployment Guide
- Service-specific: Check individual Service docs
- Shared code: Review Shared Libraries section
Platform Version: v1.0.0-rc
Documentation Status: ✅ Production-Ready
Last Updated: 2025-01-23