A comprehensive healthcare communication management system built with Next.js and Supabase for managing patient communications, scheduling, and templates.
Echo Roaster eNurse CMS is a full-stack healthcare communication platform designed for medical institutions to manage patient contact databases, create communication templates, schedule automated messages, and track conversation threads. The system enables healthcare professionals to maintain organized patient communications while ensuring compliance and efficiency.
echoroaster-enurse-cms/
βββ nextjs/ # Main Next.js application
β βββ pages/ # Application pages and API routes
β βββ components/ # Reusable UI components
β βββ styles/ # Global styles and Tailwind config
β βββ public/ # Static assets
βββ packages/
β βββ lib/ # Shared business logic library
β βββ src/ # Helper modules and utilities
βββ scripts/ # Deployment and utility scripts
Frontend:
- Next.js 13+ - React framework with SSR/SSG capabilities
- React 18 - UI library with modern hooks
- Tailwind CSS - Utility-first CSS framework with custom design system
- React Hot Toast - Notification system
- Headless UI - Accessible UI components
Backend & Database:
- Supabase - PostgreSQL database with real-time subscriptions
- Next.js API Routes - RESTful API endpoints
- Row Level Security (RLS) - Database-level authorization
Communication & Media:
- React Player - Video/audio playback
- React Audio Player - Audio message handling
- File Upload System - Support for attachments and media
Development & Deployment:
- Docker - Containerized deployment
- ESLint - Code linting and formatting
- SWC - Fast JavaScript/TypeScript compiler
- GitLab CI/CD - Automated deployment pipeline
- Docker and Docker Compose
- Node.js 16+ (for local development)
- Access to Supabase instance
-
Build the container:
npm run docker-build
-
Start the application:
npm run docker-start
-
Access the application:
- Open http://localhost:3000
- Default redirect to
/dashboard
-
Install dependencies:
cd nextjs && npm install cd ../packages/lib && npm install
-
Configure environment:
# Create nextjs/.env with required variables NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key SERVICE_KEY=your_service_key -
Start development server:
cd nextjs && npm run dev
- Real-time metrics - Message delivery statistics and recipient reach
- Chart visualizations - Time-series data with Chart.js integration
- Schedule overview - Active and pending communication schedules
- Quick actions - Template creation and contact management shortcuts
- Contact database - Comprehensive patient/client information storage
- Contact groups - Organize contacts into categories (departments, specialties, etc.)
- Bulk operations - Import/export via CSV, batch group assignments
- Search & filtering - Fuzzy search with Fuse.js, advanced filtering options
- Phone validation - International phone number formatting and validation
- Rich text templates - HTML-supported message templates with variable substitution
- Media attachments - Support for images, audio, video, and documents
- Template groups - Organized template categories
- Metadata integration - Dynamic content insertion with custom meta fields
- Preview system - Real-time template preview with variable resolution
- Flexible scheduling - One-time and recurring message schedules
- Recipient targeting - Contact groups and individual contact selection
- Job queue management - Background job processing with status tracking
- Retry mechanisms - Automatic retry for failed deliveries
- Cancellation support - Cancel pending schedules and jobs
- Conversation threads - Organized message history per contact
- Real-time messaging - Live chat interface with instant updates
- Message status tracking - Delivery, read receipts, and error handling
- Media sharing - Image, audio, video, and file attachments
- Emoji support - Rich emoji picker integration
- Message search - Full-text search across conversation history
- Supabase Auth - Secure authentication with magic links
- Role-based access control - Granular permissions for different user types
- Profile management - User profile and preference management
- Session management - Secure token handling and session persistence
All API routes follow the pattern /api/{resource}/[[...id]].js supporting:
GET /api/{resource}- List resources with paginationGET /api/{resource}/{id}- Get specific resourcePOST /api/{resource}- Create new resourcePUT /api/{resource}/{id}- Update existing resourceDELETE /api/{resource}/{id}- Delete resource
/api/contacts- Contact management/api/templates- Template CRUD operations/api/schedules- Schedule management/api/chats- Message and conversation handling/api/users- User and profile management/api/roles- Role and permission management/api/charts- Analytics data endpoints
Core Entities:
contacts- Patient/client informationcontact_groups- Contact categorizationcontacts_in_groups- Many-to-many contact-group relationshipstemplates- Message templatestemplate_groups- Template categorizationschedules- Scheduled communicationsjobs- Background job queuechats- Message threads and conversationsprofiles- User profiles and settingsroles- User roles and permissionsmetas- Custom metadata fields
- Teal (
#81D8D0) - Primary healthcare brand color - Blue (
#648DE5) - Secondary actions and links - Green (
#07C180) - Success states and confirmations - Red (
#DB5375) - Errors and warnings - Orange (
#FF9931) - Attention and highlights - Grey Scale - Neutral colors for text and backgrounds
- Modular components - Reusable UI elements in
/components - Consistent styling - Tailwind CSS utility classes
- Accessibility - ARIA-compliant components with keyboard navigation
- Responsive design - Mobile-first approach with breakpoint system
The shared library provides business logic and utilities:
- Helper modules - ContactHelpers, MessageHelpers, ScheduleHelpers, TemplateHelpers
- API utilities - Authentication, error handling, and common operations
- Supabase client - Centralized database connection management
- Type definitions - Shared TypeScript interfaces (when applicable)
- Supabase subscriptions - Live updates for templates, schedules, and messages
- React state management - Efficient state updates with real-time data
- WebSocket connections - Persistent connections for chat functionality
The application uses multi-stage Docker builds optimized for production:
- Dependencies stage - Install and cache dependencies
- Build stage - Compile Next.js application
- Runtime stage - Minimal production image with security hardening
Required environment variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SERVICE_KEY=your_service_role_key
# Application Configuration
NODE_ENV=production
PORT=3000Database synchronization utilities for different environments:
dbDev2UAT- Development to UAT migrationdbDev2Prod- Development to Production migrationdbUAT2Prod- UAT to Production migrationdbProd2UAT- Production to UAT rollback
- Message delivery rates - Track successful vs failed message deliveries
- Recipient engagement - Monitor read receipts and response rates
- System performance - API response times and error rates
- User activity - Login patterns and feature usage
/api/status- System health and version information- Real-time connection status monitoring
- Database connectivity verification
- Fork and clone the repository
- Install dependencies:
npm installin bothnextjs/andpackages/lib/ - Set up environment variables
- Run development server:
npm run dev
- ESLint configuration for consistent code formatting
- Prettier integration for automatic code formatting
- Tailwind CSS for styling consistency
- Component testing with React Testing Library
- API testing with Jest
- E2E testing setup ready for Cypress/Playwright
- Check the Wiki for detailed technical documentation
- Review system architecture diagrams for component relationships
- Consult API documentation for integration guidelines
Version: 1.0.0 (NextJS) | 1.0.17 (Library)
License: Private - All rights reserved
Maintainer: BBI HQ Team