Schemas
Sequence diagram — License activation & management
What happens step-by-step:
1. Activation – the user launches the app and enters the license key. The app calls POST /activate with email, license_key, device_hash, device_name. The API checks ownership, enabled status, and device quota, then returns a signed token that the app stores to unlock Pro features.
2. (Optional) Verification – the app fetches the public key via GET /public-key and verifies the token signature (Ed25519).
3. Admin management – an admin can create/list licenses and enable/disable a license (immediate effect).
4. Device change – when the user moves to a new machine, the app calls POST /deactivate to free a slot and activate elsewhere.
%%{init: {
"theme": "base",
"sequence": { "showSequenceNumbers": true, "useMaxWidth": true },
"themeVariables": {
"darkMode": true,
"background": "transparent",
"fontSize": "18px",
"primaryTextColor": "#e7ebf2",
"actorTextColor": "#e7ebf2",
"noteTextColor": "#dfe4ec",
"lineColor": "#8fb4ff",
"signalColor": "#8fb4ff",
"actorBorder": "#8fb4ff",
"actorBkg": "#1b2330",
"activationBorderColor":"#8fb4ff",
"activationBkgColor": "#242e3d",
"noteBkgColor": "#242e3d"
}
}}%%
sequenceDiagram
autonumber
actor User as User
participant App as Application (client)
participant API as Licenses API
participant Admin as Admin (back office)
participant Key as Public key (GET /public-key)
User->>App: Launch app / enter license key
App->>API: POST /activate\n{ email, license_key,\n device_hash, device_name }
API-->>API: Validate license\n(status, email owner, device quota)
API-->>App: 200 { signed token + metadata }
Note over App: App stores the signed token\nand unlocks Pro features
rect rgb(27,35,48)
App->>Key: GET /public-key
App-->>App: Verify token signature (Ed25519)
end
Admin->>API: Enable/Disable, list, create licenses
API-->>Admin: License details + active devices
User->>App: Moves to a new machine
App->>API: POST /deactivate\n{ license_key_hash, device_hash }
API-->>App: Slot freed (can activate elsewhere)
Entity–Relationship diagram
- USERS: one row per user (identified by
email), with creation timestamp. - LICENSES: belongs to a user; stores
license_key_hash,product,edition,enabled,max_activations, optionalfeatures_json, timestamps. - ACTIVATIONS: each record links a license to a device (
device_hash,device_name), withdeactivatedflag and timestamp.
Relationships - A USER has many LICENSES. - A LICENSE has many ACTIVATIONS (devices).
erDiagram
USERS ||--o{ LICENSES : owns
LICENSES ||--o{ ACTIVATIONS : has