Servers App

Features & Capabilities

Servers App - Features & Capabilities Report

Template Version: 1.0.0 Generated: 2026-01-22 Package: @epicdm/flowstate-app-servers App ID: servers


Table of Contents

  1. Overview
  2. App Identity
  3. Feature Categories
  4. Data Models
  5. User Workflows
  6. Commands & Keybindings
  7. Architecture Summary

Overview

Purpose

The Servers App provides centralized management for RxDB server configurations used across all FlowState applications. It enables users to add, configure, and authenticate with multiple servers, supporting development, staging, and production environments with seamless switching between them.

Target Users

User TypeDescriptionPrimary Use Cases
DevelopersBuild and test FlowState appsConfigure dev servers, test connections
AdministratorsManage server infrastructureAdd production servers, manage authentication
End UsersUse FlowState applicationsAuthenticate, switch servers, sync data

Value Proposition

  • Centralized Configuration: Single place to manage all server connections
  • Multi-Server Support: Easy switching between development, staging, and production
  • Secure Authentication: Email verification flow with JWT token storage
  • Connection Validation: Test connections before activating servers
  • Visual Status: Clear indicators for active and authenticated states

App Identity

PropertyValue
IDservers
Display NameServers
Package Name@epicdm/flowstate-app-servers
Version1.0.0
Categorysettings
Iconserver
Color#F59E0B
Base Path/apps/servers
Permissionsstorage, network

Entry Points

Entry PointPathDescription
Main Exportsrc/index.tsPrimary package export
App Componentsrc/ServersApp.tsxMain React component with routing
Pluginsrc/plugin.tsFlowState plugin registration

Feature Categories

Category 1: Server Configuration Management

Core CRUD operations for server configurations

Feature: Server CRUD Operations

PropertyDetails
IDserver-crud
StatusImplemented
PriorityHigh

Description: Create, view, edit, and delete RxDB server configurations with comprehensive settings including URL, database name, domain ID, and authentication tokens.

User Story: As a developer, I want to manage server configurations so that I can connect FlowState apps to different RxDB servers.

Acceptance Criteria:

  • [x] Create servers with name, URL, database name, domain ID
  • [x] View servers in a table with status indicators
  • [x] Edit existing server configurations
  • [x] Delete server configurations (with confirmation)
  • [x] Default configuration pre-filled for new servers

Implementation:

ComponentPathPurpose
ServersPagesrc/pages/ServersPage.tsxMain server management UI
ServerConfigDialog@epicdm/flowstate-app-frameworkAdd/edit dialog
useServerConfig@epicdm/flowstate-app-frameworkServer config hook

Routes:

  • / - Server list with CRUD operations

Feature: Active Server Selection

PropertyDetails
IDactive-server
StatusImplemented
PriorityHigh

Description: Set one server as the active server for replication. The active server is used by all FlowState apps for data synchronization.

User Story: As a user, I want to set an active server so that my data syncs with the correct backend.

Acceptance Criteria:

  • [x] Set any configured server as active
  • [x] Visual indicator (star icon) for active server
  • [x] Status badge showing active/inactive state
  • [x] Cannot delete the currently active server

Implementation:

ComponentPathPurpose
ServersPagesrc/pages/ServersPage.tsxActive server controls
StatusBarsrc/ServersApp.tsxMode and server count display

Feature: Connection Testing

PropertyDetails
IDconnection-test
StatusImplemented
PriorityMedium

Description: Test server connectivity before saving or activating a server configuration.

User Story: As a developer, I want to test server connections so that I can verify my configuration is correct.

Acceptance Criteria:

  • [x] Test connection button in server dialog
  • [x] Success/failure feedback
  • [x] Connection test before save

Implementation:

ComponentPathPurpose
ServerConfigDialog@epicdm/flowstate-app-frameworkTest connection UI
useServerConfig.testConnection@epicdm/flowstate-app-frameworkConnection test logic

Category 2: Authentication

Server authentication and token management

Feature: Email Verification Login

PropertyDetails
IDemail-login
StatusImplemented
PriorityHigh

Description: Authenticate with a server using email verification. A verification code is sent to the user's email, which is then entered to complete authentication.

User Story: As a user, I want to authenticate with a server so that I can sync my data securely.

Acceptance Criteria:

  • [x] Navigate to server-specific login page
  • [x] Enter email address
  • [x] Receive verification code via email
  • [x] Enter code to complete authentication
  • [x] Store JWT token in server configuration

