Modules
KatanOS is module-driven. Module metadata and enable/disable rules are defined in services/modules.ts.
Registry Contract
interface ModuleDefinition {
id: ModuleId;
labelKey: string;
descriptionKey: string;
icon: LucideIcon;
routes: string[];
widgets: WidgetId[];
dependencies: ModuleId[];
defaultEnabled: boolean;
canDisable: boolean;
}Important rules:
dashboardis always visible (injected nav item, not part ofModuleIdunion)calendaris core (canDisable: false)other modules are controlled through
user.modulesConfigwidget availability is derived from enabled modules plus core widgets
Navigation order (MODULE_NAV_ORDER):
calendar (
agenda)contacts
todo
journal
habits
finance
bookshelf
vault
games
Dashboard
File: pages/Dashboard.tsx
Primary purpose:
home overview combining weather, schedule, favorites, finance summary, quote, and pomodoro
Data sources:
db.events.listdb.transactions.listdb.contacts.listweather services (
getWeather,searchCities,getCityFromCoords)
Widgets and behavior:
clock + greeting block
weather panel with forecast popup and city search
on-this-day ticker (Wikipedia API)
rotating daily quote (
services/quotes.ts)next event card
today events list (opens agenda event)
favorites list with click-to-copy phone/email and contact deep-link
finance mini-summary with recent transactions and deep-link to finance
embedded pomodoro widget
Widget gating:
todayEventsshown only if calendar widgets are availablefavoritesshown only if contacts module is enabledfinance block shown only if finance module is enabled
Persistence and keys:
weather location:
katanos_weather_loc_<userId>
External APIs used directly in page:
https://ipapi.co/json/https://<lang>.wikipedia.org/api/rest_v1/feed/onthisday/events/MM/DD
Agenda (Calendar)
File: pages/Agenda.tsx Route: agenda (module id calendar)
Views:
month
week (hour grid)
day (hour grid)
list (grouped by month)
Core behavior:
create/edit/delete events
drag-and-drop rescheduling in month/week/day views
recurrence generation on create:
daily: 7 instances
weekly: 4 instances
monthly: 6 instances
category-aware coloring and labels via
calendarCategorieslocation search suggestions via
searchPlacesoptional AI event parsing via
parseCalendarEventweather icon overlays per day from saved location
Data model:
uses
CalendarEventrecords inchronos_events
Persistence and keys:
reads
katanos_weather_loc_<userId>for weather overlays
Todo
File: pages/Todo.tsx Route: todo
Submodes:
board: draggable sticky-note tasks
checklist: named checklists with ordered items
Board behavior:
add note in selected color
toggle completion
inline edit
drag/drop absolute position updates
auto-arrange layout
clear completed
Checklist behavior:
create/delete checklist
add/remove/toggle checklist items
item order stored in each checklist item
Data model:
board uses
TodoItem(chronos_todos)checklist uses
Checklist(chronos_checklists)
Finance
File: pages/Finance.tsx Route: finance
Tabs:
overview
transactions
planning
Domains handled:
transactions
budgets
goals
debts
recurring entries
Key behavior:
transaction CRUD (with tags)
recurring autoposting on load
for each recurring rule, generates pending transactions up to today
advances
nextDateusing weekly/monthly/yearly progression
goal contribution workflow (quick and custom)
debt payment workflow
updates debt balance
writes matching expense transaction
CSV export for filtered transactions
analytics charts via
useFinanceChartsAI financial coaching via
askGeminiFinance
Data model:
Transaction(chronos_transactions)FinanceBudget(chronos_finance_budgets)FinanceGoal(chronos_finance_goals)FinanceDebt(chronos_finance_debts)FinanceRecurring(chronos_finance_recurring)
Contacts
File: pages/Contacts.tsx Route: contacts
Core behavior:
contact CRUD
favorite toggle
avatar upload (data URL)
tags and tag filtering
live search by name/email/tag
click-to-copy for phone/email
open external links (socials/web/email)
Data model:
Contact(chronos_contacts)
Habits
File: pages/Habits.tsx Route: habits
Core behavior:
habit CRUD with color
day-level completion (
logs) and skip (skips)skip and log are mutually exclusive for same day
streak calculation respects skips
weekly chart and consistency calculations
achievement system with unlock notifications
Achievement thresholds (from code logic):
habit count milestones (1, 3, 5)
streak milestones (3, 7, 14, 30, 60)
consistency milestones (100% for >=5 and >=14 days)
account age milestones (>=30, >=60 days)
Data model:
Habit(chronos_habits)
Journal
File: pages/Journal.tsx Route: journal
Core behavior:
rich text editor (contenteditable + command API)
emoji sprite insertion with fallback text rendering
mood assignment (default + user-defined moods)
filtering by search and mood tags
autosave/update of normalized HTML content
optional AI analysis (
analyzeJournalEntry) to infer mood + reflection
Data model:
JournalEntry(chronos_journal)User.journalMoodsfor custom moods
Notable implementation detail:
entry
contentis stored as HTML; legacy plain text is normalized on load.
Bookshelf
File: pages/Bookshelf.tsx Route: bookshelf
Statuses:
tobuytoreadread
Core behavior:
add books from Google Books search
add books manually (including uploaded cover image)
duplicate prevention by title+author
rating, notes, start/finish dates
drag-and-drop reorder within
tobuyandtoread(sortOrder)reading statistics and yearly goal tracking
CSV export
Persistence and keys:
reading goal key:
katanos.readingGoal.<userId>
External API:
https://www.googleapis.com/books/v1/volumes
Vault
File: pages/Vault.tsx Route: vault
Core behavior:
first-run setup (create encrypted vault)
unlock with master password
recovery flow with recovery code + password reset
item types: login, note, card
in-session lock (clears decrypted state + master key from component state)
Cryptography operations (service-backed):
create:
createVaultunlock:
unlockVaultrecover:
recoverVaultsave:
saveVaultreset password:
resetVaultPasswordderive session key:
getMasterKey
Data model:
encrypted payload stored in
chronos_vault
Games
File: pages/Games.tsx Route: games
Launcher behavior:
shows game catalog cards
mounts selected game component
Escapeexits active game back to catalog
Implemented games (components/GameModules.tsx):
Snake
Shooter
Breaker
Reflex
TicTacToe
Memory
Miner
Persistence:
game-specific localStorage keys under
katanos_game_*_<userId>
Login and Access Control
File: pages/Login.tsx
Behavior:
login and registration UI
required username/password
registration requires secret question + answer
password reset flow:
load question by username
validate answer
set new password
login language selector persists
katanos_last_login_langsupports custom login background via
katanos_login_bg
Module Extension Checklist
To add a new module safely:
Add module metadata to
services/modules.ts.Add page component under
pages/.Wire page switch in
App.tsx.Add nav labels/translations.
Add or gate widgets in
modulesServiceif needed.Update docs and tests.
Last updated
Was this helpful?
