Skip to main content
Yjs CRDT • IndexedDB • PartyKit Serverless
Overview

Why Nexos was built

Nexos is an offline-first productivity app for developers. It combines daily habit tracking and personal growth with technical workflows like GitHub-linked Kanban boards and automated standup notes. All state stays on your device.

0 ms Local write latency Mutations save to browser IndexedDB without waiting on a server.
100% Offline availability Full access and editing with zero network connection.
3 Tiers Sync hierarchy BroadcastChannel between tabs, WebRTC between peers, PartyKit for signaling.
0 Remote database Your personal tasks and habits are never uploaded to a cloud DB.
Friction 01
Cloud latency and spinners

Web apps that require network round-trips for basic status changes freeze on bad Wi-Fi. Nexos writes locally first, so edits are immediate.

Friction 02
Data privacy

Personal habits, PR discussions, and daily standups don't need to live on corporate servers. Data ownership remains entirely with you.

Friction 03
Split tool fatigue

Engineers track sprint tasks in Jira, habits in mobile apps, and notes in scratchpads. Nexos places both personal and engineering workflows under one roof.

Core principle: Keep data local by default. Use the network only to sync between your own browser tabs and paired devices.
Stack

Capabilities and technology stack

Nexos runs as a single-page React app with a Gruvbox-inspired color scheme. An ephemeral PartyKit worker handles WebSocket signaling and AI proxying.

Layer Technology Purpose Status
Frontend UI React 18, Vite, Tailwind CSS Gruvbox palette, keyboard navigation, drag-and-drop via @dnd-kit Verified
CRDT State Yjs (y-indexeddb, y-webrtc) Conflict-free state resolution, binary vector updates, local storage Verified
Signaling Server PartyKit Serverless WebRTC handshake relay and streaming proxy for OpenRouter and Gemini Shelved
PWA Caching vite-plugin-pwa Offline static asset caching and ServiceWorker registration Verified
Mode 1
Developer Mode

Focuses on technical execution: Kanban tasks linked to GitHub PRs, automated daily standup generator, command-line snippet manager, and sprint countdowns.

Mode 2
User Mode

Focuses on personal growth: 365-day habit heatmaps, skill portfolios, quick notes bank, and XP leveling based on completed items.

Formulas

XP and habit streak math

Nexos calculates experience points directly from task completion and active habit streaks. These formulas were verified in test epics NEX-4 and NEX-5.

Task XP values

Points depend on task priority:

XP FORMULA
High Priority    = 50 XP
Medium Priority  = 25 XP
Low Priority     = 10 XP
Habit Check-in   = 15 XP + (Streak_Days × 2 XP)
Level progression curve

Levels scale quadratically with total points:

LEVEL FORMULA
Level = floor(sqrt(Total_XP / 100)) + 1
Next_Threshold = (Level^2) × 100
Current_Base   = ((Level - 1)^2) × 100
Architecture 01

01. CRDT state resolution

Conflict-Free Replicated Data Types let multiple browser tabs and devices edit tasks concurrently. Edits merge deterministically without overwriting each other.

DIAG-01 CRDT state resolution and Yjs doc
CRDT state diagram
tasks-context.tsx
import * as Y from 'yjs';
import { IndexeddbPersistence } from 'y-indexeddb';

export const ydoc = new Y.Doc();
export const yTasks = ydoc.getArray('tasks');

const provider = new IndexeddbPersistence('nexos-tasks-db', ydoc);

yTasks.observeDeep(() => {
  const tasks = yTasks.toArray().map(t => t.toJSON());
  updateLocalState(tasks);
});
Architecture 02

02. IndexedDB offline persistence

The client stores Yjs binary updates in IndexedDB via y-indexeddb. When you open Nexos, it reads straight from disk, loading your dashboard instantly.

DIAG-02 IndexedDB storage pipeline
IndexedDB storage diagram

Primary local stores:

  • nexos-tasks-db: IndexedDB binary updates for all tasks and columns.
  • nexos-habits-db: Daily habit check-ins and streak logs.
  • app-mode-preference: LocalStorage flag for active workspace (Developer or User).
Architecture 03

03. WebRTC mesh and PartyKit signaling

Peer-to-peer sync between devices uses WebRTC data channels. A PartyKit serverless worker relays the initial SDP handshake messages, then lets the devices talk directly.

DIAG-03 Yjs protocol and edge signaling
Yjs binary protocol diagram
server.ts (PartyKit relay)
export default class SignalingServer implements Party.Server {
  onMessage(msg: string, sender: Party.Connection) {
    const data = JSON.parse(msg);
    if (data.type === 'publish') {
      // Must exclude sender to prevent echo loops
      this.party.broadcast(msg, [sender.id]);
    }
  }
}
Architecture 04

04. Dual workspace boundaries

To prevent mixing code deadlines with personal routines, Nexos splits the UI via AppModeContext. Toggling modes switches visible views while keeping data contexts loaded in memory.

Developer Mode
Engineering focus

Kanban board with GitHub PR blocking flags, automated standup generator producing markdown notes, and CLI snippet repository.

User Mode
Daily life & habits

Yearly habit contribution heatmap, skill portfolio leveling, goal progress tracking, and personal notes bank.

Architecture 05

05. Context-aware AI assistant

A slide-over chat drawer sends your current task titles and priorities to Gemini or OpenRouter through an edge proxy. When the assistant suggests a change, the client executes it safely.

Client-side action loop

The remote model has no direct database access. When the assistant responds with an action block, the browser verifies the payload and updates the local Yjs document:

Action block example
<action type="create_task">
{
  "title": "Update PartyKit signaling relay",
  "priority": "High",
  "category": "Work"
}
</action>
Security

Security model and audit notes

Comparing the local-first approach to traditional cloud SaaS tools, along with known limitations from our code review.

Area Cloud SaaS (Notion / Jira) Nexos Local-First
Data location Remote vendor database Local browser IndexedDB
Offline support Limited or blocks edits 100% functional offline
Analytics scripts Telemetry and session recordings No tracking scripts
Data backup CSV or proprietary export Raw JSON import and export
Known constraints before production:
  • CORS: The development PartyKit proxy uses * for origins. It needs an explicit origin whitelist.
  • GitHub token: The PAT for PR blocking is accessed client-side. A server-side OAuth flow is cleaner.
  • Secret in git history: Commit 004128a contains a test API key that must be rewritten with git-filter-repo before making the repository public.
Sandbox

Interactive XP simulator

Test how task completions and habit streaks calculate total XP and determine character level in Nexos.

XP calculation test Live calculation
0 Total XP
Lv. 1 Level
0 XP Next tier
1.28x Streak bonus
Progress to next level 0%
Post-Mortem

Engineering learnings and trade-offs

Practical lessons learned while restructuring the codebase and porting the signaling backend to PartyKit:

Lesson 01
Handshakes vs protocol compliance

A WebSocket handshake returning HTTP 101 does not mean your sync logic works. PartyKit needed strict compliance with y-webrtc message types (subscribe, publish, ping).

Lesson 02
Dropping the sender in WebRTC pub/sub

When broadcasting updates, the signaling relay must filter out the sender connection. Otherwise, clients process their own updates twice in an echo loop.

Lesson 03
Tunneling the Vite dev server

Testing on a phone through ngrok or Cloudflare tunnels failed because localhost on the phone resolved to itself. Adding server.allowedHosts: true solved it.

Lesson 04
Vite preview proxy difference

Proxy settings in server.proxy do not apply to vite preview. You must duplicate them under preview.proxy to test production builds locally.

Lesson 05
Hybrid HTTP and WebSocket worker

PartyKit handles standard HTTP onFetch alongside WebSockets. This let us keep the Express-style request format for /api/chat without a separate node process.

Lesson 06
Linux IDE font manager crash

Ubuntu's fonts-symbola package triggered a known Java X11FontManager bug that crashed WebStorm silently on startup. Purging the package fixed it.

Current status: The project was shelved on 2026-10-08 after the PartyKit build stalled on @cloudflare/workerd-linux-64. All components and characterization tests remain intact for future pickup.