REI3 Documentation

repository·main·Indexed 20 days ago

https://github.com/r3-team/r3

A free and open low-code platform for building, hosting, and managing applications with self-hosting capabilities for cloud or on-premise deployment. REI3 features enterprise-grade security including E2EE, RBAC, MFA, and LDAP integration, alongside tools for data logic, visualization, and workflows. The platform is built with Go and Vue.js, supporting PostgreSQL databases and providing a comprehensive CLI for installation, service management, and administration.

Tokens
3K
Snippets
10
Records
16
Agent score
68%

What's inside REI3

  1. REI3 core features overview

    main

    REI3 is a free and open low-code platform for building and hosting powerful applications. Key capabilities include:

    • Data & Logic: Summarize records, perform date calculations, and apply business rules. Supports full-text search.
    • Visualization: Gantt charts, diagrams, and information-dense lists.
    • Workflows: Form adjustments based on record state, PDF exports, and notifications.
    • Security: Role-based access control (RBAC), end-to-end encryption (E2EE) with integrated key management, MFA, and password policies.
    • Integration: REST endpoints, CSV import/export, and ICS for calendars.
    • Deployment: Self-hosted (cloud or on-premise), mobile-ready (PWA), and enterprise-ready (LDAP integration, clustering).
  2. Quickstart: Install and run REI3 on Linux

    main

    To set up REI3 on a Linux system, follow these steps:

    1. Extract and Prepare Binary: Download the REI3 package (x64 or arm64), extract it to a location like /opt/rei3, and make the r3 binary executable:
      chmod u+x r3
    2. Configure Database: Copy config_template.json to config.json. Fill in the details for an empty, UTF8 encoded PostgreSQL database. Ensure the DB user has full permissions to this database.
    3. Install Dependencies (Optional): For image/PDF thumbnails and backups, install:
      sudo apt install imagemagick ghostscript postgresql-client
    4. Register and Start: Run the installation command and then start the service using your system manager:
      sudo ./r3 -install
      sudo systemctl start rei3

    Once running, access REI3 at https://localhost (default port 443). The default credentials are admin for both username and password.

    # Linux Setup Steps
    chmod u+x r3
    cp config_template.json config.json
    sudo ./r3 -install
    sudo systemctl start rei3
  3. Quickstart: Install and run REI3 on Windows

    main

    To set up REI3 on Windows:

    1. Standalone Installation: Use the installer to set up the standalone version directly on any Windows Server.
    2. PDF Thumbnails (Optional): Install Ghostscript on the same Windows Server to enable PDF thumbnail generation.

    Once running, access REI3 at https://localhost (default port 443). The default credentials are admin for both username and password.

    # Windows Setup
    # Use the installer from https://rei3.de/latest/x64_installer
    # Optionally install Ghostscript for PDF thumbnails
    # Access via https://localhost (admin/admin)
  4. Build REI3 from source

    main

    To build your own REI3 executable using Go, follow these steps:

    1. Prerequisites: Install the latest version of Golang.
    2. Compile: Navigate to the source directory (where r3.go is located) and run the build command. You must provide a version string via -ldflags.
      go build -ldflags "-X main.appVersion={YOUR_APP_VERSION}"
      Replace {YOUR_APP_VERSION} with your desired version, e.g., 2.5.1.2980.

    Advanced Build Options:

    • Cross-compilation: Use the GOOS environment variable (e.g., GOOS=windows or GOOS=linux).
    • External Web Assets: By default, HTML, JS, and CSS are embedded in the binary. To load external assets for development without recompiling, use the -wwwpath argument:
      ./r3 -wwwpath /path/to/your/www
    go build -ldflags "-X main.appVersion=2.5.1.2980"
  5. How to translate TinyMCE language files

    main

    Do not translate the language files located in www/externals/tinymce/langs/ directly. To contribute translations or update language files, use the official Crowdin project instead. This ensures translations are managed centrally and correctly.

    https://crowdin.com/project/tinymce
  6. The App component: Core UI entrypoint

    main

    The app component is the central entrypoint for the R3 application. It manages the high-level application lifecycle, including authentication via MyLogin, global navigation via MyHeader, and the rendering of the main content through router-view. It also handles global UI elements like MyDialog, MyFeedback, MyGlobalSearch, and MySettings.

    Key responsibilities include:

    • Lifecycle Management: Orchestrates the transition from login to an authenticated state (appReady).
    • State Synchronization: Connects backend WebSocket events to the Vuex store.
    • Global UI: Manages pop-up forms, global search, and system-wide notifications.
    • Responsive Design: Monitors window resizing to toggle mobile/desktop modes.
    import App from './app.js';
    // The component is exported as a default object containing name, components, and template.
  7. How the application lifecycle works

    main

    The application follows a specific state progression to ensure all necessary data and connections are established before the user interacts with the UI:

    1. WebSocket Connection: Establishes a connection to the backend via wsConnect().
    2. Public Data Loading: Fetches non-authenticated data (app version, company branding, language codes, etc.) via initPublic().
    3. Schema Loading: Fetches module definitions and metadata via initSchema() to build the navigation structure.
    4. Authentication: Once MyLogin emits @authenticated, initApp() is called to fetch user-specific data (favorites, settings, access rights, and cryptographic keys).
    5. Finalization: After captions and collections are loaded, appReady is set to true, enabling the main application interface.
  8. Manage REI3 as a System Service

    main

    REI3 can be installed and managed as a system service (e.g., using kardianos/service). This allows the platform to run in the background and start automatically with the operating system.

    Use the following flags to manage the service:

    • -install: Installs the REI3 service.
    • -uninstall: Uninstalls the REI3 service.
    • -start: Starts the installed service.
    • -stop: Stops the running service.
    • -servicename <name>: Specifies the name of the service to manage (defaults to REI3).
    # Install the service
    ./r3 -install
    
    # Start the service
    ./r3 -start
    
    # Stop the service
    ./r3 -stop
  9. Manage application session and logout

    main

    The application manages session validity through periodic checks and WebSocket signals.

    • Session Expiration: sessionExpireCheck() runs every second to compare the current time against loginSessionExpires. If expired, it triggers sessionInvalid(true, false).
    • Manual Logout: sessionInvalid(false, true) can be called to clear local caches, reset the WebSocket connection, and redirect the user to the home page.
    • Session Invalidation: The sessionInvalid method clears the following Vuex store items:
      • local/loginCachesClear
      • local/loginKeyAes / local/loginKeySalt
      • local/token
      • loginPrivateKey / loginPublicKey
    // Example of how the app handles session invalidation internally
    this.sessionInvalid(true, false); // sessionExpired=true, returnToHome=true
  10. Run REI3 via CLI

    main

    You can run the REI3 platform directly from the console using the -run flag. This is useful for development or manual execution. When running, the application will use the configuration specified in config.json (or the file provided via -config).

    Commonly used flags with -run:

    • -debug: Enables debug logging for all events.
    • -http: Starts the server using unencrypted HTTP (for testing/development only).
    • -dynamicport: Tells the OS to provide an available port instead of using the configured one.
    • -open: Automatically opens the application URL in your default web browser once the server is ready.
    • -config <path>: Specifies a custom location for the configuration file.
    # Run the application with debug mode and open in browser
    ./r3 -run -debug -open
    
    # Run with a specific configuration file over HTTP
    ./r3 -run -config my_config.json -http
  11. Register and run global application functions

    main

    The application registers a set of utility functions into the Vuex store under appFunctionsRegister. This allows these functions to be accessible throughout the application context.

    Registered functions include:

    • captionsReload: Reloads language files.
    • initPublic: Triggers the public data loading sequence.
    • sessionInvalid: Manages logout and session clearing.
    • formOpen: Opens a specific form.
    • jsFunctionRun: Executes dynamic logic requested by the backend.