{"id":49878113,"url":"https://github.com/lstep/pinkas","last_synced_at":"2026-05-15T13:11:04.887Z","repository":{"id":356965004,"uuid":"1234715882","full_name":"lstep/pinkas","owner":"lstep","description":"A self-hosted collaborative wiki with real-time editing, AI integration via MCP, and structured knowledge management.","archived":false,"fork":false,"pushed_at":"2026-05-10T17:05:40.000Z","size":28342,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-10T18:28:03.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lstep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T14:51:14.000Z","updated_at":"2026-05-10T17:05:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lstep/pinkas","commit_stats":null,"previous_names":["lstep/pinkas"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lstep/pinkas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lstep%2Fpinkas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lstep%2Fpinkas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lstep%2Fpinkas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lstep%2Fpinkas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lstep","download_url":"https://codeload.github.com/lstep/pinkas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lstep%2Fpinkas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-15T13:11:03.888Z","updated_at":"2026-05-15T13:11:04.878Z","avatar_url":"https://github.com/lstep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pinkas\n![cover-v5-optimized](./assets/pinkas-cover.jpg)\n\nA self-hosted, open-source collaborative Markdown wiki. Multiple users can edit documents simultaneously in real time (powered by Yjs + Hocuspocus). All documents are stored as plain `.md` files on the server filesystem — readable and portable without the application.\n\n## Features\n\n- **Real-time collaboration** — Multiple users edit the same document simultaneously with live cursor awareness and conflict resolution (Yjs + Hocuspocus)\n- **WYSIWYG Markdown editor** — Rich text editing via Tiptap; supports headings, code blocks, blockquotes, lists, inline images, video embeds, and file attachments\n- **Granular permissions** — Role-based access (viewer / editor / admin) at the space, directory, and page level\n- **Spaces \u0026 directories** — Organize pages into a tree structure within named spaces\n- **Full-text search** — Powered by SQLite FTS5, search across all pages with ranking and deduplication\n- **Page history** — Automatic snapshots on every save; browse and restore previous versions\n- **File attachments** — Upload images, videos, and files per page (stored on disk)\n- **MCP server** — Model Context Protocol server (port `3100`) for AI tool integration (search, read, create, update pages)\n- **SSE real-time events** — Server-Sent Events for live UI updates (page changes, directory moves, etc.)\n- **Self-hosted \u0026 portable** — Single SQLite database, plain Markdown files on disk, Docker Compose deployment\n- **Continuous backup** — Litestream replication of the SQLite database to S3, SFTP, or local volume\n\n## Screenshots\n\n![cover-v5-optimized](./assets/screenshot.png)\n\n\n## Ports Overview\n\n| Service | Port | Description |\n|---------|------|-------------|\n| Go API | `3000` | REST API, auth, permissions, SSE, file serving |\n| Hocuspocus (collab) | `3001` | WebSocket for real-time collaboration |\n| Hocuspocus health | `3002` | Sidecar health endpoint |\n| MCP server | `3100` | Model Context Protocol (SSE + messages) |\n| Nginx / Frontend | `8081` | Reverse proxy (production) |\n| Vite dev server | `5173` | Frontend dev mode (development only) |\n\n## Quick Start\n\n### Prerequisites\n\n- [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/)\n- [Go 1.26+](https://go.dev/dl/) (for local development only)\n- [Node.js 24+](https://nodejs.org/) (for local development only)\n\n### Running with Docker Compose\n\n```bash\n# Build and start all services\ndocker compose up -d --build\n\n# Check that everything is running\ndocker compose ps\n\n# View logs\ndocker compose logs -f\n```\n\nThe application will be available at:\n\n| Service | URL |\n|---------|-----|\n| Frontend | http://localhost:8081 |\n| Health check | http://localhost:8081/health |\n\nTo stop:\n\n```bash\ndocker compose down\n```\n\n### Local Development\n\n#### 1. Go API\n\n```bash\n# Install dependencies\ngo mod download\n\n# Run the server\ngo run ./cmd/server\n```\n\nThe API listens on TCP port `3000` by default.\n\n#### 2. Collab Sidecar\n\n```bash\ncd collab\nnpm install\nnode server.js\n```\n\nThe sidecar listens on port `3001` (WebSocket) and `3002` (health).\n\n#### 3. Frontend\n\n```bash\ncd frontend\nnpm install\nnpm run dev\n```\n\nThe Vite dev server starts on port `5173`.\n\n#### 4. Nginx (optional for local dev)\n\n```bash\n# Build the frontend first\ncd frontend \u0026\u0026 npm run build \u0026\u0026 cd ..\n\n# Start nginx with the local config\ndocker run -d --name pinkas-nginx \\\n  -p 8081:80 \\\n  -v $(pwd)/docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro \\\n  -v $(pwd)/frontend/dist:/usr/share/nginx/html:ro \\\n  nginx:alpine\n```\n\n## Architecture\n\n```\nBrowser (React + Tiptap + Yjs)\n  ├── WebSocket  →  Nginx :80/collab/*  →  Node.js Hocuspocus :3001\n  └── HTTP       →  Nginx :80/api/*     →  Go API :3000\n\nGo API :3000\n  ├── REST API     (/api/*)\n  ├── File serve   (/files/*)\n  ├── SSE stream   (/api/events)\n  └── Internal     (/internal/auth, /internal/save, /internal/restore, /internal/cleanup)\n\nShared volume /data\n  ├── wiki.db              SQLite database (WAL mode)\n  ├── docs/{space}/{id}.md  Markdown files\n  └── attachments/{id}/     Uploaded files\n```\n\n### Components\n\n| Component | Technology | Purpose |\n|-----------|-----------|---------|\n| Go API | Go 1.26 + net/http | REST API, auth, permissions, storage, MCP |\n| Collab | Node.js + Hocuspocus + Yjs | Real-time WebSocket collaboration |\n| Frontend | React + TypeScript + Vite + Tiptap | WYSIWYG Markdown editor |\n| Database | SQLite (mattn/go-sqlite3) | Sole database, WAL mode |\n| Reverse proxy | Nginx | Routes WebSocket and HTTP traffic |\n| Backup | Litestream | Continuous SQLite replication |\n\n## Project Structure\n\n```\n├── cmd/server/              Go application entry point\n├── internal/\n│   ├── attachments/         File upload handling\n│   ├── auth/                JWT auth, middleware, user CRUD\n│   ├── db/                  Database connection, migrations, seed\n│   │   └── query/           SQLC generated Go code\n│   ├── directories/         Directory CRUD and tree operations\n│   ├── groups/              Group CRUD and membership\n│   ├── httputil/            JSON responses, error helpers\n│   ├── mcp/                 MCP server (SSE + tools)\n│   ├── mcptokens/           MCP API token management\n│   ├── pages/               Page CRUD, history, search, snapshots\n│   ├── permissions/         Permission levels, resolver, middleware\n│   ├── spaces/              Space CRUD\n│   └── sse/                 Server-Sent Events hub\n├── collab/                  Node.js Hocuspocus sidecar (Yjs)\n├── frontend/                React + TypeScript + Vite + Tiptap\n├── docker/                  Nginx configuration\n├── migrations/              SQL migration files\n├── data/                    Runtime data (SQLite, docs, attachments)\n├── docker-compose.yml       Docker orchestration\n└── Dockerfile.api           Go API Docker image\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `PORT` | `3000` | Go API TCP port |\n| `DATA_DIR` | `./data` | Path for SQLite database and documents |\n| `BCRYPT_COST` | `12` | Password hashing cost factor |\n| `JWT_SECRET` | auto-generated | JWT signing key (auto-saved to `data/jwt.key` if not set) |\n\n### Port Mapping\n\nThe default Docker Compose setup exposes the application on port `8081`. To change it, edit `docker-compose.yml`:\n\n```yaml\nservices:\n  nginx:\n    ports:\n      - \"YOUR_PORT:80\"\n```\n\n## Data Persistence\n\nAll runtime data is stored in the `./data` directory:\n\n```\ndata/\n├── wiki.db              SQLite database\n├── wiki.db-wal          SQLite WAL file\n├── wiki.db-shm          SQLite shared memory\n├── docs/                Markdown documents\n│   └── {space-slug}/\n│       └── {page-id}.md\n└── attachments/         Uploaded files\n    └── {page-id}/\n        └── {uuid}-{filename}\n```\n\nThe `data/` directory is bind-mounted into the Docker containers. It is excluded from Git via `.gitignore`.\n\n## Backup\n\nLitestream provides continuous replication of the SQLite database to a configurable target (local volume, S3, or SFTP). Configure via environment variables in `docker-compose.yml`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flstep%2Fpinkas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flstep%2Fpinkas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flstep%2Fpinkas/lists"}