English | 简体中文
Beautiful code images for humans and APIs.
Codia turns source code into crisp images for docs, blogs, social posts, and automation. It provides a browser playground at /try-it, a render API, lightweight render statistics, and an llms.txt endpoint for agent-facing documentation.
- Interactive
/try-itplayground with language, theme, background, padding, width, line-number, copy, and download controls. POST /v1/code/renderAPI for generating code images from JSON payloads.- SQLite-backed render records for usage stats.
- OpenAPI documentation at
/docs. - Docker Compose and OVO deployment scripts.
- Node.js 24
- npm
- SQLite-compatible filesystem access
npm ci
npm run devThe app runs on http://localhost:3000 by default.
Useful commands:
npm run typecheck
npm run build
npm startPORT=3000
DATABASE_DIR=/root/apps/codia/databasesDATABASE_DIR is the directory where Codia stores codia.sqlite.
For Docker Compose, DATABASE_DIR is treated as the host persistence directory and is mounted into the container at /app/databases.
docker compose up -d --buildWith a custom database directory:
DATABASE_DIR=/root/apps/codia/databases docker compose up -d --buildRender a code image:
curl -X POST http://localhost:3000/v1/code/render \
-H "content-type: application/json" \
-d '{
"language": "typescript",
"theme": "dracula",
"code": "console.log(\"hello codia\")",
"bgColor": "#0f172a",
"borderSize": 12,
"containerWidth": 600,
"showLineNumbers": true
}'More details are available at /docs and /llms.txt.
The repository includes an OVO release workflow and deploy scripts under scripts/ovo.
The main deployment variable for database persistence is:
DATABASE_DIR=/root/apps/codia/databasesThe application always creates the directory if needed and stores the SQLite file as codia.sqlite.
npm run build:release creates a minimal OVO runtime bundle: it installs dependencies, builds dist, installs production-only node_modules, and writes a runtime Dockerfile into the release archive. The target server's Docker build only copies those runtime files into the image; it does not run npm install or compile TypeScript.