• TypeScript 57.1%
  • Vue 40.4%
  • CSS 1.4%
  • Dockerfile 0.9%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-01 07:57:27 +01:00
.agents/skills/nuxt-ui chore(deps): update all non-major dependencies (#246) 2026-11-10 07:39:32 +01:00
.cursor/rules Update package dependencies, switch npm registry to public, and add h… (#50) 2025-12-17 16:21:25 +01:00
.github/workflows chore: release 1.6.4 (#263) 2026-11-30 21:16:43 +01:00
.mise-tasks Chore/mise uniform tooling (#194) 2026-08-26 17:22:25 +02:00
.vscode Features/conversation (#127) 2026-06-03 17:29:27 +02:00
_imgs Replaced the Readme image 2025-10-01 11:43:29 +02:00
app Add foto mode button 2026-11-16 14:52:23 +01:00
docker chore: vllm v0.34.0 like kdkp-kis-k8s-config (#261) 2026-11-30 21:01:58 +01:00
i18n/locales Add foto mode button 2026-11-16 14:52:23 +01:00
public Feat/languages (#187) 2026-08-04 17:36:48 +02:00
scripts Features/conversation (#127) 2026-06-03 17:29:27 +02:00
server chore: release 1.6.0 (#252) 2026-11-16 08:32:01 +01:00
shared/models fix: rework photo translation and fix validated bugs (#251) 2026-11-16 08:03:55 +01:00
tests test(e2e): assert on the toast title, not the aria-live announcer (#260) 2026-11-24 07:55:14 +01:00
.dockerignore Features/conversation (#127) 2026-06-03 17:29:27 +02:00
.editorconfig first commit 2025-07-17 17:46:47 +02:00
.env.buildtime.schema Features/conversation (#127) 2026-06-03 17:29:27 +02:00
.env.dev.schema Use mise for Docker toolchain management (#214) 2026-08-28 16:49:50 +02:00
.env.runtime.schema fix(logging): follow the cross-app log contract (#257) 2026-11-20 11:55:56 +01:00
.env.schema Features/conversation (#127) 2026-06-03 17:29:27 +02:00
.gitignore Chore/mise uniform tooling (#194) 2026-08-26 17:22:25 +02:00
.npmrc Update package dependencies, switch npm registry to public, and add h… (#50) 2025-12-17 16:21:25 +01:00
biome.json Chore/mise uniform tooling (#194) 2026-08-26 17:22:25 +02:00
bun.lock chore: release 1.6.4 (#263) 2026-11-30 21:16:43 +01:00
bunfig.toml fix(deps): node-forge 1.4.2 (security), drop expired nuxt cooldown exemption (#248) 2026-11-10 07:40:32 +01:00
codecov.yml chore(deps): update all non-major dependencies (#246) 2026-11-10 07:39:32 +01:00
colors.ts tailwind migration 2025-09-23 11:55:44 +02:00
Dockerfile fix: rework photo translation and fix validated bugs (#251) 2026-11-16 08:03:55 +01:00
LICENSE first commit 2025-07-17 17:46:47 +02:00
mise.toml fix(deps): update all non-major dependencies (#256) 2026-11-23 20:49:32 +01:00
nuxt.config.ts fix(deps): update all major dependencies (major) (#258) 2026-11-30 20:49:50 +01:00
package.json chore: release 1.6.4 (#263) 2026-11-30 21:16:43 +01:00
playwright.config.ts Chore/mise uniform tooling (#194) 2026-08-26 17:22:25 +02:00
publiccode.yml chore(deps): update all non-major dependencies (#246) 2026-11-10 07:39:32 +01:00
README.md fix(deps): update all non-major dependencies (#256) 2026-11-23 20:49:32 +01:00
renovate.json chore(renovate): 7-day minimumReleaseAge (#264) 2026-12-01 07:57:27 +01:00
skills-lock.json Features/conversation (#127) 2026-06-03 17:29:27 +02:00
tsconfig.json feat: refactor domain and tone selection components; improve code consistency and formatting 2025-07-24 16:08:39 +02:00

BS Translator (Frontend)

BS Translator is a modern web application for advanced text translation with file processing capabilities. Built with Nuxt.js and TypeScript, it provides intelligent translation services with customizable tone, domain-specific terminology, and support for multiple file formats. This repository contains only the frontend code; the backend is written in Python FastAPI.

GitHub License Checked with Biome


DCC Documentation & Guidelines | DCC Website


Screenshot of BS Translator

Features

  • Intelligent Translation: AI-powered translation between 50+ languages with auto-detection
  • Tone & Style Control: Customizable translation tone (formal, informal, technical, creative, concise)
  • Domain-Specific Translation: Specialized translations for legal, medical, technical, financial, and other domains
  • File Conversion: Support for multiple file formats (TXT, DOCX, PPTX, XLSX, PDF, HTML, RTF, Markdown)
  • Custom Glossary: Personal terminology management for consistent translations
  • Real-time Translation: Live translation with streaming responses
  • Rich Text Output: Markdown-formatted translations with rich text clipboard support
  • Document Export: Download translations as Word documents
  • Multilingual Interface: Available in English and German
  • Drag & Drop Support: Easy file upload with visual feedback
  • Guided Onboarding Tour: Built-in walkthrough with restart controls from the navigation bar
  • Installable PWA: App manifest and icons for adding the translator to devices

Technology Stack

  • Frontend: Nuxt.js with TypeScript and Composition API
  • UI Framework: Nuxt UI
  • Package Manager: Bun
  • Internationalization: Nuxt I18n
  • State Management: Vue Composition API with composables
  • File Processing: Vue Use for drag & drop and file handling
  • Markdown Processing: Nuxt MDC for rich text rendering

Setup

Environment Configuration

Create a .env file in the project root with the required environment variables:

APP_MODE=dev  # can be dev, ci, build or prod see https://dcc-bs.github.io/documentation/dev-setup/varlock.html

Optional Environment Variables

The following environment variables have defaults and can be overridden as needed:

Variable Description Default Type
App Configuration
USE_FEEDBACK Enable feedback feature true boolean
DUMMY Use dummy data (no backend requests) false string
Build-time Variables
LOGGER_LAYER_URI Logger layer Nuxt module github:DCC-BS/nuxt-layers/pino-logger URL
Runtime Variables
API_PORT Backend API port 8000 port
NUXT_API_URL Backend API URL http://localhost:8000 (dev) URL (public)
NUXT_FEEDBACK_GITHUB_TOKEN GitHub token for feedback - string (sensitive, required if USE_FEEDBACK=true)
LOG_LEVEL Log level baked in at build time; at runtime it is the default of NUXT_PUBLIC_LOGGER_LOGLEVEL debug (dev), info (otherwise) enum: trace, debug, info, warn, error, fatal
NUXT_PUBLIC_LOGGER_LOGLEVEL Runtime log level of the server and the browser loggers LOG_LEVEL enum: trace, debug, info, warn, error, fatal
NUXT_PUBLIC_LOGGER_APP Service name in log lines (app field) bs-translator-frontend string
NUXT_PUBLIC_APP_CONFIG_APP_LIST_URL_TEMPLATE App switcher link template, {APP_NAME} is replaced by the app slug http://{APP_NAME}.localhost.ch (required in prod) string

Note: Build-time variables (LOGGER_LAYER_URI) are resolved during nuxt build and must be passed as build arguments in Docker.

Varlock & Secrets Management

We use varlock for environment variable validation and default value management. Varlock integrates with the Docker build process and can optionally fetch secrets from Proton Pass during development.

To validate and load environment variables:

varlock load

Proton Pass Integration (Optional)

For automatic secret retrieval from Proton Pass, ensure you have:

  1. Install pass-cli
  2. Authenticate with Proton Pass: pass-cli login
  3. Validate environment: varlock load

Note: Proton Pass integration is optional. If you prefer to set environment variables manually, you can skip the Proton Pass setup and provide values directly in your .env file or environment. Varlock will use the manually provided values instead of fetching from Proton Pass.

In production (Docker), varlock runs as the container entrypoint, loading secrets at runtime.

Install Dependencies

Make sure to install dependencies using Bun:

bun install

Development

Start the Development Server

bun run dev

Dummy Mode

For development without a backend connection, use dummy mode which returns mock data instead of calling the backend API:

bun run dummy

This allows frontend development without running the Python backend services.

Backend Services

This frontend requires the BS Translator backend service. The backend and all related services (LLM, Faster Whisper, Docling) are configured in the docker/ folder.

Development Mode (Backend Only)

Start only the backend services for development:

bun run docker:up

Stop backend services:

bun run docker:down

Note: In dev, the backend is exposed on http://localhost:8000 (as configured in docker/docker-compose.dev.yml). Ensure your .env has APP_MODE=dev so NUXT_API_URL defaults to http://localhost:8000.

Full Stack with Nginx

To run all services including the frontend behind an nginx reverse proxy:

cd docker
varlock run -- docker compose up

This starts:

  • Frontend (Nuxt.js app)
  • Backend (Python FastAPI)
  • LLM Service (vLLM with Qwen model)
  • Faster Whisper (Speech-to-text)
  • Docling (Document parsing, OCR through GLM-OCR)
  • GLM-OCR (vLLM serving zai-org/GLM-OCR for docling)
  • Nginx (Reverse proxy on port 8090, only the frontend is exposed)

The stack is configured through docker/.env.schema. The frontend is built without the feedback control by default; set USE_FEEDBACK=true and NUXT_FEEDBACK_GITHUB_TOKEN to enable it.

Note: Ensure you have varlock configured with Proton Pass for environment variable management.

Project Architecture

app/
├── components/       # Vue components for translation UI
├── composables/      # Reusable composition functions
├── models/           # TypeScript interfaces and type definitions
├── pages/            # Application pages and routes
├── services/         # API communication services
└── utils/            # Utility functions for file conversion and text processing
i18n/                 # Internationalization configuration and locale files
server/               # API endpoints and server middleware (including health probes)
public/               # PWA icons and manifest assets served at the app root
docker/               # Docker Compose service definitions, nginx config, and env schemas
shared/               # Shared types and utilities
scripts/              # Development scripts (docker-up, docker-down)

Testing & Linting

Format code with Biome:

bun run lint

Check and fix code issues:

bun run check
  • Run end-to-end tests (Playwright):
bunx playwright install --with-deps # first time only
bun run test:e2e

Health Endpoints

  • /api/health/liveness: Event-loop liveness check.
  • /api/health/startup: Confirms the Nuxt server finished bootstrapping.
  • /api/health/readiness: Verifies connectivity to the upstream backend API and returns 503 when dependencies are unavailable.

Key Components

  • TranslateView: Main translation interface with language selection and text input/output
  • LanguageSelectionView: Smart language picker with flag icons and auto-detection
  • DomainSelectionView: Domain-specific translation options
  • ToneSelectionView: Translation tone and style selector
  • SourceTextView: Text input with file drop zone and conversion capabilities
  • TargetTextView: Translation output with markdown rendering and export options

API Integration

The frontend communicates with a Python FastAPI backend through:

  • /api/translate/text - Streaming text translation endpoint
  • /api/translate/image - Image translation endpoint
  • /api/detect-language - Automatic language detection endpoint
  • /api/convert - File conversion endpoint
  • /api/transcribe/audio - Audio transcription endpoint

Docker Deployment

The application includes a multi-stage Dockerfile for production deployment with varlock runtime validation.

Docker Build Arguments

The Dockerfile accepts the following build-time arguments:

Argument Default Description
LOGGER_LAYER_URI github:DCC-BS/nuxt-layers/pino-logger Logging layer implementation.
USE_FEEDBACK true Build the feedback control. The container then requires NUXT_FEEDBACK_GITHUB_TOKEN at runtime.

These are resolved during nuxt build and must be passed as build arguments:

# Build the image (without the feedback control)
docker build --build-arg USE_FEEDBACK=false -t bs-translator-frontend .

# Run the container
docker run -p 3000:3000 \
  -e NUXT_API_URL=http://<backend-host>:8000 \
  -e NUXT_PUBLIC_APP_CONFIG_APP_LIST_URL_TEMPLATE='https://{APP_NAME}.example.ch' \
  bs-translator-frontend

With the default USE_FEEDBACK=true build, also pass -e NUXT_FEEDBACK_GITHUB_TOKEN=<token>.

License

MIT © Data Competence Center Basel-Stadt

DCC Logo

Datenwissenschaften und KI
Developed with ❤️ by DCC - Data Competence Center