TechSetupGuides
Intermediateainotesragself-hosteddockertypescripttauripostgresprivacy

Blinko: Self-hosted AI-powered personal note tool

Set up Blinko, an open-source AI-powered personal note taking tool with RAG-based search, privacy-first architecture, and multi-platform support.

  1. Step 1

    What is Blinko?

    Blinko is an open-source, self-hosted AI-powered personal note tool designed for quickly capturing and organizing fleeting thoughts. Built with privacy-first architecture, it enables users to store all data in their own environment while leveraging AI for intelligent note retrieval.

    Key value proposition: Capture ideas instantly, store them as plain text with full Markdown support, and search using natural language queries powered by RAG (Retrieval-Augmented Generation).

    Key Features:
    ├── AI-Enhanced Note Retrieval (RAG-powered natural language search)
    ├── Data Ownership (100% self-hosted, complete privacy control)
    ├── Efficient & Fast (plain text storage with Markdown support)
    ├── Multi-platform Support (macOS, Windows, Android, Linux via Tauri)
    ├── Open Source (transparent, community-driven development)
    └── Lightweight Architecture (clean, performant, Tauri-based)
  2. Step 2

    Technology stack

    Blinko uses a modern TypeScript-based monorepo architecture with separate workspaces for frontend, backend, and shared code:

    Monorepo Structure:

    • Package Manager: Bun 1.2.8+
    • Build Tool: Turbo
    • TypeScript: ^5.1.6
    • Workspaces: app (frontend), server (backend), shared

    Backend (server/package.json):

    • Runtime: Bun / Node.js 20+
    • Framework: Express 5.1.0
    • Database ORM: Prisma 5.22.0
    • Databases: PostgreSQL, SQLite, LibSQL
    • AI/LLM: Vercel AI SDK 4.3.16 with multi-provider support
    • Vector Search: pgvector 0.2.0, Voyage AI
    • RAG Framework: @mastra/rag 1.0.6
    • MCP: Model Context Protocol SDK 1.18.1
    • Auth: @auth/express, Passport.js with OAuth providers
    • API: tRPC 11.4.4 with OpenAPI generation
    • Queue: pg-boss 12.5.4

    Frontend (app/package.json):

    • Framework: React 18.3.1
    • Build Tool: Vite 6.0.3
    • UI Library: HeroUI (React + Tailwind CSS 4.1.4)
    • State: MobX 6.15.0 with MobX-React-Lite
    • Desktop App: Tauri 2.5.0 with Rust backend
    • Routing: React Router 7.5.0
    • Markdown: React-Markdown 10.1.0, Vditor 3.11.2
    • Math: KaTeX 0.16.25 with rehype-katex
    • Diagrams: Mermaid 11.6.0, MarkMap 0.18.11
    • Charts: ECharts 5.6.0
    • 3D: Three.js 0.174.0 with @react-three/fiber
    • Animations: Framer Motion 11.0.0, Motion 12.7.3

    AI Providers Supported:

    • OpenAI, Anthropic, Google AI, Azure AI
    • DeepSeek, xAI (Grok), Ollama (local)
    • OpenRouter, MiniMax
    • Tavily (web search)

    Deployment Options:

    • Docker (recommended)
    • Docker Compose
    • Kubernetes (Helm chart included)
    • Tauri desktop app (macOS, Windows, Linux, Android)
    Architecture Overview:
    ├── Monorepo (Bun + Turbo)
    │   ├── @blinko/frontend (app/)
    │   │   ├── React 18 + Vite
    │   │   ├── Tauri 2 (desktop)
    │   │   └── HeroUI + Tailwind CSS 4
    │   ├── @blinko/backend (server/)
    │   │   ├── Express 5 + tRPC
    │   │   ├── Prisma + PostgreSQL
    │   │   └── Vercel AI SDK + RAG
    │   └── shared/
    ├── Database: PostgreSQL + pgvector
    ├── Queue: pg-boss
    └── Deployment: Docker, K8s, Tauri
  3. Step 3

    Quick start with one-click install

    The fastest way to get Blinko running is using the official installation script. This sets up Docker networks and starts both PostgreSQL and Blinko containers automatically.

    # Official one-click install script
    curl -s https://raw.githubusercontent.com/blinko-space/blinko/main/install.sh | bash
    
    # The script will:
    # 1. Create Docker network 'blinko-network'
    # 2. Start PostgreSQL container 'blinko-postgres'
    # 3. Optionally mount a local .blinko directory
    # 4. Start Blinko container 'blinko-website'
    
    # Access Blinko at: http://localhost:1111
  4. Step 4

    Manual Docker Compose setup

    For more control over the deployment, you can manually set up Blinko using Docker Compose. This gives you flexibility to customize configurations.

    Step 1: Clone the repository

    git clone https://github.com/blinko-space/blinko.git
    cd blinko
    

    Step 2: Setup Docker Compose The official docker-compose.dev.yml provides a complete setup with PostgreSQL and Blinko services.

    # docker-compose.yml (production-ready)
    version: '3'
    
    networks:
      blinko-network:
        driver: bridge
    
    services:
      blinko-website:
        container_name: blinko-website
        image: blinkospace/blinko:latest
        environment:
          NODE_ENV: production
          NEXTAUTH_URL: http://localhost:1111
          NEXT_PUBLIC_BASE_URL: http://localhost:1111
          NEXTAUTH_SECRET: "your-secure-secret-change-in-production"
          DATABASE_URL: postgresql://postgres:mysecretpassword@blinko-postgres:5432/postgres
        depends_on:
          postgres:
            condition: service_healthy
        restart: always
        ports:
          - 1111:1111
        healthcheck:
          test: ["CMD", "wget", "--spider", "http://blinko-website:1111/"]
          interval: 30s
          timeout: 10s
          retries: 5
          start_period: 30s
        networks:
          - blinko-network
    
      postgres:
        image: postgres:14
        container_name: blinko-postgres
        restart: always
        environment:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: mysecretpassword
        healthcheck:
          test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
          interval: 5s
          timeout: 10s
          retries: 5
        volumes:
          - postgres_data:/var/lib/postgresql/data
        networks:
          - blinko-network
    
    volumes:
      postgres_data:
  5. Step 5

    Run with Docker Compose

    Start the services with Docker Compose. By default, Blinko will be available at http://localhost:1111.

    # Start services (detached mode)
    docker compose up -d
    
    # View logs
    docker compose logs -f
    
    # Stop services
    docker compose down
    
    # Stop and remove volumes (WARNING: deletes all data)
    docker compose down -v
    
    # Restart services
    docker compose restart
    
    # Check status
    docker compose ps
  6. Step 6

    Environment configuration

    Blinko supports multiple configuration options through environment variables. The default values work out of the box, but you should customize for production:

    Required Environment Variables:

    • NODE_ENV: Set to 'production' for production builds
    • NEXTAUTH_URL: The full URL of your Blinko instance
    • NEXT_PUBLIC_BASE_URL: Public URL for the frontend
    • NEXTAUTH_SECRET: A secure random string for NextAuth sessions (change in production)
    • DATABASE_URL: PostgreSQL connection string

    Optional AI Configuration (add to server/.env):

    • OPENAI_API_KEY: OpenAI API key for AI features
    • ANTHROPIC_API_KEY: Anthropic Claude API key
    • GOOGLE_GENERATIVE_AI_API_KEY: Google AI Studio API key
    • AZURE_OPENAI_API_KEY: Azure OpenAI API key
    • OLLAMA_BASE_URL: Self-hosted Ollama instance URL
    • TAVILY_API_KEY: Tavily web search API key
    • VOYAGE_API_KEY: Voyage AI embeddings API key
    # Generate a secure NEXTAUTH_SECRET
    # Using openssl:
    openssl rand -base64 32
    
    # Or use Node:
    node -e "const crypto = require('crypto'); console.log(crypto.randomBytes(32).toString('hex'))"
    
    # Example .env file for production:
    # NODE_ENV=production
    # NEXTAUTH_URL=https://blinko.yourdomain.com
    # NEXT_PUBLIC_BASE_URL=https://blinko.yourdomain.com
    # NEXTAUTH_SECRET=your-generated-secret-here
    # DATABASE_URL=postgresql://postgres:password@postgres:5432/postgres
    #
    # AI Provider Keys (optional):
    # OPENAI_API_KEY=sk-...
    # ANTHROPIC_API_KEY=sk-ant-...
    # OLLAMA_BASE_URL=http://localhost:11434
    ⚠ Heads up: IMPORTANT: Never commit your .env file to version control. Add .env to your .gitignore and use environment variables in production deployments.
  7. Step 7

    Kubernetes/Helm deployment

    Blinko includes a Helm chart for Kubernetes deployments. This is suitable for production environments requiring scalability and reliability.

    # Install using Helm (with included PostgreSQL)
    helm install blinko ./helm \
      --set config.baseUrl=https://blinko.yourdomain.com \
      --set config.nextauth.url=https://blinko.yourdomain.com \
      --set config.nextauth.secret=your-secure-secret \
      --set service.type=LoadBalancer
    
    # Use external PostgreSQL instead
    helm install blinko ./helm \
      --set postgresql.enabled=false \
      --set externalDatabase.enabled=true \
      --set externalDatabase.host=your-db-host \
      --set externalDatabase.username=postgres \
      --set externalDatabase.password=your-password \
      --set externalDatabase.database=postgres
    
    # Check deployment
    kubectl get pods -l app.kubernetes.io/name=blinko
    kubectl get svc -l app.kubernetes.io/name=blinko
    
    # Uninstall
    helm uninstall blinko
  8. Step 8

    Development setup

    For contributors who want to develop on Blinko, here's how to set up the development environment:

    Prerequisites:

    • Bun 1.0.0+ (recommended) or Node.js 20+
    • Docker 20.10+ (for database)
    • Git with LFS support
    • Tauri development dependencies (for desktop app)
    # Clone repository
    git clone --recursive https://github.com/blinko-space/blinko.git
    cd blinko
    
    # Install dependencies
    bun install
    
    # Start PostgreSQL (for development)
    docker run -d \
      --name blinko-dev-postgres \
      -e POSTGRES_DB=postgres \
      -e POSTGRES_USER=postgres \
      -e POSTGRES_PASSWORD=mysecretpassword \
      -p 5432:5432 \
      postgres:14
    
    # Generate Prisma client
    cd prisma && prisma generate && prisma migrate dev && cd ..
    
    # Start development servers
    # Backend only
    bun run dev:backend
    
    # Frontend only
    bun run dev:frontend
    
    # Full stack with Tauri desktop app
    bun run dev
    
    # Run tests
    bun run test
    
    # Build for production
    bun run build:web
    
    # Run Prisma Studio (database GUI)
    bun run prisma:studio
  9. Step 9

    Core features overview

    AI-Powered Note Retrieval (RAG):

    • Natural language search across all notes
    • Context-aware responses using retrieved information
    • Supports multiple embedding models (Voyage AI, pgvector)
    • Web search integration via Tavily

    Multi-Platform Desktop App (Tauri):

    • Native desktop application for macOS, Windows, Linux, Android
    • System tray integration and auto-start
    • Global keyboard shortcuts for quick capture
    • Automatic updates with @tauri-apps/plugin-updater

    Rich Content Editing:

    • Markdown editor with Vditor
    • Math equation support (KaTeX)
    • Diagram rendering (Mermaid, MarkMap)
    • Code syntax highlighting
    • Image/video embedding
    • LaTeX equations

    Organization Features:

    • Card-based note hierarchy
    • Drag-and-drop reorganization (DnD Kit)
    • Collections and folders
    • Tagging system
    • Full-text search

    Authentication (OAuth):

    • Local authentication
    • OAuth providers: GitHub, Google, Discord, Facebook, Twitter/X, Spotify, Twitch, Apple, Line, Slack
    • JWT tokens
    • 2FA with otplib
    Feature Highlights:
    ├── Note Editing
    │   ├── Vditor Markdown Editor
    │   ├── KaTeX Math Support
    │   └── Mermaid/MarkMap Diagrams
    ├── AI Features
    │   ├── RAG Search
    │   ├── Multi-Provider LLM Support
    │   └── Tavily Web Search
    ├── Desktop (Tauri)
    │   ├── System Integration
    │   ├── Global Shortcuts
    │   └── Auto-updates
    ├── Auth (Passport.js)
    │   ├── Local Login
    │   ├── 15+ OAuth Providers
    │   └── 2FA Support
    └── UI/UX
        ├── HeroUI Components
        ├── Framer Motion Animations
        ├── Dark/Light Themes
        └── i18n (Internationalization)
  10. Step 10

    Advanced configuration

    Storage Configuration:

    • Default: In-memory with PostgreSQL
    • Optional: S3-compatible storage via @aws-sdk/client-s3
    • Supports local file storage with volume mounts

    Queue Configuration (pg-boss):

    • Background job processing
    • Scheduled tasks
    • Email notifications
    • AI processing queue

    WebSocket Support:

    • Real-time updates via ws 8.14.2
    • Live collaboration features
    • Notification system

    Security Features:

    • CORS configuration
    • Rate limiting options
    • SSL/TLS support (via reverse proxy)
    • Secure session management
    # Example: Mount persistent storage for uploads
    # In docker-compose.yml, add to blinko-website:
    
    volumes:
      - ./uploads:/app/uploads
      - ./backups:/app/backups
    
    # Example: Nginx reverse proxy for TLS
    # nginx.conf:
    server {
        listen 443 ssl;
        server_name blinko.yourdomain.com;
        
        ssl_certificate /path/to/cert.pem;
        ssl_certificate_key /path/to/key.pem;
        
        location / {
            proxy_pass http://blinko-website:1111;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
  11. Step 11

    Troubleshooting

    MacOS "App is damaged" issue: macOS quarantines downloaded apps. Remove the quarantine attribute:

    sudo xattr -rd com.apple.quarantine /Applications/blinko.app
    

    Connection refused (port 1111): Check if containers are running:

    docker ps | grep blinko
    docker compose logs blinko-website
    

    Database connection failed: Verify PostgreSQL is healthy:

    docker compose logs blinko-postgres
    docker exec -it blinko-postgres psql -U postgres -d postgres
    

    Prisma migration errors:

    cd prisma && prisma migrate reset && cd ..
    

    Tauri build failures: Ensure Rust and required dependencies are installed:

    # Common troubleshooting commands
    
    # Restart all containers
    docker compose down && docker compose up -d
    
    # Clean and rebuild Docker images
    docker compose down -v
    docker compose build --no-cache
    docker compose up -d
    
    # Check container logs
    docker compose logs -f blinko-website
    docker compose logs -f blinko-postgres
    
    # Access PostgreSQL directly
    sudo docker exec -it blinko-postgres psql -U postgres -d postgres
    
    # Reset database (WARNING: deletes all data)
    docker compose down -v
    docker compose up -d
    
    # Backup database
    sudo docker exec -t blinko-postgres pg_dumpall -c -U postgres > backup.sql
    
    # Restore database
    sudo docker exec -i blinko-postgres psql -U postgres -d postgres < backup.sql
    
    # MacOS quarantine fix
    sudo xattr -rd com.apple.quarantine /Applications/blinko.app
  12. Step 12

    Resources and links

    Official Resources:

    • GitHub Repository: https://github.com/blinko-space/blinko (10,400+ stars)
    • Official Website: https://blinko.space
    • Documentation: https://docs.blinko.space/
    • Live Demo: https://demo.blinko.space (username: blinko, password: blinko)

    Community:

    • Telegram (English): https://t.me/blinkoEnglish
    • Telegram (Chinese): https://t.me/blinkoChinese
    • Contributors: View on GitHub

    Deployment Options:

    • One-Click Deploy: https://www.pikapods.com/pods?run=blinko

    Related Technologies:

    • Vercel AI SDK: https://sdk.vercel.ai/
    • Tauri: https://tauri.app/
    • Prisma: https://www.prisma.io/
    • pgvector: https://github.com/pgvector/pgvector
    • HeroUI: https://heroui.com/
    Links:
    ├── GitHub: https://github.com/blinko-space/blinko
    ├── Website: https://blinko.space
    ├── Docs: https://docs.blinko.space/
    ├── Demo: https://demo.blinko.space
    ├── Telegram EN: https://t.me/blinkoEnglish
    └── Deploy: https://www.pikapods.com/pods?run=blinko
    
    Stats:
    ├── Stars: 10,400+
    ├── Forks: 742+
    ├── Contributors: 50+
    ├── Docker Pulls: 50,000+
    └── Latest: v1.8.7

Feature requests

Sign in to suggest features or vote on existing ones.

No feature requests yet.

Discussion

0 people marked this as worked·Sign in to mark your own.

Sign in to join the discussion.

No comments yet.