Servers App
Features & Capabilities
Servers App - Features & Capabilities Report
Template Version: 1.0.0 Generated: 2026-01-22 Package:
@epicdm/flowstate-app-serversApp ID:servers
Table of Contents
- Overview
- App Identity
- Feature Categories
- Data Models
- User Workflows
- Commands & Keybindings
- 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 Type | Description | Primary Use Cases |
|---|---|---|
| Developers | Build and test FlowState apps | Configure dev servers, test connections |
| Administrators | Manage server infrastructure | Add production servers, manage authentication |
| End Users | Use FlowState applications | Authenticate, 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
| Property | Value |
|---|---|
| ID | servers |
| Display Name | Servers |
| Package Name | @epicdm/flowstate-app-servers |
| Version | 1.0.0 |
| Category | settings |
| Icon | server |
| Color | #F59E0B |
| Base Path | /apps/servers |
| Permissions | storage, network |
Entry Points
| Entry Point | Path | Description |
|---|---|---|
| Main Export | src/index.ts | Primary package export |
| App Component | src/ServersApp.tsx | Main React component with routing |
| Plugin | src/plugin.ts | FlowState plugin registration |
Feature Categories
Category 1: Server Configuration Management
Core CRUD operations for server configurations
Feature: Server CRUD Operations
| Property | Details |
|---|---|
| ID | server-crud |
| Status | Implemented |
| Priority | High |
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:
| Component | Path | Purpose |
|---|---|---|
| ServersPage | src/pages/ServersPage.tsx | Main server management UI |
| ServerConfigDialog | @epicdm/flowstate-app-framework | Add/edit dialog |
| useServerConfig | @epicdm/flowstate-app-framework | Server config hook |
Routes:
/- Server list with CRUD operations
Feature: Active Server Selection
| Property | Details |
|---|---|
| ID | active-server |
| Status | Implemented |
| Priority | High |
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:
| Component | Path | Purpose |
|---|---|---|
| ServersPage | src/pages/ServersPage.tsx | Active server controls |
| StatusBar | src/ServersApp.tsx | Mode and server count display |
Feature: Connection Testing
| Property | Details |
|---|---|
| ID | connection-test |
| Status | Implemented |
| Priority | Medium |
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:
| Component | Path | Purpose |
|---|---|---|
| ServerConfigDialog | @epicdm/flowstate-app-framework | Test connection UI |
| useServerConfig.testConnection | @epicdm/flowstate-app-framework | Connection test logic |
Category 2: Authentication
Server authentication and token management
Feature: Email Verification Login
| Property | Details |
|---|---|
| ID | email-login |
| Status | Implemented |
| Priority | High |
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:
| Component | Path | Purpose |
|---|---|---|
| LoginPage | src/pages/LoginPage.tsx | Login flow UI |
| LoginContent | src/pages/LoginPage.tsx | Login form wrapper |
| FlowstateAuthProvider | @epicdm/flowstate-app-framework | Auth context provider |
| LoginForm | @epicdm/flowstate-app-framework | Email verification form |
Routes:
/login/:serverName- Server-specific login page
Feature: Token Management
| Property | Details |
|---|---|
| ID | token-management |
| Status | Implemented |
| Priority | High |
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:
| Component | Path | Purpose |
|---|---|---|
| LoginPage.handleTokenRefresh | src/pages/LoginPage.tsx | Token refresh callback |
| ServersPage.handleLogout | src/pages/ServersPage.tsx | Clear auth data |
| hasValidAuth | src/pages/ServersPage.tsx | Check auth validity |
Category 3: User Interface
Visual components and user experience
Feature: Server List Table
| Property | Details |
|---|---|
| ID | server-table |
| Status | Implemented |
| Priority | High |
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:
| Component | Path | Purpose |
|---|---|---|
| ServersPage table | src/pages/ServersPage.tsx | Server list table |
Feature: Empty State
| Property | Details |
|---|---|
| ID | empty-state |
| Status | Implemented |
| Priority | Low |
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:
| Component | Path | Purpose |
|---|---|---|
| EmptyState | src/pages/ServersPage.tsx | Empty state component |
Feature: Status Bar
| Property | Details |
|---|---|
| ID | status-bar |
| Status | Implemented |
| Priority | Low |
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:
| Component | Path | Purpose |
|---|---|---|
| StatusBar | src/ServersApp.tsx | Status display component |
Feature: Delete Confirmation
| Property | Details |
|---|---|
| ID | delete-confirm |
| Status | Implemented |
| Priority | Medium |
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:
| Component | Path | Purpose |
|---|---|---|
| DeleteConfirmDialog | src/pages/ServersPage.tsx | Delete confirmation modal |
Data Models
Server Configuration
The app manages ServerConfig objects with the following structure:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Display name for the server |
url | string | RxDB server URL |
databaseName | string | Name of the database |
domainId | string | Domain identifier for multi-tenant setups |
authToken | string? | JWT authentication token |
userId | string? | Authenticated user ID |
orgId | string? | Organization ID |
replicationEnabled | boolean | Whether 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:
| Step | Action | Component | Outcome |
|---|---|---|---|
| 1 | Click Add Server | ServersPage | Dialog opens with defaults |
| 2 | Customize configuration | ServerConfigDialog | Fields populated |
| 3 | Test connection (optional) | ServerConfigDialog | Connection verified |
| 4 | Save server | useServerConfig.addServer | Server added to list |
| 5 | Set as active (optional) | ServersPage | Server 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:
| Step | Action | Component | Outcome |
|---|---|---|---|
| 1 | Click Login | ServersPage | Navigate to login page |
| 2 | Enter email | LoginForm | Email submitted |
| 3 | Check email | - | Verification code received |
| 4 | Enter code | LoginForm | Code submitted |
| 5 | Authentication complete | LoginPage | Token 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:
| Step | Action | Component | Outcome |
|---|---|---|---|
| 1 | Click Set Active | ServersPage | Server activated |
| 2 | Previous server deactivated | useServerConfig | Status updated |
| 3 | UI updates | ServersPage | New 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:
| Step | Action | Component | Outcome |
|---|---|---|---|
| 1 | Click edit icon | ServersPage | Dialog opens with current values |
| 2 | Modify fields | ServerConfigDialog | Values updated |
| 3 | Save changes | useServerConfig.updateServer | Configuration persisted |
Success Outcome: Server configuration updated Failure Handling: Validation errors shown
Commands & Keybindings
Registered Commands
| Command ID | Title | Category |
|---|---|---|
servers.add | Add Server | Servers |
servers.remove | Remove Server | Servers |
servers.edit | Edit Server | Servers |
servers.testConnection | Test Connection | Servers |
servers.sync | Sync Now | Servers |
servers.disconnect | Disconnect | Servers |
servers.viewLogs | View Sync Logs | Servers |
Keybindings
| Command | Windows/Linux | macOS | Context |
|---|---|---|---|
| Add Server | Ctrl+N | Cmd+N | activeApp == servers |
| Sync Now | Ctrl+S | Cmd+S | activeApp == servers && serverSelected |
Menu Contributions
| Menu Location | Commands |
|---|---|
context.editor | servers.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
| Pattern | Usage | Example |
|---|---|---|
| State Management | Framework hooks | useServerConfig for server state |
| Routing | React Router v6 | Routes for list and login pages |
| Authentication | Provider pattern | FlowstateAuthProvider wraps login |
| Plugin System | FlowState plugins | serversPlugin for registration |
Framework Dependencies
| Dependency | Package | Purpose |
|---|---|---|
| App Container | @epicdm/flowstate-app-framework | App shell and routing |
| Server Config | @epicdm/flowstate-app-framework | useServerConfig hook |
| Auth Provider | @epicdm/flowstate-app-framework | FlowstateAuthProvider |
| UI Components | @epicdm/flowstate-app-framework | Button, ServerConfigDialog |
| Navigation | @epicdm/flowstate-app-framework | useNavigation hook |
Component Hierarchy
ServersApp
├── FlowstateAppContainer
│ └── ServersAppContent
│ ├── StatusBar
│ └── Routes
│ ├── ServersPage (/)
│ │ ├── LoadingSkeleton
│ │ ├── EmptyState
│ │ ├── Server Table
│ │ ├── ServerConfigDialog
│ │ └── DeleteConfirmDialog
│ └── LoginPage (/login/:serverName)
│ └── FlowstateAuthProvider
│ └── LoginContent
│ └── LoginForm
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Electron (Desktop) | Supported | Full functionality |
| Web (Next.js) | Supported | Full functionality |
| React Native | Future | Not yet implemented |
Related Documentation
| Document | Location | Purpose |
|---|---|---|
| FLOWSTATE.md | .flowstate/docs/FLOWSTATE.md | Development workflow |
| App Framework | packages/flowstate-app-framework | Container and hooks |
| Auth Core | packages/flowstate-auth-core | Authentication services |
Version History
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-01-22 | Claude | Initial documentation |