Implementation:

ComponentPathPurpose
LoginPagesrc/pages/LoginPage.tsxLogin flow UI
LoginContentsrc/pages/LoginPage.tsxLogin form wrapper
FlowstateAuthProvider@epicdm/flowstate-app-frameworkAuth context provider
LoginForm@epicdm/flowstate-app-frameworkEmail verification form

Routes:

  • /login/:serverName - Server-specific login page

Feature: Token Management

PropertyDetails
IDtoken-management
StatusImplemented
PriorityHigh

Description: Manage authentication tokens including storage, refresh, and logout functionality.

User Story: As a user, I want my authentication to persist so that I don't have to log in repeatedly.

Acceptance Criteria:

  • [x] Store auth token in server configuration
  • [x] Auto-refresh tokens when expired
  • [x] Logout button to clear authentication
  • [x] Visual indicator for authenticated state

Implementation:

ComponentPathPurpose
LoginPage.handleTokenRefreshsrc/pages/LoginPage.tsxToken refresh callback
ServersPage.handleLogoutsrc/pages/ServersPage.tsxClear auth data
hasValidAuthsrc/pages/ServersPage.tsxCheck auth validity

Category 3: User Interface

Visual components and user experience

Feature: Server List Table

PropertyDetails
IDserver-table
StatusImplemented
PriorityHigh

Description: Tabular display of all configured servers with columns for name, URL, database, auth status, and actions.

User Story: As a user, I want to see all my servers in a clear list so that I can manage them easily.

Acceptance Criteria:

  • [x] Table with sortable columns
  • [x] Server name with active indicator
  • [x] Truncated URL display
  • [x] Database name column
  • [x] Auth status with login/logout buttons
  • [x] Action buttons (edit, delete, set active)

Implementation:

ComponentPathPurpose
ServersPage tablesrc/pages/ServersPage.tsxServer list table

Feature: Empty State

PropertyDetails
IDempty-state
StatusImplemented
PriorityLow

Description: Helpful empty state when no servers are configured, guiding users to add their first server.

User Story: As a new user, I want guidance when no servers exist so that I know how to get started.

Acceptance Criteria:

  • [x] Friendly empty state message
  • [x] Add server button prominently displayed
  • [x] Default configuration mention

Implementation:

ComponentPathPurpose
EmptyStatesrc/pages/ServersPage.tsxEmpty state component

Feature: Status Bar

PropertyDetails
IDstatus-bar
StatusImplemented
PriorityLow

Description: Status bar showing current mode, server count, and organization context.

User Story: As a user, I want to see system status so that I understand my current context.

Acceptance Criteria:

  • [x] Display current mode (local/server)
  • [x] Display server count
  • [x] Display current organization

Implementation:

ComponentPathPurpose
StatusBarsrc/ServersApp.tsxStatus display component

Feature: Delete Confirmation

PropertyDetails
IDdelete-confirm
StatusImplemented
PriorityMedium

Description: Confirmation dialog before deleting a server configuration to prevent accidental deletion.

User Story: As a user, I want confirmation before deleting so that I don't accidentally remove servers.

Acceptance Criteria:

  • [x] Modal dialog with server name
  • [x] Cancel and confirm buttons
  • [x] Loading state during deletion

Implementation:

ComponentPathPurpose
DeleteConfirmDialogsrc/pages/ServersPage.tsxDelete confirmation modal

Data Models

Server Configuration

The app manages ServerConfig objects with the following structure:

FieldTypeDescription
idstringUnique identifier
namestringDisplay name for the server
urlstringRxDB server URL
databaseNamestringName of the database
domainIdstringDomain identifier for multi-tenant setups
authTokenstring?JWT authentication token
userIdstring?Authenticated user ID
orgIdstring?Organization ID
replicationEnabledbooleanWhether replication is enabled

Default Configuration

const DEFAULT_SERVER_CONFIG = {
  name: 'flowstate-dev',
  url: 'https://localhost:7443',
  databaseName: 'flowstate-dev',
  domainId: 'flowstate-dev',
  replicationEnabled: true,
};

Data Flow

User Action --> ServersPage --> useServerConfig --> ServerConfigService --> Storage
                    |
                    +--> LoginPage --> FlowstateAuthProvider --> Auth Server
                                              |
                                              +--> updateServer (token storage)

User Workflows

Workflow 1: Add New Server

Configure a new RxDB server connection

Trigger: Click "Add Server" button

Steps:

