Data Model
ByteBox data is centered on four entities: Category, Card, Tag, and UserSettings.
Entity Summary
Section titled “Entity Summary”Category: board columns withname,color, andorder.Card: content unit with type-specific fields (snippet, bookmark, image, note, etc.).Tag: reusable labels connected to cards through a many-to-many relation.UserSettings: singleton app appearance/preferences record (id = "default").
Card Types
Section titled “Card Types”Supported card type literals:
bookmarksnippetcommanddocimagenote
All are stored in the same Card table, with optional fields used based on type.
Relationship Map
Section titled “Relationship Map”- One
Categoryhas manyCard. - One
Cardbelongs to oneCategory. - Many
Cardcan have manyTag. UserSettingsis standalone singleton data.
Ordering Strategy
Section titled “Ordering Strategy”- Categories have an integer
order. - Cards have an integer
orderscoped by category. - Drag/drop operations persist order through
PATCH /api/cardsbulk updates.
Defaults and Bootstrapping
Section titled “Defaults and Bootstrapping”On empty databases, ByteBox auto-creates default categories in getBoardData():
- Frontend
- Backend
- DevOps
- Learning & Research
- Ideas & Inspiration
Portability Caveat
Section titled “Portability Caveat”Current export/import API focuses on core fields and tags. Rich card fields like imageData, fileData, and starred are not included in exported payloads yet.
If you need bit-for-bit full-fidelity backup, snapshot the SQLite database file directly.
Source of Truth
Section titled “Source of Truth”- Prisma schema:
prisma/schema.prisma - Query helpers:
src/lib/db/queries.ts - Domain types:
src/types/indev.ts