erDiagram
Vitrine {
string hostname PK
boolean used
}
VPS {
string id PK
string size
string ip
string version
string plan
string state
string hostname FK
}
Workspace {
string id PK
string name
string plan
timestamp created_at
}
User {
string id PK
string username
string email
string password_hash
boolean is_active
timestamp created_at
}
Profile {
string id PK
string profile_name
string workspace_id FK
timestamp created_at
}
Account {
string id PK
string type
string identifier
string profile_id FK
timestamp last_sync
}
AccountTrend {
string id PK
string account_id FK
string trend_name
float engagement_rate
int followers_growth
timestamp detected_at
timestamp expires_at
}
Suggestion {
string id PK
string profile_id FK
string type
string title
string description
float relevance_score
string status
timestamp created_at
timestamp updated_at
}
GeneratedImage {
string id PK
string suggestion_id FK
string image_url
string prompt_used
timestamp generated_at
boolean is_selected
}
WorkspaceUser {
string workspace_id FK
string user_id FK
string role
timestamp joined_at
}
VitrineUsers {
string hostname FK
string user_id FK
}
Vitrine ||--o{ VitrineUsers : "has"
Vitrine ||--o{ VPS : "hosts"
Workspace ||--o{ WorkspaceUser : "has"
User ||--o{ WorkspaceUser : "belongs_to"
Workspace ||--o{ Profile : "contains"
Profile ||--o{ Account : "has"
Account ||--o{ AccountTrend : "trends"
Profile ||--o{ Suggestion : "receives"
Suggestion ||--o{ GeneratedImage : "has"
All protected routes require a Bearer token in the Authorization header:
Authorization: Bearer <token>
https://localhost:8443/
https://{workspace-name}.yourdomain.com/api
Creates the first user (owner) for a new workspace.
POST /workspace/owner
Request Body:
{
"email": "string",
"name": "string",
"password": "string",
"phone_number": "string"
}
Response: 201 Created
{
"id": "uuid",
"email": "string",
"name": "string",
"phone_number": "string",
"role": "owner",
"status": "active"
}
Creates a new user account from an invitation.
POST /workspace/invite
Request Body:
{
"email": "string",
"name": "string",
"password": "string",
"phone_number": "string",
"token": "string"
}
Response: 201 Created
{
"id": "uuid",
"email": "string",
"name": "string",
"phone_number": "string",
"role": "string",
"status": "active"
}
Protected route to invite a new user to the workspace.
POST /users/invite
Request Body:
{
"email": "string",
"role": "string"
}
Response: 201 Created
{
"id": "uuid",
"email": "string",
"role": "string",
"token": "string",
"expires_at": "timestamp"
}
Protected route to get all pending invitations.
GET /users/invitations
Response: 200 OK
{
"invitations": [
{
"id": "uuid",
"email": "string",
"role": "string",
"status": "string",
"expires_at": "timestamp",
"created_at": "timestamp"
}
]
}
Protected route to cancel a pending invitation.
DELETE /users/invitations/:id
Response: 200 OK
{
"success": true
}
Protected route to get the current user's profile.
GET /users/me
Response: 200 OK
{
"id": "uuid",
"email": "string",
"name": "string",
"phone_number": "string",
"role": "string",
"status": "string"
}
Protected route to update the current user's profile.
PUT /users/me
Request Body:
{
"name": "string",
"phone_number": "string"
}
Response: 200 OK
{
"id": "uuid",
"email": "string",
"name": "string",
"phone_number": "string",
"role": "string",
"status": "string"
}
owner
: Workspace owner with full permissionsadmin
: Administrative user with elevated permissionsmember
: Regular workspace memberactive
: User account is activeinactive
: User account is temporarily inactivesuspended
: User account has been suspendedpending
: Invitation is waiting to be acceptedaccepted
: Invitation has been acceptedexpired
: Invitation has expiredcancelled
: Invitation was cancelledAll error responses follow this format:
{
"error": "string"
}
Common HTTP status codes:
400
: Bad Request - Invalid input data401
: Unauthorized - Missing or invalid authentication403
: Forbidden - Insufficient permissions404
: Not Found - Resource doesn't exist500
: Internal Server Error - Server-side error