Home

Membership Management Backend

A comprehensive membership management system designed for organizations such as clubs, associations, and federations. This backend provides a robust foundation for managing hierarchical organizational structures, member data, group management, and automated workflows through an extensible bot system.

🎯 Overview

The Membership Management Backend is a scalable, multi-tenant system that supports complex organizational hierarchies and member management workflows. It provides RESTful APIs for managing members, groups, roles, training records, and automated processes while ensuring secure access through Keycloak-based authentication.

Key Capabilities

  • Hierarchical Organization Management: Configurable organizational structures supporting multiple levels (national, regional, local, team)
  • Member Lifecycle Management: Complete member data management from registration to historical tracking
  • Group & Team Management: Flexible group structures with visual indicators and hierarchical relationships
  • Role-Based Access Control: Comprehensive permission system with organization-specific and global roles
  • Automated Workflows: Extensible bot system for automating routine tasks and notifications
  • Multi-Organization Support: Single system supporting multiple independent organizations
  • Training & Qualification Tracking: Management of member qualifications, certifications, and training records
  • Communication Tools: Integrated email management and notification systems
  • Audit & Compliance: Complete audit trails and data retention policies

πŸ—οΈ Architecture

Core Components

+-----------------------------+    +-----------------------------+    +-----------------------------+
|        Members              |    |        Groups               |    |        Training             |
|       Management            |    |       Management            |    |       Management            |
+-----------------------------+    +-----------------------------+    +-----------------------------+
+-----------------------------+    +-----------------------------+    +-----------------------------+
|        Bot                  |    |        Email                |    |        Audit                |
|      Automation             |    |      Management             |    |       System                |
+-----------------------------+    +-----------------------------+    +-----------------------------+
+-----------------------------------------------------------------------------------------------+
|                          Authentication & Authorization                                        |
|                 Keycloak OIDC + Redis Sessions + Multi-Org RBAC                                |
+-----------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------------+
|                              Database & Caching                                                 |
|                    PostgreSQL + Redis Cache + Cross-API Data Access                             |
+-----------------------------------------------------------------------------------------------+

Technology Stack

  • Runtime: Node.js with Express.js framework
  • Database: PostgreSQL for persistent data storage
  • Cache: Redis for session management and performance optimization
  • Authentication: Keycloak OIDC with JWT validation
  • Containerization: Docker with Docker Compose for development and deployment
  • API: RESTful JSON APIs with comprehensive documentation
  • Bot System: Event-driven automation with configurable actions

πŸš€ Key Features

1. Configurable Hierarchical Structures

Support for complex organizational hierarchies with customizable levels:

# Example organization configuration
UID: "uuid-example-1234"
Orga: "Beispielverein"
Hierarchie:
  - National
  - Regional
  - Verein
  - Team
GenderGroups:
  M: MΓ€nnlich
  F: Weiblich
  B: Gemischt
Stage:
  - Alle Altersstufen
  - Jugend
  - Junioren
  - Senioren

2. Comprehensive Member Management

  • Personal Data: Complete member profiles with contact information
  • Role Assignments: Flexible role and function management
  • Qualification Tracking: Training, certifications, and qualification management
  • Group Memberships: Multiple group affiliations with hierarchical relationships
  • Historical Records: Complete audit trail of member changes

3. Group & Team Management

  • Hierarchical Groups: Support for nested group structures
  • Visual Indicators: Icons and logos for group identification
  • Member Assignment: Flexible member-to-group relationships
  • Administrative Functions: Group-specific roles and permissions

4. Automated Bot System

Extensible automation framework supporting:

  • Event-Driven Actions: Automatic responses to system events
  • Custom Workflows: Configurable automation sequences
  • Notification Systems: Automated email and alert generation
  • Data Synchronization: Cross-system data updates
  • Scheduled Tasks: Time-based automated processes

5. Multi-Organization Support

  • Tenant Isolation: Complete data separation between organizations
  • Shared Infrastructure: Efficient resource utilization across organizations
  • Organization-Specific Configuration: Customizable settings per organization
  • Unified Management: Single system for multiple organizational entities

6. Security & Compliance

  • OIDC Authentication: Industry-standard authentication via Keycloak
  • Role-Based Access: Granular permission system
  • Organization Isolation: Data separation between organizations
  • Audit Logging: Comprehensive activity tracking
  • GDPR Compliance: Data protection and privacy features

πŸ“‹ Use Cases

Member Onboarding

  1. New member registration with automatic data validation
  2. Role and group assignment based on organizational rules
  3. Welcome email generation and delivery
  4. Initial qualification assessment and tracking

Group Management

  1. Creation and configuration of organizational groups
  2. Member assignment and role management within groups
  3. Hierarchical relationship management
  4. Visual customization with logos and icons

Training Administration

  1. Qualification and certification tracking
  2. Training course management and enrollment
  3. Compliance monitoring and reporting
  4. Automated renewal notifications

Automated Workflows

  1. Event-triggered notifications (new member welcome, qualification expiry)
  2. Data synchronization across systems
  3. Scheduled reporting and maintenance tasks
  4. Custom automation based on organizational needs

πŸ”§ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL 13+
  • Redis 6+
  • Keycloak 20+
  • Docker & Docker Compose (for development)

Quick Start

  1. Clone and Setup

    git clone <repository-url>
    cd membership-backend
    npm install
    
  2. Environment Configuration

    cp .env.example .env
    # Configure database, Redis, and Keycloak settings
    
  3. Database Setup

    npm run db:migrate
    npm run db:seed
    
  4. Start Development Environment

    docker-compose -f docker-compose-dev.yml up
    npm run dev
    

