Skip to content

CyferWall Engage Backend DocumentationΒΆ

CyferWall Logo

Welcome to the comprehensive documentation for the CyferWall Engage Backend - a robust Node.js/TypeScript API service powering customer engagement and support operations.

πŸš€ Quick StartΒΆ

Development SetupΒΆ

# Clone and install dependencies
npm install

# Setup environment
cp .env.example .env
# Configure your environment variables

# Initialize database
npm run postinstall
npx prisma db push

# Start development server
npm run dev

Production DeploymentΒΆ

# Build the application
npm run build

# Start production server
npm start

πŸ”— API Base URL: https://api.cyferwall.com/api/v1
πŸƒ Development: http://localhost:3000/api/v1

πŸ“‹ System OverviewΒΆ

The Engage Backend provides:

  • 🎫 Support Case Management - Complete ticketing system
  • πŸ“§ Notification System - Multi-channel notifications (Email, SMS, Webhook)
  • πŸ‘€ User Authentication - JWT-based auth with social providers
  • πŸ“Š Health Monitoring - System health and metrics endpoints
  • πŸ” Security - Rate limiting, CORS, input validation
  • πŸ“ˆ Observability - DataDog tracing and Winston logging

ArchitectureΒΆ

graph TB
    A[Client Applications] --> B[Express.js API Server]
    B --> C[Authentication Middleware]
    C --> D[Route Controllers]
    D --> E[Business Logic Services]
    E --> F[Database Layer]
    E --> G[Notification System]
    E --> H[External Services]

    F --> I[(PostgreSQL)]
    G --> J[Email Provider]
    G --> K[SMS Provider]
    H --> L[Apple SignIn]
    H --> M[Google Auth]

πŸ›£οΈ API RoutesΒΆ

Core System RoutesΒΆ

Method Endpoint Description
GET / Heartbeat check
GET /metrics System metrics

Support ManagementΒΆ

Method Endpoint Description
POST /common/support/case Create support case
POST /common/support/case/status Check case status
POST /common/support/case/escalate Escalate case
POST /common/support/case/cancel Cancel case
GET /common/support/internal/stats Internal statistics

πŸ”§ Core ComponentsΒΆ

1. Health & MonitoringΒΆ

  • Heartbeat: Database connectivity check
  • Metrics: Prisma ORM performance metrics
  • Logging: Structured logging with Winston
  • Tracing: DataDog APM integration

2. Support SystemΒΆ

  • Multi-tier support case management
  • Automated escalation workflows
  • Customer and staff notifications
  • Case status tracking

3. Notification EngineΒΆ

  • Template-based notifications
  • Multi-channel delivery (Email/SMS/Webhook)
  • Retry logic and failure handling
  • Template validation and testing

4. Security & AuthΒΆ

  • JWT token authentication
  • Social provider integration (Google, Apple)
  • Request validation with Zod schemas
  • Rate limiting and CORS protection

🏁 Getting Started¢

Choose your path:

πŸ”§ DevelopersΒΆ

Start with Quick Setup for local development environment setup.

🎫 Support Integration¢

Jump to Support APIs for ticketing system integration.

πŸ“§ NotificationsΒΆ

Explore Notification System for email/SMS automation.

πŸš€ DeploymentΒΆ

Check Deployment Guide for production deployment.

πŸ› οΈ TroubleshootingΒΆ

Visit Common Issues for quick problem resolution.

πŸ“– Documentation SectionsΒΆ


Made with ❀️ by the CyferWall Team

πŸš€ Quick StartΒΆ

Get up and running with our notification system in under 5 minutes:

import { notifications } from '@/util/notifications/ultra-simple'

// Send a notification email
await notifications.email('case-received-customer', 'user@example.com', {
  caseNumber: 'CW-2025-001',
  customerName: 'John Doe'
})

// Send SMS
await notifications.sms('+1234567890', 'Your case has been updated')

// Test a template
const test = await notifications.test('case-escalated', { caseNumber: 'CW-2025-001' })

πŸ“‹ What's IncludedΒΆ

πŸ”” Notification SystemΒΆ

  • Template-driven notifications with Handlebars rendering
  • Multi-channel support (Email, SMS, Webhooks)
  • Automatic error handling and logging
  • Easy testing and debugging tools

🎫 Support APIs¢

  • Customer-facing APIs for case creation, status checks, escalation
  • Internal staff APIs for case management and operations
  • Integrated notifications for all case lifecycle events
  • Real-time status tracking and updates

πŸ“ Template ManagementΒΆ

  • Organized template structure by category and audience
  • Dynamic content rendering with Handlebars helpers
  • Variable validation and type checking
  • Easy template testing and preview

πŸ—οΈ Architecture OverviewΒΆ

graph TB
    A[Support API Endpoints] --> B[Case Controllers]
    B --> C[Notification Service]
    C --> D[Template Manager]
    D --> E[HTML Templates]
    C --> F[Email Provider]
    C --> G[SMS Provider]
    C --> H[Webhook Service]

    I[Customer] --> A
    J[Support Staff] --> A
    K[External Systems] --> A

πŸ“š Documentation SectionsΒΆ

Section Description
Getting Started Environment setup and basic configuration
Notification System Complete guide to the notification system
Support APIs Customer and internal API documentation
Templates Template creation and management
Deployment Production setup and monitoring
Troubleshooting Common issues and debugging

πŸ”§ Key FeaturesΒΆ

Ultra-Simple APIΒΆ

// Before (complex)
const service = new NotificationService()
const result = await service.sendEmail({
  templateId: 'case-received',
  to: 'user@example.com',
  data: { caseNumber: '123' }
})

// After (ultra-simple)
const result = await notifications.email('case-received', 'user@example.com', { caseNumber: '123' })

Robust Template SystemΒΆ

  • Category organization: customer, internal, support, operations
  • Variable validation: Required vs optional variables with type checking
  • Helper functions: Date formatting, calculations, conditionals
  • Error handling: Clear error messages and fallback options

Complete IntegrationΒΆ

  • βœ… Case creation notifications
  • βœ… Status update notifications
  • βœ… Escalation notifications
  • βœ… Cancellation notifications
  • βœ… Internal staff notifications
  • βœ… Operations team notifications

🎯 Quick Navigation¢

πŸ“ž SupportΒΆ

For internal support and questions:


This documentation is automatically updated with each deployment. Last updated: {{ "now" | date("YYYY-MM-DD HH:mm") }}