Documentation for the Djelia API. Bambara speech, text and translation through any OpenAI-compatible client.
# Djelia docs
The documentation site for djelia.cloud, built with
Docusaurus.
## Local development
```bash
npm install
npm run start # dev server on :3000, hot reload
npm run build # production build into build/
npm run serve # serve the production build
```
## Where the API reference comes from
The pages under `/api` are generated from Djelia's own OpenAPI spec, so they cannot
drift from what the API actually serves. They are **not** checked in: `npm run build`
regenerates them every time.
By default the build reads the committed snapshot at `openapi/djelia.json`, which keeps
a clone building without network access. Point `DJELIA_OPENAPI` at the live spec to
build against what is actually running:
```bash
DJELIA_OPENAPI=
djelia.cloud npm run build
```
Set that variable in CI. Refresh the snapshot occasionally so the offline fallback does
not fall too far behind:
```bash
curl -s
djelia.cloud -o openapi/djelia.json
```
## Deploying
Any static host works. The site is fully static, with no server runtime.
| Setting | Value |
| --- | --- |
| Build command | `npm run build` |
| Output directory | `build` |
| Node version | 20 or newer |
| Environment | `DJELIA_OPENAPI=
djelia.cloud` |
### Cloudflare Pages
Connect the repository, use the settings above, then add `docs.djelia.cloud` under
**Custom domains**. Cloudflare gives you the CNAME target to add in Route 53, and
provisions the certificate itself.
### GitHub Pages
`.github/workflows/deploy.yml` builds and publishes on every push to `main`. Enable it
under **Settings → Pages → Source → GitHub Actions**. For a custom domain, add
`docs.djelia.cloud` there and put the same name in `static/CNAME`.
## Writing
> **The pages in `docs/` are mirrored from `djelia-backend` and edits here are
> overwritten.** They are written in that repository, under `djelia-docs/`, so that a
> change to an endpoint and the c …