WiseMapping Open Source

repository·develop·Indexed 43 days ago

https://github.com/wisemapping/wisemapping-open-source

An open-source mind mapping application featuring a RESTful API, telemetry for monitoring, and OpenAPI specifications. It supports collaboration, administration, and mindmap management with deployment options for MariaDB, MySQL, and PostgreSQL via Docker Compose.

Tokens
21.9K
Snippets
55
Records
78
Agent score
54%

What's inside WiseMapping

  1. Explore Wisemapping Backend Documentation Structure

    develop

    The backend documentation is organized into several key areas:

    • rest-api/: Contains legacy REST services documentation.
    • telemetry/: Contains documentation for OpenTelemetry and metrics implementation.
    • openapi-specs/: Contains the source-of-truth API specifications:
      • openapi.yaml: The main OpenAPI 3.0 specification.
      • mindmap-endpoints.yaml: Specific endpoints related to mindmap operations.
      • collaboration-admin-endpoints.yaml: Endpoints for administration and collaboration features.
  2. Navigate WiseMapping Documentation

    develop

    The WiseMapping documentation is organized into three primary categories based on your role:

    For Developers

    • API Documentation: Detailed REST API reference, including authentication, endpoints, data models, and error handling.
    • Backend Documentation: Specifics regarding backend implementation and development guidelines.
    • OpenAPI Specifications: Machine-readable API definitions in OpenAPI format.

    For System Administrators

    • Database Configuration: Setup instructions and migration scripts.
    • Deployment Guide: Documentation for Docker and general deployment.
    • Telemetry & Metrics: Information on monitoring and observability.

    For Integration

    • REST Services: Documentation for legacy REST services, including CURL examples.
    • API Examples: Workflow examples for integrating with the system.
  3. Overview of Telemetry and Metrics in WiseMapping API

    develop
    The WiseMapping API implements telemetry and metrics using OpenTelemetry standards and exposes them via Spring Boot Actuator endpoints. This system allows for monitoring application usage patterns, such as mindmap creation, user authentication, registration, and spam detection. Metrics are available through standard Actuator endpoints and can be exported in Prometheus format for integration with monitoring systems like Prometheus.
  4. Handle API Errors

    develop

    The API uses standard HTTP status codes. Errors are returned in a JSON format containing a message, a specific error code, and optional field-level details.

    Common Status Codes:

    • 200 OK / 201 Created / 204 No Content: Success
    • 400 Bad Request: Invalid request data
    • 401 Unauthorized: Authentication required or invalid
    • 403 Forbidden: Access denied (e.g., admin required)
    • 404 Not Found: Resource not found
    • 429 Too Many Requests: Rate limit exceeded
    • 500 Internal Server Error: Server error
    {
      "message": "Error description",
      "code": "ERROR_CODE",
      "details": {
        "field": "Additional error details"
      }
    }
  5. How LDAP Authentication works in WiseMapping

    develop

    The AuthenticationProviderLDAP handles the authentication lifecycle. When a user logs in:

    1. The system checks if the user exists via other authentication types.
    2. An LDAP bind attempt is made using the provided credentials.
    3. Upon success, attributes (email, first name, last name) are extracted from the LDAP server.
    4. The user is synchronized with the WiseMapping database (created if new, updated if existing).
    5. A JWT is returned using the email address retrieved from LDAP (which may differ from the username used to log in).

    Note: If the LDAP server is unavailable, the system falls back to standard DATABASE authentication.

  6. Compare API Only vs Full Stack configurations

    develop

    Choose the configuration that best fits your deployment architecture:

    FeatureAPI OnlyFull Stack
    Backend API✅✅
    Frontend UI❌✅
    DatabaseExternalHSQLDB (in-memory)
    Container Count11
    Ports808080 (8080 internal)
    Data PersistenceN/A⚠️ Not recommended
    Best ForMicroservicesQuick testing
    Production Ready✅⚠️ Not for data
  7. Understand LDAP authentication system behavior

    develop

    When LDAP authentication is enabled in WiseMapping, the system follows these behaviors:

    Automatic Account Creation

    Upon the first successful LDAP login, a WiseMapping account is automatically provisioned with:

    • Email: Extracted from the LDAP attribute or generated using the pattern username@domain.com.
    • Authentication type: Set to LDAP.
    • Account status: Activated immediately.

    Attribute Synchronization

    WiseMapping synchronizes user profile data from Active Directory (AD) during every successful login. The following attributes are updated if they have changed in the LDAP server:

    • First name (firstname)
    • Last name (lastname)

    Authentication Method Constraints

    • Exclusivity: A user can only use one authentication method. If an account is already associated with AuthenticationType.DATABASE, an LDAP login attempt will be rejected. Conversely, if an account is set to LDAP, database-based login will be rejected.
    • Availability Fallback: If the LDAP server is unreachable, users configured with AuthenticationType.DATABASE can still log in. However, users configured for LDAP authentication will be unable to log in until the LDAP server becomes accessible.
  8. MariaDB Configuration Details for WiseMapping

    develop

    The MariaDB deployment is optimized with the following technical specifications:

    • Driver & Dialect: Uses org.mariadb.jdbc.Driver and org.hibernate.dialect.MariaDBDialect (native MariaDB, not MySQL compatibility mode).
    • Character Set: Configured with utf8mb4 character set and utf8mb4_unicode_ci collation for full UTF-8 support.
    • Case Sensitivity: Uses --lower_case_table_names=1 to ensure consistent lowercase naming conventions across Linux, Mac, and Windows.
    • Data Storage: Uses MEDIUMBLOB for XML mindmap data and MEDIUMTEXT for descriptions to support large mindmaps.
  9. Understand API Rate Limiting

    develop

    To prevent abuse, the API implements rate limiting. You can monitor your usage via the following response headers:

    • X-RateLimit-Limit: Maximum requests allowed in the current window.
    • X-RateLimit-Remaining: Number of requests remaining in the current window.
    • X-RateLimit-Reset: The timestamp when the rate limit window resets.

    If you exceed the limit, the API will return a 429 Too Many Requests status code.

  10. Build and Run Full Stack (Frontend + Backend)

    develop

    Use this configuration for an all-in-one deployment containing both the frontend UI and the backend API in a single container. This is ideal for quick local testing or single-container production setups with an external database.

    How it works:

    • Clones the frontend from the GitHub repository (defaults to main).
    • Builds both frontend and backend from source.
    • Packages everything into one container.

    Build Options: You can specify a different frontend branch or tag using the --build-arg FRONTEND_BRANCH flag.

    Run Command: Exposes the application on port 80.

    # From repository root
    docker build -f distribution/app/Dockerfile -t wisemapping:latest .
    
    # Or build with a specific frontend branch/tag
    docker build -f distribution/app/Dockerfile \
      --build-arg FRONTEND_BRANCH=develop \
      -t wisemapping:develop .
    
    # Run
    docker run -d \
      --name wisemapping \
      -p 80:80 \
      wisemapping:latest
  11. Quick Start WiseMapping with MariaDB using Docker Compose

    develop

    Deploy WiseMapping with a MariaDB 11.4 database using Docker Compose. This configuration uses the native MariaDB JDBC driver and dialect.

    Steps

    1. Create a .env file from .env.example and populate it with the required environment variables.
    2. Run the deployment command:
      docker-compose up -d
    3. Access the application at http://localhost or http://localhost:${WISEMAPPING_PORT}.

    Default Credentials

    • Test User: test@wisemapping.org / test
    • Admin User: admin@wisemapping.org / testAdmin123
    docker-compose up -d