Development Environment

The system includes comprehensive Docker Compose configurations for development:

  • Main Application: Node.js application with hot reload
  • Database: PostgreSQL with persistent data volumes
  • Cache: Redis for session and data caching
  • Keycloak: Identity and access management
  • Monitoring: Basic logging and health checks

πŸ“š API Documentation

Core Endpoints

Members API

  • GET /api/members - List members with filtering and pagination
  • POST /api/members - Create new member
  • GET /api/members/:id - Get member details
  • PUT /api/members/:id - Update member information
  • DELETE /api/members/:id - Remove member

Groups API

  • GET /api/groups - List organizational groups
  • POST /api/groups - Create new group
  • GET /api/groups/:id - Get group details
  • PUT /api/groups/:id - Update group information
  • GET /api/groups/:id/members - List group members

Authentication API

  • GET /api/auth/status - Check authentication status
  • POST /api/auth/login - User login (OIDC flow)
  • POST /api/auth/logout - User logout

Bot Management API

  • GET /api/bots - List available bots
  • POST /api/bots/:id/configure - Configure bot instance
  • GET /api/bots/:id/logs - Get bot execution logs

Authentication

The API supports multiple authentication methods:

  1. User Authentication: OIDC/OAuth2 flows for interactive users
  2. Bot Authentication: Service account authentication for automated processes
  3. Multi-Organization: Organization-specific access control

See AUTHENTICATION.md for detailed authentication documentation.

πŸ”’ Security

Authentication Methods

  • OIDC/OAuth2: Standard web application authentication
  • Service Accounts: For bot and automated processes
  • Multi-Organization: Organization-scoped access control
  • JWT Validation: Stateless token validation with Redis caching

Authorization

  • Role-Based Access Control: Granular permissions system
  • Organization Isolation: Data separation between organizations
  • API Scopes: Endpoint-specific access control
  • Audit Logging: Comprehensive security event tracking

πŸ€– Bot System

Architecture

The bot system provides event-driven automation capabilities:

+-------------+    +-------------+    +-------------+
|   Events    +--->+    Bots     +--->+  Actions    |
|             |    |             |    |             |
| β€’ Member    |    | β€’ Sync Bot  |    | β€’ Email     |
|   Added     |    | β€’ Notify Bot|    | β€’ Update DB |
| β€’ Group     |    | β€’ Report Bot|    | β€’ API Call  |
|   Changed   |    |             |    |             |
+-------------+    +-------------+    +-------------+

Bot Types

  1. System Bots: Global automation for administrative tasks
  2. Action Bots: User-configurable automation for specific workflows
  3. Event Bots: Reactive automation triggered by system events

Configuration

Bots are configured through UI schemas that define:

  • Trigger conditions (events to respond to)
  • Action parameters (what to do when triggered)
  • Notification settings (who to notify and how)

πŸ“Š Monitoring & Analytics

System Health

  • Health Checks: Automated monitoring of all system components
  • Performance Metrics: Response times and throughput monitoring
  • Error Tracking: Comprehensive error logging and alerting
  • Resource Usage: Memory, CPU, and storage monitoring

Business Analytics

  • Member Statistics: Growth trends and demographic analysis
  • Group Analytics: Membership distribution and activity tracking
  • Training Reports: Qualification completion and compliance tracking
  • Bot Performance: Automation effectiveness and success rates

πŸš€ Deployment

Production Environment

The system supports multiple deployment strategies:

  1. Docker Containerization: Complete containerized deployment
  2. Kubernetes: Orchestrated deployment with auto-scaling
  3. Traditional Hosting: Standard Node.js application deployment
  4. Cloud Platforms: AWS, Azure, Google Cloud support

Configuration Management

  • Environment Variables: Runtime configuration
  • Vault Integration: Secure secret management
  • Configuration Files: Organization-specific settings
  • Database Seeding: Initial data setup and migrations

πŸ“– Documentation

For Developers

For Administrators

For Users

🀝 Contributing

We welcome contributions to the Membership Management Backend project. Please see our Contributing Guide for details on:

  • Code standards and development practices
  • Testing requirements and procedures
  • Documentation guidelines
  • Pull request process

πŸ“„ License & SaaS Terms

This Membership Management Backend is offered as a Software-as-a-Service (SaaS) solution. By using this service, you agree to our Terms of Service and Privacy Policy.

SaaS Subscription Plans

  • Starter Plan: Basic membership management for small organizations
  • Professional Plan: Advanced features including bot automation and multi-organization support
  • Enterprise Plan: Full-featured solution with custom integrations and dedicated support

Commercial Licensing

For on-premises deployments or custom implementations, commercial licenses are available. Please contact our sales team for licensing options.

Open Source Components

This project includes open source components licensed under their respective licenses. See THIRD_PARTY_LICENSES for details.

πŸ†˜ Support

Getting Help

  • Documentation: Comprehensive guides and API references
  • Issue Tracker: Bug reports and feature requests
  • Community Forum: User discussions and best practices
  • Professional Support: Enterprise support options available

Contact Information

  • Email: support@membership-system.org
  • Documentation: https://docs.membership-system.org
  • Issue Tracker: https://github.com/org/membership-backend/issues

Built with ❀️ for organizations that value efficient member management and automated workflows.

source/src/Router/extraApi/extraController.js