CyferWall Engage Backend DocumentationΒΆ

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ΒΆ
π 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ΒΆ
- Getting Started - Environment setup and first steps
- API Reference - Complete endpoint documentation
- Support System - Case management workflows
- Notification System - Email/SMS automation
- Authentication - User auth and security
- Database - Data models and migrations
- Deployment - Production deployment guide
- Troubleshooting - Common issues and solutions
π Quick LinksΒΆ
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ΒΆ
-
Quick Setup
Get your development environment ready in minutes
-
Notifications
Send template-driven notifications easily
-
Support APIs
Customer and internal support endpoints
-
Templates
Create and manage notification templates
π SupportΒΆ
For internal support and questions:
- Slack: #engage-backend-support
- Email: engineering@cyferwall.com
- Issues: Internal GitHub Issues
This documentation is automatically updated with each deployment. Last updated: {{ "now" | date("YYYY-MM-DD HH:mm") }}