How moon-chm/collabsphere works
CollabSphere is a local-first team collaboration platform: Android users authenticate and work across workspaces, messaging, tasks, notes, and files, with local data and background synchronization supporting offline use. The Ktor backend serves the client, persists shared state, and supports real-time communication and integrations. The graph combines the README’s documented workflow and capabilities with sampled source and the SOURCE INDEX; several feature implementations were not sampled, so their internal links are documented at subsystem level rather than inferred in detail.
Main entry points: MainActivity.kt Compose app · model Feature repositories · Routing.kt REST and feature routes · main.kt Ktor server
Components 24
Android client
- Compose app
collabsphere_app/app/src/main/java/com/collabsphere/app/MainActivity.kt - Authentication
collabsphere_app/app/src/main/java/com/collabsphere/app/view/LoginScreen.kt - Workspaces
collabsphere_app/app/src/main/java/com/collabsphere/app/view/WorkspaceUI - Channels and DMs
collabsphere_app/app/src/main/java/com/collabsphere/app/view/dmUI/DMScreen.kt - Tasks and notes
collabsphere_app/app/src/main/java/com/collabsphere/app/view/TaskUI/TaskScreen.kt - File sharing
collabsphere_app/app/src/main/java/com/collabsphere/app/view/FileUI/FileScreen.kt - Profiles and search
collabsphere_app/app/src/main/java/com/collabsphere/app/view/UserUI/UserSearchScreen.kt - Notifications
collabsphere_app/app/src/main/java/com/collabsphere/app/remote/fcm/CollabFirebaseMessagingService.kt - REST APIs
collabsphere_app/app/src/main/java/com/collabsphere/app/remote - DM WebSocket
collabsphere_app/app/src/main/java/com/collabsphere/app/remote/dm/DmWebSocketService.kt
Local data and sync
- Room data
collabsphere_app/app/src/main/java/com/collabsphere/app/model/AppDatabase.kt - Feature repositories
collabsphere_app/app/src/main/java/com/collabsphere/app/model - Background sync
collabsphere_app/app/src/main/java/com/collabsphere/app/model/workspace/WorkspaceSyncWorker.kt - Delta sync
collabsphere_app/app/src/main/java/com/collabsphere/app/remote/SyncPage.kt
Backend services
- Ktor server
collabsphere_server/src/main/kotlin/main.kt - REST and feature routes
collabsphere_server/src/main/kotlin/plugins/Routing.kt - WebSocket broker
collabsphere_server/src/main/kotlin/plugins/WebSocketBroker.kt - PostgreSQL
collabsphere_server/src/main/kotlin/DatabaseFactory.kt - Uploaded files
collabsphere_server/src/main/kotlin/plugins/UploadStaging.kt - Link previews
collabsphere_server/src/main/kotlin/util/LinkPreviewService.kt
External integrations
- GitHub integration
collabsphere_server/src/main/kotlin/plugins/GitHubRoutes.kt - GitHub services
collabsphere_server/src/main/kotlin/util/GitHubService.kt
Other components
- Team member
- PostgreSQL service
Connections 30
- Team member → Compose app: uses
- Compose app → Authentication: opens
- Compose app → Workspaces: opens
- Compose app → Channels and DMs: opens
- Compose app → Tasks and notes: opens
- Compose app → File sharing: opens
- Compose app → Profiles and search: opens
- Compose app → Notifications: receives
- Authentication → Feature repositories: uses
- Workspaces → Feature repositories: uses
- Channels and DMs → Feature repositories: uses
- Tasks and notes → Feature repositories: uses
- File sharing → Feature repositories: uses
- Feature repositories → Room data: reads and writes
- Feature repositories → Background sync: enqueues retries
- Feature repositories → REST APIs: calls
collabsphere_app/app/src/main/java/com/collabsphere/app/remote/dm/DmWebSocketService.kt - Background sync → REST APIs: syncs through
- REST APIs → Delta sync: uses cursors
collabsphere_app/app/src/main/java/com/collabsphere/app/remote/SyncPage.kt - Channels and DMs → DM WebSocket: uses
- REST APIs → Ktor server: calls REST
- DM WebSocket → WebSocket broker: connects
- Ktor server → REST and feature routes: registers routes
collabsphere_server/src/main/kotlin/main.kt - REST and feature routes → PostgreSQL: queries
- Ktor server → WebSocket broker: configures
collabsphere_server/src/main/kotlin/main.kt - Ktor server → PostgreSQL service: connects
- REST and feature routes → Uploaded files: stages uploads
- REST and feature routes → GitHub integration: routes GitHub features
collabsphere_server/src/main/kotlin/plugins/Routing.kt - GitHub integration → GitHub services: calls
collabsphere_server/src/main/kotlin/plugins/GitHubRoutes.kt - REST and feature routes → Link previews: uses
collabsphere_server/src/main/kotlin/plugins/Routing.kt - Notifications → Ktor server: receives pushes