Skip to content

Migrate data-art to Node.js/TypeScript web app with Docker Compose deployment#8

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-app-to-node-typescript
Draft

Migrate data-art to Node.js/TypeScript web app with Docker Compose deployment#8
Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-app-to-node-typescript

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

The existing Python CLI-only application needs to run as a web service on a Hetzner VPS, deployable via Docker Compose alongside other services.

Changes

web/ — Node.js + TypeScript application

  • src/core.ts — port of the text→pixel→PNG algorithm using pngjs (no native deps)
  • src/server.ts — Express server exposing three endpoints:
    • POST /api/generate — accepts { text } JSON, returns PNG buffer
    • GET / — serves the browser UI
    • GET /health — liveness probe for container orchestration
  • src/core.test.ts — 16 Jest unit tests mirroring the Python test suite
  • public/index.html — self-contained dark-themed UI: textarea → generate → inline preview + PNG download

Container

  • web/Dockerfile — multi-stage Node 20 Alpine build; non-root user; wget-based HEALTHCHECK
  • docker-compose.yml (repo root) — single service definition, restart: unless-stopped
# Deploy
docker compose up --build -d
# → http://<host>:3000
# API usage
curl -X POST http://localhost:3000/api/generate \
  -H "Content-Type: application/json" \
  -d '{"text":"To be or not to be"}' --output out.png

The original Python CLI and its Dockerfile are kept untouched.

Copilot AI changed the title [WIP] Migrate application to Node.js and TypeScript with Docker support Migrate data-art to Node.js/TypeScript web app with Docker Compose deployment Apr 13, 2026
Copilot AI requested a review from duplys April 13, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants