Sign inSign up

tiag0ss/synapse

By tiag0ss

β€’Updated 1 day ago

Markdown knowledge vaults for Myelin β€” wikilinks, mindmaps and public wikis

Image
0

137

tiag0ss/synapse repository overview

⁠Synapse

Markdown vaults companion to Myelin⁠. Notes live in MySQL; creating notes never creates PM work β€” push project/task is always an explicit manual action.

This project is a work in progress β€” bugs may still be found; please report them on GitHub.

⁠Features

  • πŸ“” Markdown vaults β€” Folder paths (meta/risks), note tree (folders first), vault switcher
  • ✏️ Editor β€” Split/edit/preview, toolbar, paste/drop images + file attachments + lightbox; autosave + unsaved warnings; Ctrl/Cmd+S
  • πŸ–ΌοΈ Whiteboards β€” Excalidraw boards as first-class vault items; maximize to full page; peek / public wiki / share viewers (pan, zoom, background; drawing chrome hidden)
  • πŸ”Ž Search β€” Filter by title/path/body; Jump to note palette (Ctrl/Cmd+O)
  • πŸ”— Wikilinks & graph β€” [[links]] (path + unique leaf), tags, backlinks, focused + full mindmap; boardβ†’note links show as (board) in References
  • πŸ“Ž Inline board embeds β€” ![[Whiteboard title]] embeds a read-only board mid-note (preview, peek, wiki, password share); plain [[Whiteboard]] stays a link
  • πŸ•˜ Revisions β€” History with side-by-side restore
  • πŸ“¦ ZIP import / export β€” Nested folders ↔ note paths; images included
  • πŸ“‹ Templates β€” Blank, meeting, risk, decision when creating notes
  • πŸ—‘οΈ Trash β€” Soft-delete notes with restore; leave shared vaults / delete owned vaults
  • βœ… Checkbox β†’ PM tasks β€” Manual create (single or bulk with progress); Synapse pulls PM closed/cancelled status
  • πŸ“€ Share note β€” Password-protected temporary links (/s/:token); Send copy/move to another vault (same Share modal)
  • πŸ‘οΈ Visibility β€” Vault wiki audience (private / authenticated / unlisted / public) + per-note overrides on /w/:slug
  • 🌐 Wiki directory β€” /w lists wikis you may open (not unlisted); private wikis only if shared with you
  • πŸ‘₯ Vault sharing β€” Read = wiki only; Edit = vault editor + wiki; invite by search or PM user id
  • πŸ” Auth β€” Local username/password and optional PM SSO (linked by email); password reset via SMTP
  • βš™οΈ Admin settings β€” Registration toggle, SMTP, PM integration switch, user management
  • πŸ€– AI todo suggestions β€” Optional external Ollama⁠ (Admin β†’ AI); analyzes a note and proposes YAML todos: β€” review/merge before save; never auto-applies
  • πŸ”Œ PM bridge β€” Per-user SSO token or personal pt_… API key (Profile); manual vaultβ†’project link; Synapse refs on PM tasks

⁠Tech Stack

ComponentTechnology
FrontendNext.js 16, React 19, TypeScript, Tailwind CSS
BackendNode.js, Express 5, TypeScript (custom server)
DatabaseMySQL 8+
AuthLocal password + optional PM SSO; JWT session cookie
Markdownmarked + Synapse extras (wikilinks, ![[board]] embeds, tags, checkboxes, Mermaid, KaTeX, highlight, callouts, footnotes, TOC)
Whiteboards@excalidraw/excalidraw (fonts copied to public/excalidraw on install / Docker build)

⁠Local Development

  1. Create MySQL database and user:
mysql -u root -p < server/database/scripts/bootstrap.sql

That creates DB pm_synapse and user synapse / password change-me-synapse-db-password (edit the SQL first if you want another password).

Or run manually:

CREATE DATABASE IF NOT EXISTS pm_synapse CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'synapse'@'localhost' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON pm_synapse.* TO 'synapse'@'localhost';
FLUSH PRIVILEGES;
  1. Copy env:
