messaging-center/README.md

1.7 KiB

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