Imported from bare git on Zurich
Go to file
Johan Jongsma 34e06fed8e v0.1: Foundation
- Go module with chi router, sqlite3, uuid deps
- Directory structure per spec
- SQLite store with embedded migrations
- Core types: Message, Attachment, Command, Contact, Channel
- REST API:
  - GET /health, GET /ready (no auth)
  - POST /oauth/token (client_credentials grant)
  - GET /api/v1/messages (list with filters)
  - GET /api/v1/messages/:id
  - POST /api/v1/messages (stub, creates pending)
  - POST /api/v1/commands (stub, creates pending)
  - GET /api/v1/channels (stub, lists configured)
- OAuth 2.0 with Bearer token validation
- YAML config with env var expansion (supports ${VAR:-default})
- Ready for v0.2 (email adapter)
2026-02-02 21:34:34 +00:00
cmd/mc v0.1: Foundation 2026-02-02 21:34:34 +00:00
internal v0.1: Foundation 2026-02-02 21:34:34 +00:00
.gitignore v0.1: Foundation 2026-02-02 21:34:34 +00:00
README.md v0.1: Foundation 2026-02-02 21:34:34 +00:00
SPEC.md v0.1: Foundation 2026-02-02 21:34:34 +00:00
config.yaml v0.1: Foundation 2026-02-02 21:34:34 +00:00
go.mod v0.1: Foundation 2026-02-02 21:34:34 +00:00
go.sum v0.1: Foundation 2026-02-02 21:34:34 +00:00

README.md

Messaging Center

Unified messaging hub that aggregates multiple communication channels into a single, normalized interface.

Status

v0.1 — Foundation

  • Project structure
  • SQLite store with migrations
  • Core types (Message, Attachment, Command, Contact)
  • REST API scaffold with chi
  • OAuth 2.0 (client_credentials)
  • Health/ready endpoints
  • Adapters (email, whatsapp, signal) — v0.2+
  • Web GUI — v0.5
  • Webhooks — v0.6

Quick Start

# Build
go build -o mc ./cmd/mc

# Run
./mc -config config.yaml

# Or with go run
go run ./cmd/mc -config config.yaml

The server starts on http://localhost:8040 by default.

API

Authentication

Get an access token:

curl -X POST http://localhost:8040/oauth/token \
  -d "grant_type=client_credentials" \
  -d "client_id=admin" \
  -d "client_secret=dev-secret-admin"

Endpoints

Method Endpoint Auth Description
GET /health No Health check
GET /ready No Readiness check
POST /oauth/token No Get access token
GET /api/v1/messages Yes List messages
GET /api/v1/messages/:id Yes Get message
POST /api/v1/messages Yes Send message (stub)
POST /api/v1/commands Yes Execute command (stub)
GET /api/v1/channels Yes (admin) List channels

Example: List Messages

TOKEN="your-access-token"
curl -H "Authorization: Bearer $TOKEN" \
  "http://localhost:8040/api/v1/messages?source=whatsapp&limit=10"

Configuration

See config.yaml for all options. Environment variables are expanded (e.g., ${MC_SIGNING_KEY}).

License

MIT