Life OS
A personal productivity command center that unifies habits, learning, projects, goals, and career growth into one intelligent system.
The Challenge
The core engineering challenge was designing a relational schema that spans 10 distinct life domains — learning, projects, goals, content, habits, networking, scheduling, reflections, skills, and analytics — without becoming a tangled mess of nullable foreign keys. The schema uses domain-bounded models with a user-centric ownership pattern and indexed junction tables, enabling performant queries like what is my average learning session duration in weeks where I hit 80% or more of my habits. The second major challenge was keeping the UI instantly responsive despite heavy server-side data fetching. The solution was React 19 useOptimistic hook for immediate local feedback on habit toggles and completions, combined with Next.js Server Actions for mutations. Building the AI coaching layer required a careful context-construction strategy. The architecture compresses user state into a structured context object and passes only the relevant slice to the model based on which domain the user is chatting from.
Architectural Decisions
Domain-bounded Prisma schema with 50+ models
Each life domain (learning, projects, goals, habits, network, etc.) has its own set of strongly-typed Prisma models with proper relationships, enums, and indexes. This enables relational queries across domains for the insights dashboard — correlating habit streaks with learning output.
Next.js Server Actions over REST API
All mutations use Next.js Server Actions with revalidatePath() rather than a traditional REST API layer. Each action runs server-side with direct Prisma access, validates input with Zod, and invalidates only the affected cache paths.
useOptimistic for instant habit feedback
Habit completion is the most frequent interaction in the app. Using React 19 useOptimistic hook, toggling a habit updates the UI instantly before the server action resolves, then reconciles with the actual server state.
Compressed context injection for AI coaching
The AI chat widget uses a context-type routing system: when the user opens the chat from the Learning page, the context object injected into the system prompt contains active resources, recent sessions, and skill gaps — not project timelines or content ideas.
Kawkab custom design system over off-the-shelf UI kits
Rather than using a component library end-to-end, the project implements a custom design language built on Radix UI primitives. The system defines precise typographic scales, a minimal palette anchored by lime (#C4F041) as the accent, and glass morphism for the mobile nav dock.
HMAC-SHA256 custom session auth for solo-user context
Instead of configuring a full OAuth provider in early development, the auth layer uses custom HMAC-SHA256 signed session tokens with expiration checks. A dev-mode fallback auto-authenticates as a default user, eliminating login friction during rapid iteration.