Coodeen
Architecture

Database

SQLite database schema and data storage in Coodeen.

Overview

Coodeen uses SQLite via Prisma ORM for all persistent data storage. The database file lives at ~/.coodeen/data.db and is created automatically on first run.

Schema

Session

Stores chat sessions with their configuration.

FieldTypeDescription
idStringUnique identifier
titleStringSession title
providerIdString?Active AI provider
modelIdString?Active model
projectDirString?Project directory path
previewUrlString?Preview panel URL
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast update timestamp

Message

Stores individual chat messages within sessions.

FieldTypeDescription
idStringUnique identifier
sessionIdStringParent session ID
roleStringuser, assistant, or system
contentStringMessage content
imagesString?Attached image data
createdAtDateTimeCreation timestamp

Provider

Stores AI provider configurations and API keys.

FieldTypeDescription
idStringProvider slug (e.g. openai)
apiKeyStringEncrypted API key
modelIdString?Default model for this provider
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast update timestamp

Config

Key-value store for application settings.

FieldTypeDescription
keyStringSetting key
valueStringSetting value
updatedAtDateTimeLast update timestamp

Migrations

Prisma migrations run automatically when Coodeen starts. The CLI handles database initialization and schema updates transparently.

Reset

To reset all data, delete the database file:

rm ~/.coodeen/data.db
npx coodeen

A fresh database will be created on the next launch.