StepActionComponentOutcome
1Click Add ServerServersPageDialog opens with defaults
2Customize configurationServerConfigDialogFields populated
3Test connection (optional)ServerConfigDialogConnection verified
4Save serveruseServerConfig.addServerServer added to list
5Set as active (optional)ServersPageServer becomes active

Success Outcome: New server configuration saved and ready for use Failure Handling: Validation errors shown, form state preserved


Workflow 2: Authenticate with Server

Log in to a server for data synchronization

Trigger: Click "Login" button on a server row

Steps:

StepActionComponentOutcome
1Click LoginServersPageNavigate to login page
2Enter emailLoginFormEmail submitted
3Check email-Verification code received
4Enter codeLoginFormCode submitted
5Authentication completeLoginPageToken stored, redirect

Success Outcome: Server shows "Authenticated" status, replication enabled Failure Handling: Error message shown, can retry


Workflow 3: Switch Active Server

Change which server is used for replication

Trigger: Click "Set Active" on an inactive server

Steps:

StepActionComponentOutcome
1Click Set ActiveServersPageServer activated
2Previous server deactivateduseServerConfigStatus updated
3UI updatesServersPageNew server shows star

Success Outcome: New server is active, replication switches to it Failure Handling: Connection test before activation (if configured)


Workflow 4: Edit Server Configuration

Modify an existing server's settings

Trigger: Click edit (pencil) icon on a server row

Steps:

StepActionComponentOutcome
1Click edit iconServersPageDialog opens with current values
2Modify fieldsServerConfigDialogValues updated
3Save changesuseServerConfig.updateServerConfiguration persisted

Success Outcome: Server configuration updated Failure Handling: Validation errors shown


Commands & Keybindings

Registered Commands

Command IDTitleCategory
servers.addAdd ServerServers
servers.removeRemove ServerServers
servers.editEdit ServerServers
servers.testConnectionTest ConnectionServers
servers.syncSync NowServers
servers.disconnectDisconnectServers
servers.viewLogsView Sync LogsServers

Keybindings

CommandWindows/LinuxmacOSContext
Add ServerCtrl+NCmd+NactiveApp == servers
Sync NowCtrl+SCmd+SactiveApp == servers && serverSelected
Menu LocationCommands
context.editorservers.testConnection, servers.sync, servers.edit, servers.remove

Architecture Summary

Directory Structure

src/
├── index.ts           # Package exports
├── ServersApp.tsx     # Main app component with routing
├── plugin.ts          # FlowState plugin registration
├── types.ts           # Type re-exports
└── pages/
    ├── ServersPage.tsx  # Server list and management
    └── LoginPage.tsx    # Authentication flow

Key Architectural Patterns

PatternUsageExample
State ManagementFramework hooksuseServerConfig for server state
RoutingReact Router v6Routes for list and login pages
AuthenticationProvider patternFlowstateAuthProvider wraps login
Plugin SystemFlowState pluginsserversPlugin for registration

Framework Dependencies

DependencyPackagePurpose
App Container@epicdm/flowstate-app-frameworkApp shell and routing
Server Config@epicdm/flowstate-app-frameworkuseServerConfig hook
Auth Provider@epicdm/flowstate-app-frameworkFlowstateAuthProvider
UI Components@epicdm/flowstate-app-frameworkButton, ServerConfigDialog
Navigation@epicdm/flowstate-app-frameworkuseNavigation hook

Component Hierarchy

ServersApp
├── FlowstateAppContainer
│   └── ServersAppContent
│       ├── StatusBar
│       └── Routes
│           ├── ServersPage (/)
│           │   ├── LoadingSkeleton
│           │   ├── EmptyState
│           │   ├── Server Table
│           │   ├── ServerConfigDialog
│           │   └── DeleteConfirmDialog
│           └── LoginPage (/login/:serverName)
│               └── FlowstateAuthProvider
│                   └── LoginContent
│                       └── LoginForm

Platform Support

PlatformStatusNotes
Electron (Desktop)SupportedFull functionality
Web (Next.js)SupportedFull functionality
React NativeFutureNot yet implemented

DocumentLocationPurpose
FLOWSTATE.md.flowstate/docs/FLOWSTATE.mdDevelopment workflow
App Frameworkpackages/flowstate-app-frameworkContainer and hooks
Auth Corepackages/flowstate-auth-coreAuthentication services

Version History

VersionDateAuthorChanges
1.0.02026-01-22ClaudeInitial documentation
Previous
Getting Started