This repository contains an Elixir application that exposes a small HTTP API for converting DOCX documents into BlockNote JSON. It also provides a companion Node based service that converts BlockNote blocks into Y.js updates.
- Elixir application – defined in
mix.exs
and built with Plug and Bandit. The main router lives inlib/docspec/api.ex
and exposes a/conversion
endpoint implemented inlib/docspec/api/controller/conversion.ex
. - Node service – located in
blocknote-api
and implemented insrc/main.ts
. This service listens for JSON blocks on port9871
(configurable with thePORT
environment variable) and returns a base64 encoded Y.js update. - Docker setup –
Dockerfile
builds the Elixir release anddocker-compose.yml
wires the services behind Traefik.
The easiest way to run everything locally is with Docker:
docker-compose up --build
Alternatively you can build the Elixir release yourself:
mix deps.get
mix release
_build/prod/rel/docspec/bin/docspec start
Once running you can POST a DOCX file to convert:
curl -X POST http://localhost:4000/conversion -F "file=@path/to/document.docx"
The response body is the converted BlockNote JSON.
Elixir tests can be run with:
mix test
See LICENSE
for license information (MIT).