microvault

command
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Command microvault is the API server and composition root for the Microvault platform. It is the single binary that wires every dependency together and serves HTTP.

The startup sequence in main.go is deliberately linear and reads top to bottom:

  1. Load configuration from environment (config.New, with godotenv autoload).
  2. Initialize platform infrastructure — the Postgres connection (database.GetConnection "core") and the Redis connection (cache.GetConnection "core").
  3. Initialize authentication — the Redis-backed challenge store, the challenge service, the JWT service, and the auth controller.
  4. Initialize the Stellar client and composite service (classic + Soroban).
  5. Initialize repositories and the core user/account services.
  6. Initialize the mobile channel — USSD session manager, menu registry, the standard loan menu preset, the USSD user-service adapter (with Stellar HD-wallet derivation), the SMS service and Africa's Talking providers, and the notification notifiers.
  7. Initialize the PIN service and wire it into the USSD handler.
  8. Build the Fiber app, attach health-check middleware, Swagger/Redoc routes, and the public route group (auth, USSD, webhook, SMS callback).
  9. Listen on cfg.Server.CoreAddr() in a goroutine; block on SIGINT/SIGTERM; then shut down Fiber, close database connections, and close Redis.

The loan and rate services are currently passed as nil to the USSD handler — they are wired by the credit module when that service is linked in. The webhook controller's event handler is similarly pending.

Swagger annotations on main.go drive the generated docs in cmd/microvault/docs (do not edit — regenerated by swaggo). The Redoc UI is served at "/" and the Swagger UI at "/swagger/*".

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL