Skip to content

getflip/phrase-corrector

Repository files navigation

Phrase Corrector

SvelteKit app for reviewing and syncing AI translation suggestions to Phrase. Runs on Node with a local SQLite database (better-sqlite3).

Development

pnpm install
pnpm dev

The dev server stores its SQLite file at ./data/db.sqlite (created automatically). Override with DB_PATH if needed.

Auth is disabled locally unless AUTH_SECRET is set — then all routes require the password (or Authorization: Bearer <secret>).

AUTH_SECRET=dev-secret pnpm dev

Run tests:

pnpm test
pnpm check

Production build

pnpm build     # → ./build (adapter-node output)
node build     # runs on PORT (default 3000)

Deploying to Northflank

The repo ships with a multi-stage Dockerfile that pnpm-installs, compiles better-sqlite3 natively, builds the SvelteKit app, and produces a slim Node 22 runtime image.

Setup steps (UI):

  1. Push this repo to GitHub/GitLab and link it to your Northflank project.
  2. Create a combined service → build type Dockerfile, dockerfile path /Dockerfile, build context /.
  3. Ports: expose 3000 as public HTTP.
  4. Environment variables:
    • AUTH_SECRET — required for auth (set as a secret).
    • DB_PATH — optional, defaults to /data/db.sqlite (matches the volume mount).
    • NODE_ENV — already set to production in the image.
  5. Persistent volume: attach a volume mounted at /data (any size — SQLite is small). Without this the DB resets on every redeploy.
  6. CI: enable build-on-push for the branch you want to deploy from.

The SvelteKit Node adapter reads PORT and HOST from env; Northflank injects PORT automatically.

Notes

  • Single-node only: one container reads/writes the SQLite file. Don't horizontally scale this service — set replicas to 1.
  • To inspect the DB on a running container, use northflank exec and run sqlite3 /data/db.sqlite.
  • Backups: snapshot the volume, or hit GET /api/export (authenticated) to dump SQL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors