Echo is a Phoenix application featuring Chat, Request Echoing, and Audit Logging capabilities.
To start your Phoenix server:
-
Install dependencies:
mix setup
-
Environment Variables (Optional):
AUDIT_PASSWORD: Master password for Audit API (POST requests).
-
Start the server:
mix phx.server
Visit localhost:4000 in your browser.
| Resource | Method | Endpoint | Description | Auth |
|---|---|---|---|---|
| Audit | POST | /audit/sessions |
Create session | Yes (Bearer) |
| POST | /audit/events |
Log event | Yes (Bearer) | |
| GET | /audit/sessions |
List sessions | No | |
| GET | /audit/sessions/:id/events |
List events | No | |
| Chat | GET | /chat/rooms |
List rooms | No |
| GET | /chat/:room/messages |
Get messages | No | |
| POST | /chat/:room/messages |
Post message | No | |
| Rooms | GET | /rooms |
List rooms | No |
| POST | /rooms |
Create room | No | |
| Blogs | GET | /blogs |
List blogs | No |
| POST | /blogs |
Create blog | No | |
| GET | /blogs/:id |
Get blog | No | |
| PUT | /blogs/:id |
Update metadata | No | |
| PUT | /blogs/:id/content |
Update content | No | |
| DELETE | /blogs/:id |
Delete blog | No | |
| Revisions | GET | /blogs/:id/revisions |
List revisions | No |
| POST | /blogs/:id/revisions |
Create revision | No |
Authentication: For protected endpoints, send the header Authorization: Bearer <AUDIT_PASSWORD>.
Detailed API documentation can be found in the docs/ folder:
/chat- Real-time chat interface./echo/request- View echoed HTTP requests.
To run in production, set these environment variables:
| Variable | Description | Required |
|---|---|---|
DATABASE_PATH |
Path to SQLite DB (e.g., /data/echo.db) |
Yes |
SECRET_KEY_BASE |
Generate with mix phx.gen.secret |
Yes |
PHX_HOST |
Domain name (e.g., myapp.com) |
Yes |
AUDIT_PASSWORD |
Password for Audit API | Yes |
# 1. Build release
mix release
# 2. Start server
PHX_SERVER=true bin/echo startFor detailed deployment steps, see the Phoenix Deployment Guides.