cp .env.example .env
PORT=3010
JWT_SECRET=change-me-synapse-jwt-secret
DB_HOST=localhost
DB_PORT=3306
DB_USER=synapse
DB_PASSWORD=change-me-synapse-db-password
DB_NAME=pm_synapse
PM_BASE_URL=http://localhost:3000
SSO_CLIENT_ID=synapse
SSO_CLIENT_SECRET=change-me-synapse-sso-secret
NEXT_PUBLIC_APP_URL=http://localhost:3010
  1. On Myelin (only if using SSO), set:
ALLOWED_SSO_REDIRECTS=http://localhost:3010/api/auth/sso/callback
SSO_CLIENT_ID=synapse
SSO_CLIENT_SECRET=change-me-synapse-sso-secret
  1. Install and run (from this folder):
pnpm install --ignore-workspace
pnpm run dev

Open http://localhost:3010⁠ β€” register a local account (first user becomes admin) and/or sign in with Myelin. Admins manage registration, SMTP, and users under Settings. Each user manages their personal Myelin API token under Profile. Local and SSO accounts with the same email are linked.

Note: TypeScript must stay on 5.x ([email protected]) β€” Next.js 16 does not support TypeScript 7.

⁠Docker

Build and push (same pattern as Myelin):

cp .env.docker.example .env.docker
# edit secrets + PM_BASE_URL / SSO / NEXT_PUBLIC_APP_URL

sg docker -c "./docker-build.sh"          # or: ./docker-build.sh 0.1.0
DOCKER_USERNAME=youruser docker compose up -d
curl -s http://localhost:3010/health

See DEPLOYMENT.md⁠ for compose ports, volumes, and SSO checklist.

⁠Environment Variables

VariableRequiredDefaultDescription
PORTNo3010Synapse HTTP port
JWT_SECRETYesβ€”Session JWT secret
DB_HOST / DB_PORT / DB_USER / DB_PASSWORD / DB_NAMEYesβ€”MySQL connection
DB_PROVIDERNomysqlDatabase provider
PM_BASE_URLYesβ€”Myelin base URL
SSO_CLIENT_IDYessynapseMust match PM SSO client
SSO_CLIENT_SECRETYesβ€”Must match PM SSO_CLIENT_SECRET
ENCRYPTION_KEYNoβ€”Token encryption (falls back to JWT_SECRET)
NEXT_PUBLIC_APP_URLYesβ€”Public Synapse URL (SSO redirect)
NEXT_PUBLIC_PM_BASE_URLNoβ€”Optional PM link base in the UI

⁠Ports

PortDescription
3010Synapse (frontend + API)
3000Myelin (SSO issuer)
3306MySQL

⁠Architecture

+---------------------------+          +----------------------------+
|  synapse               |  SSO +   |  myelin        |
|  Next.js + Express :3010 |  REST β†’  |  Next.js + Express :3000   |
|  MySQL: pm_synapse        |          |  MySQL/MSSQL               |
+---------------------------+          +----------------------------+

Notes and vault ACLs live only in Synapse. Task/project create goes through Myelin’s authenticated APIs with the user’s SSO token.

⁠Wiki visibility
Vault default visibilityOpen /w/:slugListed on /w
privateShare Read / Edit / Owner onlyOnly for those with access
authenticatedAny signed-in Synapse userYes (when signed in)
unlistedAnyone with the linkNo
publicEveryoneYes

Share Read = wiki only (no vault editor). Share Edit / owner = vault app + wiki. Per-note visibility filters content inside an accessible wiki; private notes are visible on the wiki only to Edit/Owner (not Share Read).

⁠Note syntax (quick)
SyntaxResult
[[Note title]] / [[folder/note]]Wikilink (open / peek)
[[@vault-slug/note]]Cross-vault wikilink
![[Whiteboard title]]Embed whiteboard mid-note (whiteboard kind only)
#tagInline tag
- [ ] / - [x]Checklist (optional PM push)
![alt](/api/vaults/:id/media/:id)Vault image
[file.pdf](/api/vaults/:id/media/:id)Attachment link

Password share links: Share… β†’ Link creates /s/:token (password + expiry). Shared notes that embed boards include board JSON in the unlock payload so guests do not need vault API access.

⁠Agent docs

This folder can be moved to its own git repository (synapse) when ready. Keep docs/PM_API_CONTRACT.md in sync whenever Synapse’s PM client changes.

Tag summary

Content type

Image

Digest

sha256:478b28b3d…

Size

356.7 MB

Last updated

1 day ago

docker pull tiag0ss/synapse