Zentro
Zentro is an enterprise-grade, high-performance "Second Brain" workspace engineered for mapping complex thought architectures, interactive semantic knowledge graphs, and real-time collaborative context exploration using Yjs CRDTs, vector embeddings, and an atomic quota telemetry system.

Overview
Zentro was engineered to explore solutions for concurrent document synchronization and strict spatial data boundaries within real-time architectures. The goal was to build a fluid note orchestration tool capable of handling overlapping node updates without state collisions, alongside a context-sandboxed AI copilot that respects strict transactional daily operational credit loops for both anonymous guests and authenticated sessions.
Highlights
- Built on Next.js 16 App Router using Turbopack compilation pathways for optimized performance
- Real-time document synchronization via Yjs CRDTs on a custom asynchronous Supabase transport broker
- Fully interactive, dynamic 2D force-directed knowledge web utilizing react-force-graph-2d
- Knowledge Copilot chat api stream leveraging gpt-4o-mini inside an isolated context system sandbox
- Atomic, transactional quota telemetry pipeline running serialized PostgreSQL RPC functions with event-driven sync
- Markdown link-parsing typewriter engine preventing raw text syntax flashes during streaming packages
- Timezone-locked quota guardrails (Europe/Istanbul offset) enforcing synchronized reset intervals right at local midnight
Features
Collision-Free Asynchronous Sync Architecture
Utilizes Yjs CRDTs integrated over a custom Supabase transport broker layer to achieve continuous mathematical state convergence across geographically distributed clients. Users can simultaneously co-author nodes on the Tiptap rich text canvas with instantaneous micro-update propagation.
Semantic Mapping via 2D Force Graphs
Visualizes complex thought layout files natively as a interconnected database grid. The interface dynamically updates a 2D force-directed node web, reflecting real-time alterations to link topologies and tags while maintaining stable spatial orientations.
Link-Parsing Streaming Typewriter Engine
Features a specialized parsing layout inside the AI chat interface that pre-scans incoming stream buffers for incomplete markdown links. It pauses character increments until closing paren characters are confirmed over the network, fully eliminating raw syntax flashing for structural layout components.
Isolated System Prompt Sandboxing
The Knowledge Copilot API aggregates library manifests, active note configurations, and vector-matched document fragments into guarded operational blocks. It programmatically intercepts out-of-bounds queries, enforcing zero-tolerance constraints against unrelated history, general logic, or trivia topics.
Transactional Quota Tracking & Dispatch
Enforces operational guardrails through serialized RPC queries that verify credit ledgers before initiating vector inference blocks. On deduction, post-flight snapshots trigger local event broadcasts that instantly update the sidebar usage meters across active workspace viewports.
Technical Deep Dive
Supabase CRDT Custom Transport Brokerage
Rather than relying on persistent, heavy centralized server states, document mutations are computed locally via Yjs memory buffers and streamed over an ephemeral Supabase update pipeline, offloading continuous persistence tasks safely to a highly tuned PostgreSQL row engine.
Row-Level Security & Remote Embedding Queries
Data access layers are completely locked down by mapping active session metrics to PostgreSQL RLS policies. Semantic discovery relies on custom match_notes RPC triggers querying high-density vector rows based on structural similarity matrices.
Custom Event-Driven Global Metrics Sync
Upon successful token verification, server actions dispatch a definitive post-deduction ledger state back to the UI. The layout fires a zentro:quota-update event, which causes separate interactive layout shells to reactively synchronize displayed credit balances.
Timezone-Locked Midnight Resets
To shield usage cycles from hosting server drift, reset evaluations compute precise local timestamp strings matching the Europe/Istanbul offset (UTC+3). These boundaries are validated against localized date indicators stored inside structural telemetry records.
Challenges & Solutions
Preventing UI Syntax Flashes from Streaming Payloads
Problem: Streaming raw markdown chunks into standard typewriter states caused incomplete URLs and parenthesis markup to appear briefly as unstyled text before rendering as functional links.
Solution: Implemented a markdown link-parsing buffer layer that halts text increments the moment an opening link signature is caught, releasing the fully hydrated link component only when the closing token bounds are verified.
Securing Resource Budgets Against Infinite Loop Drainage
Problem: Asynchronous UI designs run the risk of race-conditions where rapid, concurrent client requests could trigger multiple backend AI actions before initial deductions finish saving.
Solution: Created a serialized check_and_increment_ai_credits database function that acts as an atomic lock, combining evaluation and credit deduction inside a single database transaction while forcing immediate UI inputs to step down on limit exhaust.
Confining LLM Scopes Strictly to Workspace Boundaries
Problem: Standard system definitions can easily be circumvented by prompt injection techniques, leading to out-of-bounds compute usage for non-workspace questions.
Solution: Structured an isolated multi-context layout block inside the api routing middleware that encapsulates data using explicit XML wrapper layouts, backed by a programmatic refusal directive that catches irrelevant tokens immediately.
Ensuring Layout Fluidity Across Large Note Collections
Problem: Iterating through vast structural indices to populate visual layouts or historical chat memory trees introduced noticeable interface latency on portable viewports.
Solution: Leveraged Next.js Server Components to stream initial workspace shells instantly, while mapping secondary node charts to lightweight lazy arrays that only mount when entering explicit layout boundaries.
Tech & Tools
Gallery
Other Projects

Code & Tech
A headless, API-driven tech blog that combines WordPress content management with a Next.js 16 frontend. It delivers a clean, fast, developer-focused reading experience with advanced search, interviews, and a projects showcase.

GitHub Mutuals
A GitHub network analysis tool that reveals mutual followers, one-way connections, and follower insights. Works anonymously or with GitHub OAuth for enhanced features.

Portfolio Website
A high-performance developer portfolio showcasing modern web development skills with Next.js, TypeScript, a Markdown blog, SEO automation, and a dynamic project system.
You want to collaborate?
Drop a message using the form below, or feel free to reach out directly at hi@halilyesilyurt.com