How magomedcoder/kwiki works
KWiki is a Git-backed wiki: users browse, edit, and manage files and pages through its HTTP UI, while administrators can manage accounts and Git clients can clone or push over HTTP. Startup wires the API to use cases, SQLite metadata/auth repositories, Git content storage, and HTML views. README capabilities guide the subsystem map; unsampled handlers and use cases are included only where their paths are explicit, and unsupported internal links are omitted.
Main entry points: handler.go HTTP router · main.go Server startup · page_usecase.go Pages and branches · renderer.go HTML views
Components 23
Runtime entrypoints
- Server startup
cmd/kwiki/main.go - User commands
cmd/kwiki/user.go
HTTP wiki interface
- HTTP router
internal/adapter/httpapi/handler.go - File routes
internal/adapter/httpapi/files.go - Git HTTP routes
internal/adapter/httpapi/githttp.go - Login and users
internal/adapter/httpapi/login.go - Branches, media, SEO
internal/adapter/httpapi
Wiki capabilities
- Pages and branches
internal/usecase/page_usecase.go - File browsing and editing
internal/usecase/files_usecase.go - Media operations
internal/usecase/media_usecase.go - Staged edits
internal/usecase/staging.go - Account and sessions
internal/usecase/user_usecase.go
Persistence adapters
- Git content store
internal/adapter/git/store.go - Git HTTP backend
internal/adapter/git/httpbackend.go - Page and branch index
internal/adapter/sqlite/repository.go - Branch repository
internal/adapter/sqlite/branch.go - Account repositories
internal/adapter/sqlite/auth.go
Rendering and language
- HTML views
internal/adapter/html/renderer.go - Markdown renderer
internal/adapter/markdown/markdown.go - Help content
internal/adapter/html/help.go - Localization
internal/adapter/i18n/i18n.go
Other components
- Wiki user
- Git client
Connections 30
- Wiki user → HTTP router: uses wiki
README.md - Git client → Git HTTP routes: clones and pushes
README.md - Server startup → Git content store: opens repository
cmd/kwiki/main.go - Server startup → Page and branch index: opens database
cmd/kwiki/main.go - Server startup → Account and sessions: initializes auth
cmd/kwiki/main.go - Server startup → HTTP router: registers routes
cmd/kwiki/main.go - Server startup → HTML views: loads views
cmd/kwiki/main.go - Server startup → Localization: loads language
cmd/kwiki/main.go - Server startup → Git HTTP backend: configures Git
cmd/kwiki/main.go - User commands → Account and sessions: manages accounts
cmd/kwiki/user.go - HTTP router → File routes: routes files
internal/adapter/httpapi/handler.go - HTTP router → Git HTTP routes: routes Git
internal/adapter/httpapi/handler.go - HTTP router → Login and users: routes login
internal/adapter/httpapi/handler.go - HTTP router → Branches, media, SEO: registers routes
internal/adapter/httpapi/handler.go - HTTP router → Pages and branches: requests page data
internal/adapter/httpapi/handler.go - HTTP router → HTML views: renders responses
internal/adapter/httpapi/handler.go - File routes → File browsing and editing: handles file actions
internal/adapter/httpapi/files.go - Git HTTP routes → Git HTTP backend: dispatches Git
internal/adapter/httpapi/githttp.go - Login and users → Account and sessions: authenticates users
internal/adapter/httpapi/login.go - Pages and branches → Git content store: reads and writes content
internal/usecase/page_usecase.go - Pages and branches → Page and branch index: indexes pages
internal/usecase/page_usecase.go - Pages and branches → Branch repository: stores branches
- File browsing and editing → Git content store: reads and changes files
internal/usecase/files_usecase.go - File browsing and editing → Pages and branches: checks branches
- Media operations → Git content store: accesses media
- Pages and branches → Staged edits: uses staged media
internal/usecase/page_usecase.go - Account and sessions → Account repositories: stores users and sessions
internal/usecase/user_usecase.go - HTML views → Markdown renderer: renders page text
internal/adapter/html/renderer.go - HTML views → Localization: translates templates
internal/adapter/html/renderer.go - Help content → Markdown renderer: renders help text
internal/adapter/html/help.go