How jainulabidalam-lgtm/goledger works
GoLedger is a lightweight double-entry bookkeeping web application. An administrator can provision credentials at startup; users then authenticate in the browser, manage accounts, post balanced journal entries, and inspect account ledgers. Journal reversal preserves historical entries, while audit records track key changes. The Go server exposes HTTP endpoints backed by SQLite, with browser views calling those endpoints and an optional exchange-rate service supporting display conversion. The route-registration implementation and ledger-domain source were not excerpted, so some subsystem links remain unverified.
Main entry points: server.go HTTP server and routes · app.js Browser interface · main.go Application bootstrap · db.go SQLite database
Components 16
Server runtime
- Runtime configuration
internal/config/config.go - Application bootstrap
cmd/goledger/main.go - HTTP server and routes
internal/http/server.go - SQLite database
internal/database/db.go
Identity and audit
- Login and access control
internal/http/auth_routes.go - Users and sessions
internal/auth/auth.go - Audit trail
internal/audit/audit.go
Accounting domain
- Account management
internal/http/accounts.go - Journal entries
internal/http/journals.go - Posting and reversal rules
internal/ledger/ledger.go - Account ledger endpoint
internal/http/ledger.go
Web experience
- Embedded web assets
web/web.go - Browser interface
web/js/app.js
Other components
- Administrator
- Bookkeeping user
- Exchange-rate service
Connections 24
- Administrator → Application bootstrap: provisions admin
cmd/goledger/main.go - Application bootstrap → Runtime configuration: loads settings
cmd/goledger/main.go - Application bootstrap → SQLite database: initializes database
cmd/goledger/main.go - Application bootstrap → HTTP server and routes: registers routes
cmd/goledger/main.go - Application bootstrap → HTTP server and routes: serves requests
- HTTP server and routes → Embedded web assets: serves interface
- Bookkeeping user → Browser interface: uses interface
README.md - Browser interface → HTTP server and routes: calls API
- Browser interface → Account management: requests accounts
web/js/app.js - Browser interface → Journal entries: requests journals
web/js/app.js - Browser interface → Account ledger endpoint: requests ledger
web/js/app.js - Browser interface → Exchange-rate service: fetches rates
web/js/app.js - HTTP server and routes → Login and access control: dispatches auth
- Login and access control → Users and sessions: authenticates sessions
internal/http/auth_routes.go - Login and access control → SQLite database: validates sessions
internal/http/auth_routes.go - Account management → SQLite database: reads and writes
internal/http/accounts.go - Account management → Audit trail: records creation
internal/http/accounts.go - Journal entries → Posting and reversal rules: posts or reverses
internal/http/journals.go - Journal entries → SQLite database: reads entries
internal/http/journals.go - Account ledger endpoint → SQLite database: queries ledger
internal/http/ledger.go - Posting and reversal rules → Audit trail: records changes
- HTTP server and routes → Account management: routes requests
- HTTP server and routes → Journal entries: routes requests
- HTTP server and routes → Account ledger endpoint: routes requests