M
Give Moltbot superpowered memory with one command
Install Now
Backend Architecture

Onelist Core

A modern, secure, and scalable backend built with Elixir/Phoenix. Self-hostable with zero-knowledge encryption, powerful search, and a comprehensive REST API.

Technology Stack

Built on battle-tested technologies optimized for reliability, performance, and developer experience.

Elixir & Phoenix

Functional programming on the Erlang VM. Built for fault-tolerance with supervisor trees, hot code reloading, and millions of concurrent connections.

  • Phoenix 1.7+ with verified routes
  • Ecto 3.x for data mapping
  • GenServer for stateful processes

PostgreSQL + pgvector

Enterprise-grade relational database with full-text search, JSONB storage, and vector embeddings for semantic search.

  • GIN indexes for fast FTS
  • pgvector for AI embeddings
  • Row-level security support

Oban Job Processing

Robust background job processing backed by PostgreSQL. Handles sync operations, webhooks, cleanup tasks, and scheduled jobs.

  • Guaranteed delivery with retries
  • Cron-style scheduling
  • Job prioritization & rate limiting

Phoenix LiveView

Real-time, server-rendered UI without JavaScript complexity. WebSocket-based updates with automatic reconnection and offline handling.

  • Server-side state management
  • Real-time sync indicators
  • Progressive enhancement

Authentication Stack

Secure authentication with Guardian JWT, bcrypt password hashing, and API key management with scoped permissions.

  • JWT with refresh tokens
  • Session inactivity timeout
  • Rate limiting per endpoint

ETS Caching

In-memory caching with Erlang Term Storage. Microsecond lookups for frequently accessed data like user preferences and tag hierarchies.

  • Configurable TTL per cache
  • Automatic invalidation
  • No external dependencies

Data Model

A flexible schema designed for diverse content types, full history tracking, and efficient querying.

Core Tables

entries

Primary content storage. UUID primary key, user ownership, soft deletes, timestamps, and sync metadata.

representations

Multiple views of an entry (markdown, HTML, plain text, XAMLR). Supports per-format rendering and caching.

representation_versions

Full history of representation changes. Enables undo, diff viewing, and conflict resolution.

assets

Binary attachments (images, files). Supports S3-compatible storage, thumbnails, and content-addressable hashing.

tags

Hierarchical taxonomy with parent-child relationships. Supports tag aliases, colors, and icons.

entry_links

Bidirectional relationships between entries. Typed links (reference, parent, related) with optional metadata.

Entry Schema

# Entry Schema (Ecto)
schema "entries" do
  field :uuid, Ecto.UUID
  field :entry_type, :string  # note, task, event...
  field :title, :string
  field :metadata, :map      # JSONB for type-specific data
  field :is_encrypted, :boolean
  field :deleted_at, :utc_datetime
  field :lock_version, :integer  # optimistic locking

  belongs_to :user, User
  has_many :representations, Representation
  has_many :assets, Asset
  many_to_many :tags, Tag, join_through: "entries_tags"

  timestamps(type: :utc_datetime)
end

# Representation with versions
schema "representations" do
  field :format, :string     # markdown, html, xamlr
  field :content, :text
  field :content_hash, :string
  field :embedding, Pgvector.Ecto.Vector

  belongs_to :entry, Entry
  has_many :versions, RepresentationVersion
end

Entity Relationships

User
1:N
Entry
1:N
Representation
1:N
Version
Entry
N:M
Tag
|
Entry
N:M
Entry (via entry_links)

Entry Types

Extensible content types with type-specific metadata schemas. Add custom types without schema migrations.

πŸ“

Note

General-purpose text content. Supports markdown, rich text, and XAMLR format.

metadata: {pinned, word_count}
πŸ’­

Memory

Personal memories with date, location, and associated people.

metadata: {date, location, people[]}
βœ…

Task

Actionable items with status, priority, due dates, and recurrence.

metadata: {status, priority, due_at}
πŸ“…

Event

Calendar events with start/end times, location, and attendees.

metadata: {start_at, end_at, rrule}
πŸ“·

Photo

Image entries with EXIF data, thumbnails, and AI-generated descriptions.

metadata: {exif, dimensions, alt}
πŸ”—

Bookmark

Web bookmarks with automatic metadata extraction and archiving.

metadata: {url, favicon, archived}
πŸ“„

Document

Long-form documents with table of contents and section navigation.

metadata: {toc[], word_count}
βž•

Custom Types

Register custom types with JSON schema validation for metadata.

Entries.register_type/2

Zero-Knowledge Security

Your data is encrypted before it leaves your device. Even we can't read it.

πŸ” AES-256-GCM Encryption

Military-grade authenticated encryption. Each entry uses a unique initialization vector (IV) with authentication tags to prevent tampering.

# Encryption flow
key = PBKDF2.derive(password, salt, iterations: 600_000)
{ciphertext, tag} = AES.encrypt_gcm(plaintext, key, iv)
# Stored: Base64(iv || ciphertext || tag)

πŸ”‘ PBKDF2 Key Derivation

Password-based key derivation with 600,000 iterations (OWASP 2024 recommendation). Unique salt per user prevents rainbow table attacks.

  • SHA-256 hash function
  • 32-byte derived key length
  • Automatic iteration increase over time
🚫

Server Never Sees Keys

Encryption keys derived and used only on client devices.

πŸ”„

Key Rotation Support

Re-encrypt data with new keys without server involvement.

πŸ—‘οΈ

Secure Deletion

Cryptographic erasure by destroying encryption keys.

REST API

Comprehensive API with OpenAPI 3.0 spec. Build integrations, automate workflows, and extend Onelist.

Core Endpoints

GET /api/v1/entries List with pagination & filters
POST /api/v1/entries Create entry
PUT /api/v1/entries/:id Update with lock_version
POST /api/v1/search Full-text + semantic search
POST /api/v1/sync Batch sync with conflicts

Authentication & Webhooks

API Key with scoped permissions:

POST /api/v1/api_keys
{
  "name": "Mobile App",
  "scopes": ["entries:read", "entries:write", "tags:read"],
  "expires_at": "2025-12-31T23:59:59Z"
}

# Response
{
  "key": "ol_live_abc123...",  # shown once
  "key_preview": "ol_live_abc...xyz"
}

Webhook Events

entry.created entry.updated entry.deleted tag.created sync.conflict

Sync & Versioning

Offline-first architecture with automatic conflict resolution and complete version history.

Optimistic Locking

Every entry has a lock_version. Updates must include the current version to prevent overwrites.

Conflict Resolution

Configurable strategies: last-write-wins, manual merge, or automatic three-way merge for text.

Full History

Every change stored in representation_versions. View diffs, restore any version, or branch.

Sync Protocol

POST /api/v1/sync
{
  "client_id": "device-abc",
  "last_sync": "2024-01-15T10:30:00Z",
  "changes": [
    {"uuid": "...", "lock_version": 3, "content": "...", "updated_at": "..."}
  ]
}

# Response with server changes + conflicts
{
  "server_changes": [...],
  "conflicts": [{"uuid": "...", "client_version": {...}, "server_version": {...}}],
  "sync_token": "2024-01-15T10:35:00Z"
}

Self-Hosting

Run Onelist on your own infrastructure. Full control over your data with enterprise-ready deployment options.

🐳 Docker

Single-command deployment with Docker Compose. Includes PostgreSQL, Redis, and automatic backups.

docker run -d \
  -p 4000:4000 \
  -e DATABASE_URL=... \
  ghcr.io/onelist/core:latest

☸️ Kubernetes

Production-ready manifests with HPA, PDB, and network policies. Supports any k8s distribution.

kubectl apply -f \
  https://onelist.com/k8s/

⎈ Helm Chart

Configurable Helm chart with values for HA, persistence, ingress, and monitoring.

helm install onelist \
  oci://ghcr.io/onelist/helm \
  --values custom.yaml

Environment Configuration

Required

  • DATABASE_URL - PostgreSQL connection
  • SECRET_KEY_BASE - 64+ char secret
  • PHX_HOST - Public hostname

Optional

  • S3_BUCKET - Asset storage
  • SMTP_* - Email configuration
  • OPENAI_API_KEY - Embeddings

Ready to Get Started?

Deploy Onelist Core in minutes. Your data, your servers, your rules.