No description
  • TypeScript 98.1%
  • Dockerfile 1.4%
  • Shell 0.5%
Find a file
Ossama Al-Alali 64c583412b feat(selfhost): SQLite storage support
- dispatch STORAGE_URI by scheme: sqlite: -> @keyv/sqlite, else postgres
- STORAGE_TTL unset (or non-positive) now means no expiry; upstream
  silently defaulted to 24h, which expires stored boards
- touch() uses the touch-config TTL instead of the storage TTL
- entrypoint only waits for pg_isready on postgres URIs
- allow underscores in file id params (excalidraw fallback FileIds are
  nanoid, alphabet includes _)
2026-07-30 11:30:46 +02:00
.devcontainer chore: All minor patch updates 61e45615d5 (#96) 2025-11-27 14:23:41 +01:00
.github fix: apply pnpm finalizations (#170) 2026-06-19 16:52:52 +02:00
src feat(selfhost): SQLite storage support 2026-07-30 11:30:46 +02:00
test Refactor tests (#108) 2025-12-30 13:15:12 +01:00
.dockerignore fix: switch to pnpm, harden docker, harden GitHub release (#158) 2026-05-30 12:02:50 +02:00
.env.default add env default 2023-12-21 16:19:52 +01:00
.eslintrc.js chore: init nest project 2021-09-06 17:10:06 +02:00
.gitignore fix: switch to pnpm, harden docker, harden GitHub release (#158) 2026-05-30 12:02:50 +02:00
.npmrc fix: switch to pnpm, harden docker, harden GitHub release (#158) 2026-05-30 12:02:50 +02:00
.prettierrc chore: init nest project 2021-09-06 17:10:06 +02:00
docker-compose.yml add health route (#19) 2024-03-20 10:48:31 +01:00
Dockerfile fix: switch to pnpm, harden docker, harden GitHub release (#158) 2026-05-30 12:02:50 +02:00
entrypoint.prod.sh feat(selfhost): SQLite storage support 2026-07-30 11:30:46 +02:00
LICENSE docs: add MIT license 2022-02-07 19:58:56 +00:00
nest-cli.json chore: init nest project 2021-09-06 17:10:06 +02:00
package.json feat(selfhost): SQLite storage support 2026-07-30 11:30:46 +02:00
pnpm-lock.yaml feat(selfhost): SQLite storage support 2026-07-30 11:30:46 +02:00
pnpm-workspace.yaml fix: apply pnpm finalizations (#170) 2026-06-19 16:52:52 +02:00
README.md fix: switch to pnpm, harden docker, harden GitHub release (#158) 2026-05-30 12:02:50 +02:00
tsconfig.build.json chore: init nest project 2021-09-06 17:10:06 +02:00
tsconfig.json Node 24 update (#68) 2025-08-11 11:45:51 +02:00

excalidraw-storage-backend

Forked from https://gitlab.com/kiliandeca/excalidraw-storage-backend

This is a reimplementation of excalidraw-json suitable for self hosting you own instance of Excalidraw.

It can be used with kiliandeca/excalidraw-fork

DockerHub kiliandeca/excalidraw-storage-backend

Feature:

  • Storing scenes: when you export as a link
  • Storing rooms: when you create a live collaboration
  • Storing images: when you export or do a live collaboration of a scene with images

It use Keyv as a simple K/V store so you can use the database of your choice.

Development

This project uses pnpm (pinned via the packageManager field) and requires Node.js >=24. Enable pnpm through Corepack, which ships with Node:

corepack enable
pnpm install --frozen-lockfile

Common scripts:

pnpm start:dev      # start in watch mode
pnpm build          # compile to dist/
pnpm test           # run unit tests
pnpm format:check   # verify formatting
pnpm audit --prod   # check shipped dependencies for vulnerabilities

Alternatively, use the provided Docker Compose setup for a containerised dev environment:

docker compose up

Environement Variables

Name Description Default value
PORT Server listening port 8080
GLOBAL_PREFIX API global prefix for every routes /api/v2
STORAGE_URI Keyv connection string, example: redis://user:pass@localhost:6379. Availabe Keyv storage adapter: redis, mongo, postgres and mysql "" (in memory non-persistent)
STORAGE_TTL Time to live for data null
LOG_LEVEL Log level (debug, verbose, log, warn, error) warn
BODY_LIMIT Payload size limit for scenes or images 50mb
ENABLE_POSTGRES_TTL_SERVICE Enabling the Postgres TTL Service will clean up expired items once a day. This will break if used with a non-postgres STORAGE_URI. false
ENABLE_POSTGRES_TOUCH Enabling the Postgres Touch function allows for optimized TTL refreshes via direct SQL updates without reading the file value. Requires a valid STORAGE_URI to be set. false

Env Variables for Postgres

For setting postgres pool variables, a few code adjustment have to be made in the storage.service.ts:

const store = new (require('@keyv/postgres'))({
  uri,
  max: 1,
});

const keyv = new Keyv({
  store,
  ttl,
});