TextMate is a modern web application for advanced text editing, correction, and document validation. Built with Nuxt.js and TypeScript, it provides a rich set of tools to enhance writing experiences. This repository contains only the frontend code; the backend is written in Python FastAPI and available at https://github.com/DCC-BS/text-mate-backend.
DCC Documentation & Guidelines | DCC Website
- Grammar Correction: Identifies and suggests fixes for grammar and spelling issues
- Text Rewriting: Offers alternative phrasings with customizable style, audience, and intent
- Document Advisor: Validates texts against selected reference documents with PDF preview
- Word Synonyms: Intelligent synonym suggestions based on context
- Sentence Rewrite: Context-aware sentence transformation
- User Dictionary: Personal dictionary for storing specialized vocabulary
- Multilingual Support: Available in English and German
- MS Teams Integration: Built-in support for Microsoft Teams platform
Eight specialized AI-powered text transformations:
- Summarize: Generate concise summaries of long texts
- Bullet Points: Convert paragraphs into structured bullet points
- Formality: Adjust text formality level (formal/informal)
- Medium Length: Optimize text for medium-length output
- Social Media: Optimize content for social media platforms
- Character Speech: Adapt text to character voice and speech patterns
- Custom: Flexible custom text transformations
- Frontend: Nuxt.js with TypeScript and Composition API
- UI Framework: Nuxt UI
- Text Editor: Tiptap
- Package Manager: Bun
- Internationalization: Nuxt I18n
- PDF Handling: Vue PDF Embed
For detailed documentation on the DCC project, please refer to the DCC Documentation.
Create a .env file in the project root with the required environment variables:
APP_MODE=dev # can be dev, build or prod see https://dcc-bs.github.io/documentation/dev-setup/varlock.html
AUTH_MODE=none # none or azureThe 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 | |||
AUTH_LAYER_URI |
Auth layer Nuxt module | Auto from AUTH_MODE |
URL |
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) |
NUXT_PUBLIC_LOGGER_LOG_LEVEL |
Frontend log level | debug (dev), info (prod) |
enum: trace, debug, info, warn, error, fatal |
LOG_LEVEL |
Server log level | debug |
enum: debug, trace, info, warn, error, fatal |
Note: Build-time variables (
AUTH_LAYER_URI,LOGGER_LAYER_URI) are resolved duringnuxt buildand must be passed as build arguments in Docker.
When AUTH_MODE=azure, the following Azure AD variables are required:
| Variable | Description | Default | Type |
|---|---|---|---|
NUXT_AZURE_AUTH_SECRET |
Session encryption secret | - | string (sensitive, required) |
NUXT_AZURE_AUTH_CLIENT_ID |
Azure AD client ID | Proton Pass (dev) | UUID (public) |
NUXT_AZURE_AUTH_TENANT_ID |
Azure AD tenant ID | Proton Pass (dev) | UUID (public) |
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 (public) |
NUXT_AZURE_AUTH_ORIGIN |
Auth origin URL | http://localhost:3000/api/auth (dev) |
URL (public) |
Note: Generate the
NUXT_AZURE_AUTH_SECRETwith:openssl rand -base64 32
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 loadFor automatic secret retrieval from Proton Pass, ensure you have:
- Install pass-cli
- Authenticate with Proton Pass:
pass-cli login - 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
.envfile 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.
Make sure to install dependencies using Bun:
bun installStart the development server on http://localhost:3000:
bun run devFor debugging with inspector:
bun run debugFor development without a backend connection, use dummy mode which returns mock data instead of calling the backend API:
bun run dummyThis allows frontend development without running the Python backend services.
This frontend requires the Text-mate backend service. The backend and all related services (LLM, LanguageTool) are configured in the docker/ folder.
Start only the backend services for development:
bun run docker:upStop backend services:
bun run docker:downTo run all services including the frontend behind an nginx reverse proxy:
cd docker
varlock run -- docker compose upThis starts:
- Frontend (Nuxt.js app)
- Backend (Python FastAPI)
- LLM Service (vLLM with Qwen model)
- LanguageTool (Grammar checking)
- Nginx (Reverse proxy)
Note: Ensure you have varlock configured with Proton Pass for environment variable management.
app/
├── components/ # Vue components (PascalCase)
│ ├── text-editor/ # Text editor components
│ └── tool-panel/ # Tool panel components
├── composables/ # Vue composition functions (useXxx)
├── utils/ # Utility functions
├── assets/
│ ├── models/ # TypeScript models
│ ├── services/ # API services
│ └── queries/ # API queries
shared/
└── types/ # Shared TypeScript types
server/
├── api/ # API endpoints (kebab-case)
└── plugins/ # Server plugins
tests/
├── assets/ # Unit tests (*.test.ts)
└── e2e/ # E2E tests (*.spec.ts)
Run tests with Vitest:
# Run tests
bun test
# Run tests in watch mode
bun test:watch
# Generate coverage report
bun test:coverageFormat code with Biome:
bun run lintCheck and fix code issues:
bun run checkEnd-to-end tests cover key features:
- Undo/Redo operations
- Text statistics
- Text rewriting
- Problem detection
- Quick actions
Build the application for production:
bun run buildGenerate static site:
bun run generatePreview production build:
bun run previewThe application includes a multi-stage Dockerfile for production deployment.
The Dockerfile accepts the following build-time arguments to configure Nuxt layers:
| Argument | Default | Description |
|---|---|---|
AUTH_LAYER_URI |
github:DCC-BS/nuxt-layers/azure-auth |
Authentication layer implementation. Use github:DCC-BS/nuxt-layers/no-auth for development without Azure AD. |
LOGGER_LAYER_URI |
github:DCC-BS/nuxt-layers/pino-logger |
Logging layer implementation. |
These are resolved during nuxt build and must be passed as build arguments:
# Build with default auth (Azure AD)
docker build -t text-mate-frontend .
# Build with no-auth for development
docker build --build-arg AUTH_LAYER_URI=github:DCC-BS/nuxt-layers/no-auth -t text-mate-frontend .
# Run the container
docker run -p 3000:3000 text-mate-frontendFor more details, see the Auth Layer and Logger Layer documentation.
MIT © Data Competence Center Basel-Stadt
Datenwissenschaften und KI
Developed with ❤️ by DCC - Data Competence Center

