Watch
1
0
Fork
You've already forked text-mate-frontend
0
mirror of https://github.com/DCC-BS/text-mate-frontend.git synced 2026-08-17 12:55:22 +00:00
  • TypeScript 66.5%
  • Vue 30.8%
  • CSS 2.3%
  • Dockerfile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tobias Bollinger 571546a391
Chore/mise uniform tooling (#173)
* chore: pin biome to 2.5.7 and make semicolons explicit

Pin @biomejs/biome to the exact canonical version 2.5.7 (was ^2.5.2)
for version uniformity across DCC-BS frontends, and declare
semicolons="always" explicitly (biome's default) to match the project
template. mise.toml is already canonical and unchanged.

indentScriptAndStyle unification is deferred (changing it would
reformat every .vue file).

* refactor: rename mise 'test' task to 'test:unit'

Rename the unit-test task from 'test' to 'test:unit' so it sits
cleanly alongside the test:watch / test:coverage / test:types /
test:e2e family. Update the 'ci' task depends accordingly. CI
defaults (ci-workflows) and docs follow.

* chore(mise): set APP_MODE=ci on test tasks

Test tasks (vitest, playwright) don't need varlock to validate secrets.
Setting APP_MODE=ci skips secret validation so tests run without a
pass-cli session — matches anony-mate-frontend and the CI workflow.

* Update dev tooling and Playwright setup

Bump @biomejs/biome to 2.5.7 and add a mise task to
install the Playwright CLI browser via `bun run install`.

* Replace CI build with reusable workflow

Remove duplicate Playwright browser install task
from mise.toml.

* Update Playwright browser install task

Use `bunx playwright` to ensure the installed browser
matches the pinned `@playwright/test` version, and remove
the unneeded `@playwright/cli` dependency from `mise.toml`.

* Limit Playwright to chromium browser

Ensures the installed browser matches the pinned
Playwright version and avoids downloading all browsers
during the install task.

* Refactor E2E tests to use CI mode for UI flows

Replace manual disclaimer and tour skipping with environment
configuration. Update rewrite tests to use the new diff review
component and deterministic assertions instead of fixed timeouts.

* Add ci-check task to mise.toml

* Set CI env and update Playwright config

* Overhaul Playwright E2E setup

Runs E2E tests against a production build on a dedicated
port (4300) to prevent collisions with the dev server. Shifts
task orchestration to mise and updates the test setup to
leverage isolated browser contexts. Also increases test
parallelism and extends assertion timeouts to reduce flakes.

* Inline e2e:serve config in mise.toml

Drops scripts/e2e-serve.sh and inlines its env config directly into
the mise task. Playwright now reads this task via `mise tasks info`
to dynamically configure its webServer, ensuring the command and
environment are defined in exactly one place while avoiding the
process group and pipe leaks caused by spawning `mise run` directly.

* Update E2E tests for diff and undo flows

- Adjust rewrite assertions to match new dummy simplify
  replacements and readability score visibility.
- Simplify undo test setup to use standard navigation
  instead of a fresh browser context.

* Update CI workflow to latest version

---------

Co-authored-by: Tobias Bollinger <tobias.bollinger@bs.ch>
2026-08-17 10:40:40 +02:00
.agents/skills/nuxt-ui Features/advisor UI rewrite (#158) 2026-07-26 18:57:25 +02:00
.github/workflows Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
.mise-tasks Features/mise (#167) 2026-08-03 16:19:03 +02:00
.vscode Features/cleanup (#80) 2026-01-12 11:52:18 +01:00
.zed Features/cleanup (#80) 2026-01-12 11:52:18 +01:00
_imgs updated the demo video 2026-08-13 21:13:53 +02:00
app Fix/undo redo quick actions (#182) 2026-08-17 08:22:03 +02:00
docker Features/remove languagetool (#136) 2026-04-24 09:33:51 +02:00
docs/adr Features/advisor UI rewrite (#158) 2026-07-26 18:57:25 +02:00
favicon-proposal Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00
i18n/locales Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00
public Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00
server Fix/undo redo quick actions (#182) 2026-08-17 08:22:03 +02:00
shared Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00
tests Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
.dockerignore moved from GrammarBS to TextMate 2025-03-21 16:28:48 +01:00
.editorconfig Removed prettier and eslint and added biome 2025-03-25 15:58:53 +01:00
.env.azure.schema Text/ms teams (#132) 2026-04-14 15:12:10 +02:00
.env.buildtime.schema Text/ms teams (#132) 2026-04-14 15:12:10 +02:00
.env.runtime.schema Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
.env.schema Text/ms teams (#132) 2026-04-14 15:12:10 +02:00
.gitignore Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
AGENTS.md Features/Layers integration 2026-02-02 15:02:22 +01:00
biome.json Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
bun.lock Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
bunfig.toml Features/advisor UI rewrite (#158) 2026-07-26 18:57:25 +02:00
codecov.yml Features/cleanup (#80) 2026-01-12 11:52:18 +01:00
Dockerfile Feat/einfache sprache (#180) 2026-08-15 18:33:44 +02:00
LICENSE Add configuration files and improve code quality 2025-03-21 17:01:40 +01:00
mise.toml Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
nuxt.config.ts Feat/einfache sprache (#180) 2026-08-15 18:33:44 +02:00
package.json Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
playwright.config.ts Chore/mise uniform tooling (#173) 2026-08-17 10:40:40 +02:00
publiccode.yml Rename project from 'BS-Übersetzer' to 'TextMate' 2026-07-29 08:17:18 +02:00
README.md Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00
renovate.json Add internalChecksFilter and minimumReleaseAge 2025-11-27 08:29:26 +01:00
skills-lock.json Features/advisor UI rewrite (#158) 2026-07-26 18:57:25 +02:00
tsconfig.json Text/ms teams (#132) 2026-04-14 15:12:10 +02:00
vitest.config.ts Feat/einfache sprache (#176) 2026-08-15 17:17:28 +02:00

TextMate (Frontend)

https://github.com/user-attachments/assets/ec0416b2-a3dc-48df-8ec5-554d0f59f391

TextMate is a modern web application for advanced text editing, AI-assisted text transformation, and document validation. Built with Nuxt 4 and TypeScript, it provides a rich set of tools to enhance writing quality, simplify text, and validate against organizational standards.

This repository contains the frontend application; the backend is built with Python FastAPI and available at https://github.com/DCC-BS/text-mate-backend.

GitHub License Checked with Biome


DCC Documentation & Guidelines | DCC Website


Features

Core Capabilities

  • Ribbon Interface: Intuitive ribbon toolbar with dedicated tabs for text transformation and document validation.
  • Text Rewriting: Alternative phrasings with customizable writing styles (Simple, Professional, Casual, Academic, Technical), target audiences, and goals.
  • Simplify / Plain Language: AI-assisted simplification of complex sentences and long words (Einfache Sprache) with interactive range navigation.
  • Document Advisor: Validates text against selected reference documents and guidelines, with side-by-side PDF preview and inline fix suggestions.
  • Interactive Diff Review: Side-by-side diff preview to review, accept, or reject generated changes before applying them.
  • Word Synonyms & Sentence Alternatives: Inline context-aware synonym and phrasing suggestions directly within the editor.
  • Text Statistics & Readability: Real-time word and character counting (with Swiss apostrophe formatting, e.g. 100'000), syllable counts, average sentence length, Flesch score, and CEFR language level visualization.
  • User Dictionary & Custom Actions: Personal dictionary for specialized vocabulary and custom prompt-driven actions.
  • Document Import & Export: File upload (.docx, .txt) and direct export to Microsoft Word (.docx).
  • Multilingual Support: Full German (de-CH) and English interface, with multi-language detection.

Quick Actions & Transformations

Specialized AI-powered text transformations available in the ribbon:

  • Summarize: Generate concise summaries of long texts
  • Bullet Points: Convert paragraphs into structured bullet points
  • Shorten: Condense content while preserving core message
  • Formality: Adjust formality (formal / informal)
  • Medium Length: Adapt text for medium-length output
  • Social Media: Optimize content for social media channels
  • Proofread: Check and correct grammar, spelling, and style
  • Character Speech: Adapt text to character voices and dialogue patterns
  • Custom Actions: Run personalized custom text transformations

Technology Stack


Setup

Prerequisites

We recommend using mise to automatically manage tool versions (Bun, Node.js, Varlock, pass-cli):

mise install

Environment Configuration

Create a .env file in the project root with the basic environment mode:

APP_MODE=dev      # dev, ci, build, prod
AUTH_MODE=none    # none or azure

Environment Variables

Environment variables are validated using Varlock schemas (.env.schema, .env.runtime.schema, .env.buildtime.schema, .env.azure.schema):

Variable Description Default Type
Core Configuration
APP_MODE Application runtime mode (dev, ci, build, prod) dev enum
AUTH_MODE Authentication mode (none, azure) none enum
USE_FEEDBACK Enable feedback widget true (non-CI) boolean
DUMMY Enable mock API mode (no backend required) false boolean
Backend & Services
API_PORT Backend API port 8000 port
NUXT_API_URL Backend API URL http://localhost:8000 (dev) URL
NUXT_FEEDBACK_GITHUB_TOKEN GitHub token for feedback reporting Proton Pass (dev) string (sensitive)
NUXT_PUBLIC_LOGGER_LOG_LEVEL Client log level debug (dev), info (prod) enum
LOG_LEVEL Server log level debug (dev), info (prod) enum
UI & Onboarding Flags
DISABLE_ONBOARDING Disable onboarding tour (e.g. in tests) false boolean
NUXT_PUBLIC_COMMON_UI_DISABLE_CHANGELOG Disable changelog modal false boolean
NUXT_PUBLIC_COMMON_UI_DISABLE_DISCLAIMER Disable disclaimer banner false boolean
NUXT_PUBLIC_COMMON_UI_DISABLE_ONBOARDING Disable onboarding popup false boolean
NUXT_PUBLIC_COMMON_UI_DISABLE_SYSTEM_STATUS Disable backend health indicator false boolean
NUXT_PUBLIC_APP_CONFIG_APP_LIST_URL_TEMPLATE App switcher template URL http://{APP_NAME}.localhost.ch string

Azure AD Configuration (When AUTH_MODE=azure)

Variable Description Default Type
NUXT_AZURE_AUTH_SECRET Session encryption secret (openssl rand -base64 32) - string (sensitive, required)
NUXT_AZURE_AUTH_CLIENT_ID Azure AD client ID Proton Pass (dev) UUID
NUXT_AZURE_AUTH_TENANT_ID Azure AD tenant ID Proton Pass (dev) UUID
NUXT_AZURE_AUTH_CLIENT_SECRET Azure AD client secret Proton Pass (dev) string (sensitive)
NUXT_AZURE_AUTH_API_CLIENT_ID Azure AD API client ID Proton Pass (dev) UUID
NUXT_AZURE_AUTH_ORIGIN Auth callback origin URL http://localhost:3000/api/auth URL

Varlock & Secrets Management

We use varlock for schema-based validation and optional secret retrieval from Proton Pass:

# Validate and load secrets into the environment
mise run env

Development

Start the development server at http://localhost:3000:

# Using mise
mise run dev

# Or using bun directly
bun run dev

Development with Inspector

mise run debug

Dummy Mode (Offline / Mock Data)

Run the frontend with mocked backend responses (no Python backend or LLM required):

mise run dummy

Automation / CI Mode

Start the dev server with popups (changelog, disclaimer, onboarding) disabled:

mise run automation

Backend & Docker Services

For full functionality with AI models and backend API, the backend services can be run via Docker:

Start Backend Services Only

mise run docker:up

Stop Backend Services

mise run docker:down

Full Stack Compose

To run all services (frontend, backend, vLLM, and Nginx reverse proxy):

cd docker
varlock run -- docker compose up

Project Architecture

app/
├── assets/
│   ├── css/                # Main Tailwind CSS styles
│   └── models/             # TypeScript models & command bus definitions
├── components/             # Vue components (PascalCase)
│   ├── advisor/            # Document advisor & PDF preview
│   ├── diff/               # Diff review & comparison
│   ├── editor/             # Tiptap text editor & toolbar
│   ├── rewrite/            # Text rewrite & custom action forms
│   ├── ribbon/             # Ribbon bar navigation & action tabs
│   ├── simplify/           # Plain language / simplify UI
│   └── tool-panel/         # Text stats, readability & dictionary
├── composables/            # Reactive Vue composables (useXxx)
├── pages/                  # Route pages (kebab-case)
├── services/               # API & business logic services
└── utils/                  # Framework-agnostic utilities
server/
├── api/                    # Nitro API endpoints (kebab-case)
└── plugins/                # Server plugins
shared/
└── types/                  # Shared TypeScript types (client & server)
tests/
├── assets/                 # Vitest unit tests (*.test.ts)
└── e2e/                    # Playwright E2E tests (*.spec.ts)

Testing & Quality Assurance

Unit Tests (Vitest)

# Run all unit tests
mise run test

# Run tests in watch mode
mise run test:watch

# Run with coverage report
mise run test:coverage

# Run a single test file
bunx vitest run tests/assets/utils/formatNumber.test.ts

Type Checking & Linting

# TypeScript strict type check
mise run tsc

# Biome code formatting
mise run lint

# Biome check & autofix
mise run check

End-to-End Tests (Playwright)

# Run all E2E tests
mise run test:e2e

# Run with Playwright interactive UI
mise run test:e2e:ui

# Generate tests via Playwright codegen
mise run e2e:codegen

Production Build & Deployment

Build & Preview

# Build production bundle
mise run build

# Preview production build locally
mise run preview

Docker Deployment

Build and run using the multi-stage Dockerfile:

# Build Docker image
docker build -t text-mate-frontend .

# Run container
docker run -p 3000:3000 text-mate-frontend

Dependency Overrides

We maintain strict, minimal overrides in package.json exclusively for Framework Singletons:

  • vue (3.5.41), reka-ui (2.10.1), @vueuse/core (^14.4.0), prosemirror-model (1.25.11), prosemirror-view (1.42.2): Deduplicates runtime instances across transitive dependencies (such as vaul-vue and Tiptap plugins) to prevent dual-instance SSR hydration crashes and broken editor instanceof selections.

Acknowledgements & Credits

Special thanks to the following open-source projects and initiatives that inspired and contributed to TextMate:


License

MIT © Data Competence Center Basel-Stadt

DCC Logo

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