75 lines
1.7 KiB
Markdown
75 lines
1.7 KiB
Markdown
# Messaging Center
|
|
|
|
Unified messaging hub that aggregates multiple communication channels into a single, normalized interface.
|
|
|
|
## Status
|
|
|
|
**v0.1 — Foundation**
|
|
|
|
- [x] Project structure
|
|
- [x] SQLite store with migrations
|
|
- [x] Core types (Message, Attachment, Command, Contact)
|
|
- [x] REST API scaffold with chi
|
|
- [x] OAuth 2.0 (client_credentials)
|
|
- [x] Health/ready endpoints
|
|
- [ ] Adapters (email, whatsapp, signal) — v0.2+
|
|
- [ ] Web GUI — v0.5
|
|
- [ ] Webhooks — v0.6
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# 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:
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
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
|