How vitwit/authz-apps works
Project Type and Purpose
• This is a multi-component suite:
• governance-ui: a static React single-page-app for displaying “Authz” content.
• voting-bot: a backend service (Slack bot) in Go for automating on-chain governance tasks (proposals, balances, withdraw rewards) and posting to Slack.
File Structure
• Top level splits into two subprojects:
├ governance-ui/ …standard React folder layout (public, src, package.json)
└ voting-bot/ …Go modules: config, database, endpoints, handler, jobs, keyring, voting, utils, main.go, tests
• Config & secrets: governance-ui/.env; voting-bot/example.config.toml & .env for tests
• Build/CI: governance-ui uses npm/yarn; voting-bot has Makefile + GitHub Actions pipeline
Extract Additional Insights from README
• The root README simply says “Authz applications” but each subproject has its own README documenting how to run it.
a. Frontend:
• governance-ui (React app)
• Static hosting or CDN layer
b. Backend Service:
• voting-bot (Go application)
– Config & keyring module
– Database (SQLite)
– Jobs scheduler (authz, proposals, balances, withdraw_rewards)
– HTTP API endpoints & handler
– Slack client integration
c. External Systems:
• Slack API (for sending messages)
• Blockchain RPC/GRPC endpoint (Cosmos chain)
• GitHub Actions (CI/CD)
Relationships & Data Flows
• governance-ui → (HTTP/REST or direct static assets) ←– user’s browser
• voting-bot jobs → poll Blockchain → write/read SQLite → produce Slack notifications → Slack API
• voting-bot HTTP endpoints (apiHandler) can serve data to UIs or other services (optional)
• CI/CD workflow pushes new versions of both governance-ui and voting-bot
Architectural Patterns & Design Principles
• Clear separation of concerns: UI vs. backend vs. data store
• Modular Go code:
– config-driven design (example.config.toml)
– dependency injection via custom config structs
– database layer abstracted behind authz.go/sqlite.go
– job scheduler triggering at intervals
• Frontend: component-based React (TopSection, CustomCard, CardList, etc.)
Technologies & Frameworks
• Frontend: React, Create React App toolchain, CSS modules
• Backend: Go modules, SQLite, TOML config, Slack SDK
• DevOps: GitHub Actions, Makefile, .env
Final Touches
• You capture *all* critical modules (config, keyring, jobs, db, endpoints).
• Left lane: User + governance-ui
• Middle lane: voting-bot internals
• Right lane: External systems