Core Concepts
Data Model
Section titled “Data Model”ByteBox centers around four main entities:
- Category: board columns (e.g. Frontend, Backend, DevOps)
- Card: saved resource item (
bookmark,snippet,command,doc,image,note) - Tag: reusable labels for filtering and discovery
- UserSettings: singleton record for appearance/theme preferences
Card Types
Section titled “Card Types”All card types share one table and differ by field usage:
bookmark:contentstores URLsnippet:content+languagecommand: command text, optional languagedoc: text content plus optional uploaded file fieldsimage:imageDatabase64 payloadnote: free-form text
Board Interaction
Section titled “Board Interaction”- Drag/drop uses
@dnd-kit - Reordering persists through
PATCH /api/cardsbulk update - Category rename/delete is inline on dashboard and on Categories page
- Star toggle is per-card (
PATCH /api/cards/[id]withaction: "toggleStar")
Search + View Modes
Section titled “Search + View Modes”useSearch combines:
- text search across title/description/content/tags
- tag filtering with
ANDorOR - view modes:
all,recent,starred,by-tag
View mode is persisted in localStorage under bytebox-view-mode.
Theme System
Section titled “Theme System”The theme engine uses CSS custom properties and persists to DB + localStorage:
- light/dark mode
- glass intensity
- accent palette
- icon palette + custom icon color
- background config (solid/gradient/image/default)
- UI and mono font choices
- saved settings presets
Core implementation lives in ThemeContext + themeRegistry + globals.css tokens.
Persistence Strategy
Section titled “Persistence Strategy”- Primary persistence: SQLite via Prisma
- Fast hydration layer: localStorage
- API-backed settings sync: debounced writes to
/api/settings
This dual-layer approach gives fast startup feel while keeping durable server-side state.