- Create new @link-stack/logger package wrapping Pino for structured logging - Replace all console.log/error/warn statements across the monorepo - Configure environment-aware logging (pretty-print in dev, JSON in prod) - Add automatic redaction of sensitive fields (passwords, tokens, etc.) - Remove dead commented-out logger file from bridge-worker - Follow Pino's standard argument order (context object first, message second) - Support log levels via LOG_LEVEL environment variable - Export TypeScript types for better IDE support This provides consistent, structured logging across all applications and packages, making debugging easier and production logs more parseable. |
||
|---|---|---|
| .. | ||
| app | ||
| public | ||
| .dockerignore | ||
| .gitignore | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| LICENSE.md | ||
| middleware.ts | ||
| next-env.d.ts | ||
| next.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
CDR Link
The main CDR (Center for Digital Resilience) Link application - a streamlined helpdesk interface built on top of Zammad with integrated communication channels and data visualization.
Overview
CDR Link provides a unified dashboard for managing support tickets, communication channels, and data analytics. It integrates multiple services including Zammad (ticketing), Bridge (multi-channel messaging), Leafcutter (data visualization), and OpenSearch.
Features
- Simplified Helpdesk Interface: Streamlined UI for Zammad ticket management
- Multi-Channel Communication: Integration with Signal, WhatsApp, Facebook, and Voice channels
- Data Visualization: Embedded Leafcutter analytics and reporting
- User Management: Role-based access control with Google OAuth
- Search: Integrated OpenSearch for advanced queries
- Label Studio Integration: For data annotation workflows
Development
Prerequisites
- Node.js >= 20
- npm >= 10
- Running instances of Zammad, PostgreSQL, and Redis
- Configured authentication providers
Setup
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
Environment Variables
Key environment variables required:
ZAMMAD_URL- Zammad instance URLZAMMAD_API_TOKEN- Zammad API authentication tokenDATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection URLNEXTAUTH_URL- Application URL for authenticationNEXTAUTH_SECRET- Secret for NextAuth.jsGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth client secret
Available Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run export- Export static site
Architecture
Pages Structure
/- Main dashboard/overview/[overview]- Ticket overview pages/tickets/[id]- Individual ticket view/edit/admin/bridge- Bridge configuration management/leafcutter- Data visualization dashboard/opensearch- Search dashboard/zammad- Direct Zammad access/profile- User profile management
API Routes
/api/auth- NextAuth.js authentication/api/v2/users- User management API/api/[service]/bots- Bot management for communication channels/api/[service]/webhooks- Webhook endpoints
Key Components
ZammadWrapper- Embeds Zammad UI with authenticationSearchBox- Global search functionalityTicketList/TicketDetail- Ticket management componentsSidebar- Navigation and service switching
Docker Support
Build and run with Docker:
# Build image
docker build -t link-stack/link .
# Run with docker-compose
docker-compose -f docker/compose/link.yml up
Integration Points
- Zammad: GraphQL queries for ticket data
- Bridge Services: REST APIs for channel management
- Leafcutter: Embedded iframe integration
- OpenSearch: Direct dashboard embedding
- Redis: Session and cache storage