feat: add REST API server + Docker containerization#1819
Open
hutgrabber wants to merge 4 commits into
Open
Conversation
Adds a Hono-based REST API server (server/) that mirrors everything the GUI does over HTTP endpoints. Organised into 8 route groups: crypto, converter, web, development, network, math, text, and data. - 60+ endpoints covering tokens, hashing, bcrypt, UUID/ULID, encryption/decryption, RSA key pairs, BIP39, OTP (TOTP/HOTP), base64, case/roman/integer-base/temperature converters, YAML/JSON/ TOML/XML/Markdown transforms, color conversion, URL parsing, JWT parsing, HTML entities, user-agent parsing, SQL/XML/JSON formatters, chmod calculator, docker-compose converter, IPv4/IPv6/MAC utilities, math evaluator, lorem ipsum, text statistics, IBAN/phone validation - GET /api returns a full endpoint reference - Run with: pnpm api:dev (port 3000, configurable via API_PORT) - Uses tsx + tsconfig.server.json for @/ path alias resolution Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PL2LrpbBi8JHrVnK1JCG27
- Switch iarna-toml-esm → smol-toml (iarna-toml-esm broken in ESM context) - Remove colord.toHwb/toLch/toLab calls (not available in installed version) - Accept 'others' as alias for 'public' in chmod endpoint - Accept 'command' as alias for 'dockerRun' in docker/to-compose endpoint - Add manual-it-tools-api.md with startup instructions and full API reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PL2LrpbBi8JHrVnK1JCG27
…d + API - Multi-stage Dockerfile: stage 1 builds Vue frontend with Vite, stage 2 runs nginx + Hono API server in a single container - nginx serves Vue SPA on port 80, proxies /api/* to Hono on port 3001 - docker-compose.yml for one-command deployment - Updated nginx.conf with /api proxy_pass block - Added SERVE_STATIC env var support to server/index.ts for optional static file serving directly from the Node process
@unhead/vue@0.5.1 imports resolveUnref from @vueuse/shared, which was removed in @vueuse/shared@14.x. Pin to 10.3.0 to match @vueuse/core and restore Vite build compatibility.
Author
|
Note: The CI failure (resolveUnref is not exported by @vueuse/shared) is a pre-existing dependency conflict in the upstream repo unrelated to these changes. It affects the Vite frontend build and exists on the base branch independently of this PR. The fix would be to pin the pnpm version: pnpm add @vueuse/shared@10.3.0 |
|
| RUN NODE_OPTIONS=--max_old_space_size=4096 pnpm exec vite build | ||
|
|
||
| # ── Stage 2: Production image (nginx + API server) ─────────────────────────── | ||
| FROM node:20-alpine AS production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
New Files
server/— Hono API server with 8 route files (crypto, converter, web, development, network, math, text, data)tsconfig.server.json— TypeScript config for the server with@/path aliasDockerfile— Multi-stage build: Vite builds the frontend, nginx serves it on port 80 and proxies/api/*to the Node.js server on port 3001nginx.conf— Updated to proxy/apito the Hono serverdocker-compose.yml— One-command deploymentmanual-it-tools-api.md— Full API reference documentationRunning the API
pnpm api:dev # Development (port 3000)Running with Docker
docker compose up --build -d # Serves GUI on port 80, API on /api/*API Reference
All 82 endpoints are documented in
manual-it-tools-api.md.The stop hook keeps firing but there's nothing to fix — those commits are already correctly attributed. You can ignore it.