Hekoti is a lightweight open-source self-hosted wiki for public knowledge pages and admin editing.
"Ask Hekoti and knowledge will awaken from sleep."
Разработано и создано by @hehestl
https://t.me/hehestl
https://github.com/hehestl
https://t.me/PhiloraBot
- Next.js App Router + TypeScript
- PostgreSQL + Prisma schema and SQL migrations
- Optional Redis cache/rate-limit fallback to memory
- Public read mode and admin write mode
- Admin login/password + TOTP 2FA
- Monaco-based markdown editor
- Built-in admin AI chat with slash commands
- Donations and AI agents configured from
.env
Requires Docker Compose v2.24+ (for optional env_file).
Zero-config (no .env file — defaults for Postgres/Redis are in docker-compose.yml and DATABASE_URL is assembled in docker-entrypoint.sh):
docker compose up -d --buildWith secrets and app tuning, copy the template once:
cp .env.example .env
# Edit: POSTGRES_*, HEKOTI_ADMIN_*, WEBHOOK_SECRET, etc. (DATABASE_URL is optional in Compose)
docker compose up -d --buildOn every hekoti-app start, docker-entrypoint.sh runs npx prisma migrate deploy after building DATABASE_URL from POSTGRES_* (unless DATABASE_URL is already set, e.g. external database). An empty Postgres volume is fine: migrations apply before the web server binds.
- To skip migrations (debug only):
HEKOTI_SKIP_MIGRATE=1in.env. docker compose build --no-cacheis only for recovery (e.g. files were edited inside a running container, or a broken cached layer). After a normalgit pull,docker compose up -d --buildis enough.
Migrations do not create the admin user. After the stack is up, run once (from the repo directory on the host):
docker compose exec hekoti-app npx --yes tsx prisma/seed.tsThe runtime image overlays the full pg driver tree (pg, pg-types with nested postgres-*, top-level postgres-*) plus node_modules/@prisma and bcryptjs from the builder so tsx prisma/seed.ts works under Next standalone; npx only fetches tsx if needed.
If DATABASE_URL is not set, the seed script builds it from POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB (same defaults as docker-compose.yml).
App URL: http://localhost:3310
cp .env.example .env
npm install
npm run db:generate
npx prisma migrate dev
npm run db:seed # or: npx prisma db seed
npm run devFor a throwaway database without migration history you can still use npm run db:push instead of migrate dev.
HeKoti is the identity and knowledge core of the Hehestl digital ecosystem: a small wiki that can be self-hosted beside your other services, with optional Redis, optional LanguageTool-backed grammar checks, and admin tooling (2FA, webhooks, AI links).
GET /api/health— combined probe (database required for200; Redis and LanguageTool are informational).GET /api/health/live— process up.GET /api/health/ready— databaseSELECT 1.
Point your reverse proxy at these for readiness (often /api/health or /api/health/ready).
With LANGUAGETOOL_URL set (see docker-compose.yml service hekoti-languagetool), admins can call:
POST /api/spellcheck with JSON { "text": "...", "language": "en-US" } (or "auto"). Requires an admin session cookie.
Enable Dependabot (this repo includes .github/dependabot.yml). For the default branch (e.g. hehe), enable branch protection and require the CI workflow to pass when you are ready.
prisma/migrations/0001_init/migration.sql— base wiki/auth schemaprisma/migrations/0002_agent_chat/migration.sql— admin AI chat channels/messages
/agent list/agent set <id>or/agent on <id>/ask <prompt>- Any plain text is treated as an ask request to the active agent
- HTTP-only session cookies
- Optional TOTP verification for admin login
- Login rate-limiting
- Incoming webhook signature verification
- Internal-only Postgres/Redis in Docker compose
- English docs:
docs/README.en.md - Russian docs:
docs/README.ru.md - Security and hardening notes:
docs/SECURITY.en.md
deploy/vercel.jsondeploy/railway.jsondeploy/render.yaml
Next.js (App Router), TypeScript, Prisma, PostgreSQL, optional Redis (cache + rate limits), Docker multi-stage image, optional LanguageTool in Compose.