Dependencies
moon update
make serve| Method | Path | Description |
|---|---|---|
| GET | /api/accounts | List all accounts |
| POST | /api/accounts | Create an account ({"name": "...", "account_type": "..."}) |
| DELETE | /api/accounts/:id | Delete an account |
| GET | /api/categories | List all categories |
| GET | /api/transactions | List all transactions |
| POST | /api/transactions | Create a transaction ({"account_id", "category_id", "amount", "txn_type", "description", "date"}) |
| DELETE | /api/transactions/:id | Delete a transaction |
| GET | /api/budgets/:month | List budgets for a month (e.g. 2026-03) |
| POST | /api/budgets | Create or update a budget ({"category_id", "amount_limit", "month"}) |
| DELETE | /api/budgets/:id | Delete a budget |
| GET | /api/dashboard/:month | Get aggregated dashboard data for a month |
shared/ # Isomorphic code (both js and native)
types.mbt # Account, Transaction, Category, Budget, DashboardData
routes.mbt # API path constants and builders
logic.mbt # Financial formatting, computation, validation
backend/
main.mbt # Mocket HTTP server, route handlers, HTML shell
db.mbt # SQLite3 schema, CRUD, seed categories, dashboard query
frontend/
main.mbt # Rabbita app entry point
app/
types.mbt # Model, Msg, Page enum (Dashboard, Transactions, Accounts, Budgets)
update.mbt # State transitions and HTTP commands
view.mbt # Top-level layout and navigation
view_dashboard.mbt # Dashboard page (balances, summary, budgets, spending)
view_transactions.mbt # Transaction list and form
view_accounts.mbt # Account list and form
view_budgets.mbt # Budget list and form
public/ # Build output for frontend JS
moon.mod.json # Module config and dependencies
Makefile # Build and run commandsgraph LR
subgraph Browser
FE["Frontend (JS)<br/>Rabbita MVU"]
end
subgraph Server
BE["Backend (Native)<br/>Mocket HTTP"]
DB[(SQLite<br/>finapp.db)]
end
subgraph Shared
S["shared/<br/>Types, Routes,<br/>Logic, Validation"]
end
FE <-->|REST API<br/>JSON| BE
BE <--> DB
S -.->|compiled to js| FE
S -.->|compiled to native| BEgraph TD
UA["User Action<br/>(click, input, navigate)"] --> Msg
Msg --> Update["Model::update()<br/>returns (Model, Cmd)"]
Update --> Model
Update --> Cmd
Model --> View["view()<br/>returns HTML"]
View --> HTML["Virtual DOM"]
HTML --> UA
Cmd -->|"@http.get, post, delete"| API["REST API<br/>Accounts, Transactions,<br/>Budgets, Dashboard"]
API -->|"JSON response"| RMsg["Response Msg<br/>(GotDashboard, GotAccounts,<br/>TransactionCreated, ...)"]
RMsg --> Msggraph TD
subgraph "frontend/ (target: js)"
FM["frontend/main.mbt"]
FA["frontend/app/<br/>types, update, view_*"]
end
subgraph "backend/ (target: native)"
BM["backend/main.mbt"]
BD["backend/db.mbt"]
end
subgraph "shared/ (target: js + native)"
ST["types.mbt<br/>Account, Transaction,<br/>Category, Budget, ..."]
SR["routes.mbt"]
SL["logic.mbt<br/>format_amount, compute_balance,<br/>validate_transaction, ..."]
end
FM --> FA
FA --> ST
FA --> SR
FA --> SL
FA --> Rabbita["rabbita<br/>(MVU + HTML + HTTP)"]
BM --> BD
BM --> ST
BM --> SR
BM --> SL
BM --> Mocket["mocket<br/>(HTTP server)"]
BD --> SQLite3["sqlite3<br/>(persistence)"]erDiagram
Account {
Int id PK
String name
AccountType account_type
}
Category {
Int id PK
String name
String icon
String color
TransactionType cat_type
}
Transaction {
Int id PK
Int account_id FK
Int category_id FK
Int amount
TransactionType txn_type
String description
String date
}
Budget {
Int id PK
Int category_id FK
Int amount_limit
String month
}
Account ||--o{ Transaction : "has"
Category ||--o{ Transaction : "classifies"
Category ||--o{ Budget : "limits"Install
Download zipDependencies