Skip to content

GroWAppAI/workflow-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GetApp Workflows API

CI/CD Pipeline Docker Image TypeScript NestJS License: MIT

πŸš€ Enterprise Workflow Management API & CLI

A comprehensive, production-ready workflow management system built with NestJS, featuring policy-driven automation, multi-platform Docker support, and enterprise-grade security.

✨ Key Features

  • πŸ” Enterprise Authentication - Keycloak SSO integration with JWT tokens
  • πŸ“‹ Policy-Driven Workflows - Role-based access control and approval workflows
  • πŸ”— n8n Integration - Seamless workflow automation with n8n
  • 🐳 Multi-Platform Docker - AMD64 & ARM64 support with health checks
  • πŸ›‘οΈ Security First - Comprehensive security scanning and audit logs
  • πŸ“Š Real-time Monitoring - Built-in health checks and performance metrics
  • πŸ”„ CI/CD Ready - Complete GitHub Actions pipeline with automated testing

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   API Gateway   β”‚    β”‚   n8n Engine    β”‚
β”‚   (React/Vue)   │◄──►│   (NestJS)      │◄──►│   (Automation)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   PostgreSQL    β”‚    β”‚   Redis Cache   β”‚    β”‚   Audit Logs    β”‚
β”‚   (Database)    β”‚    β”‚   (Session)     β”‚    β”‚   (Security)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose
  • PostgreSQL 15+
  • n8n instance

Local Development

# Clone the repository
git clone https://github.com/GroWAppAI/workflow-api.git
cd workflow-api

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Run the application
npm run start:dev

# Access the API
curl http://localhost:3000/health

Docker Deployment

# Build and run with Docker Compose
docker-compose up -d

# Or build manually
docker build -t workflow-api .
docker run -p 3000:3000 workflow-api

πŸ“š API Documentation

Health Check

GET /health
# Returns application health status

Authentication

GET /api/auth/keycloak/login
# Initiate Keycloak SSO login

GET /api/auth/keycloak/callback
# Handle OAuth callback

Workflow Management

POST /api/workflow/create
# Create new workflow

GET /api/workflow/list
# List all workflows

POST /api/workflow/run
# Execute workflow

Policy Management

POST /api/policy/create
# Create approval policy

GET /api/policy/list
# List policies

POST /api/policy/approve
# Approve workflow

πŸ”§ Configuration

Environment Variables

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/workflows
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=workflows

# Authentication
JWT_SECRET=your-jwt-secret
SESSION_SECRET=your-session-secret

# n8n Integration
N8N_URL=https://n8n.your-domain.com
N8N_API_KEY=your-n8n-api-key

# Security
NODE_ENV=production
LOG_LEVEL=info

πŸ§ͺ Testing

# Run all tests
npm run test:all

# Unit tests only
npm run test:unit

# Integration tests
npm run test:integration

# E2E tests
npm run test:e2e

# With coverage
npm run test:coverage

🐳 Docker Images

Available Images

  • Latest: ghcr.io/growappai/workflow-api:latest
  • Main Branch: ghcr.io/growappai/workflow-api:main
  • Version Tags: ghcr.io/growappai/workflow-api:v1.0.0

Multi-Platform Support

  • AMD64 (x86_64) - Intel/AMD processors
  • ARM64 (aarch64) - Apple Silicon, ARM servers

Pull and Run

# Pull the latest image
docker pull ghcr.io/growappai/workflow-api:latest

# Run with environment variables
docker run -d \
  -p 3000:3000 \
  -e DATABASE_URL=postgresql://user:pass@host:5432/db \
  -e JWT_SECRET=your-secret \
  ghcr.io/growappai/workflow-api:latest

πŸ”’ Security Features

Built-in Security

  • πŸ” JWT Authentication - Secure token-based auth
  • πŸ›‘οΈ SSO Integration - Keycloak enterprise authentication
  • πŸ“ Audit Logging - Complete activity tracking
  • πŸ” Security Scanning - Automated vulnerability detection
  • πŸ”„ Rate Limiting - API protection against abuse
  • πŸ”’ CORS Protection - Cross-origin request security

Security Scanning

# Run security audit
npm audit

# Run Snyk security scan
npx snyk test

# Check for vulnerabilities
npm audit --audit-level moderate

πŸ“Š Monitoring & Health

Health Endpoints

# Application health
GET /health

# Database health
GET /api/health/db

# n8n connectivity
GET /api/health/n8n

# System metrics
GET /api/health/metrics

Metrics & Logging

  • Structured Logging - JSON format with correlation IDs
  • Performance Metrics - Response times, throughput
  • Error Tracking - Comprehensive error reporting
  • Health Checks - Automated system monitoring

πŸš€ CI/CD Pipeline

Automated Workflows

Our GitHub Actions pipeline includes:

  1. πŸ” Code Quality - TypeScript, ESLint, security scans
  2. πŸ§ͺ Testing - Unit, integration, and E2E tests
  3. πŸ—οΈ Building - Multi-platform Docker images
  4. πŸ”’ Security - Automated vulnerability scanning
  5. πŸ“¦ Deployment - Container registry publishing

Pipeline Status

CI/CD Pipeline

πŸ› οΈ Development

Project Structure

src/
β”œβ”€β”€ auth/                 # Authentication & authorization
β”œβ”€β”€ workflow/            # Core workflow management
β”œβ”€β”€ common/              # Shared utilities
β”œβ”€β”€ config/              # Configuration management
└── main.ts             # Application entry point

test/
β”œβ”€β”€ unit/               # Unit tests
β”œβ”€β”€ integration/        # Integration tests
└── e2e/               # End-to-end tests

.github/
└── workflows/         # CI/CD pipeline definitions

Available Scripts

# Development
npm run start:dev      # Start development server
npm run start:debug    # Start with debugging
npm run build          # Build application
npm run build:cli      # Build CLI tool

# Testing
npm run test:unit      # Unit tests
npm run test:integration # Integration tests
npm run test:e2e       # E2E tests
npm run test:coverage  # Coverage report

# Code Quality
npm run lint           # ESLint check
npm run lint:fix       # Auto-fix linting issues
npm run type-check     # TypeScript compilation check

# Database
npm run db:migrate     # Run migrations
npm run db:seed        # Seed database

🀝 Contributing

Development Setup

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests
    npm run test:all
  5. Commit your changes
    git commit -m 'feat: add amazing feature'
  6. Push to the branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Code Standards

  • TypeScript - Strict type checking enabled
  • ESLint - Code quality and consistency
  • Prettier - Code formatting
  • Jest - Comprehensive testing
  • Conventional Commits - Standardized commit messages

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

Getting Help

Community

  • 🌟 Star the repository if you find it useful
  • πŸ”— Share with your network
  • πŸ’‘ Suggest features via GitHub Issues
  • πŸ› Report bugs with detailed information

πŸ™ Acknowledgments

  • NestJS - Amazing framework for building scalable applications
  • n8n - Powerful workflow automation platform
  • PostgreSQL - Reliable database for enterprise applications
  • Docker - Containerization for consistent deployments
  • GitHub Actions - Automated CI/CD pipeline

Built with ❀️ by the GroWAppAI Team

GroWAppAI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published