The type-safe wiki your team can actually own.
Wiki is a multi-tenant knowledge base — organizations, spaces, hierarchical pages, real-time collaboration and fine-grained access control — built on an end-to-end type-safe TypeScript stack you run on your own infrastructure.
# clone, download the guided installer, run it
git clone https://github.com/lucabmn/Wiki.git
cd Wiki && ./installer
# → generates secrets, writes .env, brings the stack up
# → open http://localhost:3001 and register
One end-to-end type-safe stack
Features
Everything a team wiki needs — and nothing it doesn't
Batteries included: content model, collaboration, search, permissions and auditing, all wired together and type-checked from database to browser.
Multi-tenant by default
Every piece of content lives inside an organization. Every query is org-scoped and enforced server-side — tenants never see each other's data.
Spaces & hierarchical pages
Group pages into spaces with public / private / restricted visibility. Pages nest into a tree with fractional (LexoRank) ordering and a draft → published → archived lifecycle.
Fine-grained access control
Static and dynamic roles via Better Auth's organization plugin. Reads gate on space visibility; mutations gate on organization permissions.
Real-time collaboration
Edit pages together with live cursors, powered by a Hocuspocus + Yjs service and a shared TipTap schema. Conflict-free, offline-tolerant.
Full-text search
PostgreSQL tsvector generated columns with GIN indexes deliver instant, ranked search across every page you're allowed to see.
Type-safe API
A single oRPC router definition drives both the type-safe /rpc surface and a generated OpenAPI document — no drift between client and server.
Audit log & activity feed
Every mutation appends an audit row inside the same transaction — including destructive deletes — so you always have a trail.
Yours to self-host
Docker Compose, a guided TTY installer, and automatic HTTPS via a bundled Caddy proxy. No SaaS, no seats, no lock-in.
Architecture
A clean boundary between transport, logic and clients
The web and terminal clients talk to a Hono server over a type-safe oRPC client. All business logic and data contracts live in one place; the database, auth and env are isolated packages.
apps/web · apps/tui
React (TanStack Start) & OpenTUI clients
apps/server
Hono + oRPC handler · /rpc · /v1
packages/api
Routers · Zod schemas · access control
packages/db
Drizzle + PG
packages/auth
Better Auth
packages/env
typed env
Reads are gated on space visibility; mutations are gated on organization role. Every write runs in a transaction and appends an audit row.
Type safety, end to end
Define it once. Trust it everywhere.
One oRPC router is the single source of truth. The client is fully typed from it, and the same definition generates your OpenAPI spec — so refactors surface as compile errors, not production incidents.
// server — one definition
export const pages = {
create: authed
.input(createPageSchema)
.handler(({ input, ctx }) =>
db.insert(page).values(input)),
}
// client — inferred, no codegen
const page = await client.pages.create({
spaceId,
title: "Runbook", // ✅ types checked
})
// ^? { id: string; slug: string; ... }Self-hosting
Up and running in three steps
The only requirement is Docker with the Compose plugin. Public deployment with automatic HTTPS is a matter of entering https:// URLs and a Let's Encrypt email.
Clone & run the installer
A self-contained terminal wizard generates strong secrets and writes your .env files.
Stack comes up
Postgres, server, web and collab start via Docker Compose; migrations run automatically.
Register & onboard
Open the app, create your first organization, optionally seed sample content.
Own your team's knowledge base.
Read the docs, spin it up on your own hardware, and make it yours. It's MIT licensed — no seats, no lock-in.