Read-only mirror of https://github.com/DCC-BS/bs-ch-ki-redirects — Basel-Stadt. Issues & pull requests at the source.
  • CSS 93.4%
  • Vue 5.2%
  • TypeScript 1.1%
  • HTML 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-06 17:54:11 +02:00
.github/workflows chore(deps): update actions/checkout action to v7 2026-07-29 06:27:44 +00:00
.vscode refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00
public use a vue app 2025-09-18 13:47:35 +02:00
src updated all apps to redirect to bs-kdkp.intranet 2026-08-06 17:54:11 +02:00
.gitignore use a vue app 2025-09-18 13:47:35 +02:00
.htaccess use a vue app 2025-09-18 13:47:35 +02:00
biome.json refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00
bun.lock refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00
env.d.ts use a vue app 2025-09-18 13:47:35 +02:00
index.html use a vue app 2025-09-18 13:47:35 +02:00
LICENSE chore: add MIT License and update README for clarity on application purpose 2025-09-18 14:21:58 +02:00
package-lock.json updated all apps to redirect to bs-kdkp.intranet 2026-08-06 17:54:11 +02:00
package.json Merge pull request #43 from DCC-BS/renovate/vue-tsconfig-0.x 2026-07-29 08:27:35 +02:00
README.md chore: add MIT License and update README for clarity on application purpose 2025-09-18 14:21:58 +02:00
renovate.json Fix JSON formatting in renovate.json 2025-11-27 08:46:29 +01:00
tsconfig.app.json refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00
tsconfig.json refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00
tsconfig.node.json chore(deps): replace dependency @tsconfig/node22 with @tsconfig/node24 2026-02-12 11:56:22 +00:00
vite.config.ts refactor: update package.json scripts and improve code formatting 2025-09-18 14:16:32 +02:00

BS-CH-KI Redirects

A smart redirect application for Basel-Stadt AI services that are exclusively available within the Canton Basel-Stadt internal network. This application serves as a gateway that redirects internal users to the appropriate AI applications while providing user-friendly error pages for external users who cannot access these internal services. Built with Vue.js and TypeScript, it ensures proper access control and graceful handling of external requests.

GitHub License Checked with Biome

Features

  • Smart Redirects: Automatically routes users to appropriate AI applications based on URL paths
  • Health Checks: Verifies service availability before redirecting users
  • Error Handling: Provides user-friendly pages for unavailable services and 404 errors
  • Configurable Routes: Easy-to-maintain redirect configuration
  • Responsive Design: Works seamlessly across all device types
  • TypeScript Support: Full type safety and enhanced developer experience

Supported Applications

Currently configured to redirect to the following AI applications:

  • TextMate: Advanced text editing and correction tool
  • Transcribo: Audio transcription service
  • BS-Übersetzer: Translation service for Basel-Stadt

Technology Stack

  • Frontend: Vue.js 3 with TypeScript and Composition API
  • Build Tool: Vite
  • Type Checking: Vue TypeScript Compiler (vue-tsc)
  • Code Quality: Biome for linting and formatting
  • Package Manager: npm

Setup

Install Dependencies

Make sure to install dependencies:

npm install

Development

Start the development server on http://localhost:5173:

npm run dev

The application will automatically redirect to configured services or show appropriate error pages.

Configuration

Edit src/config.ts to add or modify redirect configurations:

export const config = {
  homepageUrl: "https://www.bs.ch/ki",
  redirects: [
    {
      relativePath: "/textmate",
      to: "https://textmate.uvk8sbswc19.cmp.bs.ch",
      checkUrl: "https://textmate.uvk8sbswc19.cmp.bs.ch/api/ping",
      appName: "TextMate",
    },
    // Add more redirects here
  ],
};

Configuration on the redireceted applications

In nuxt applications add the following to nuxt.config.ts to ensure there is no CORS issues:

export default defineNuxtConfig({
    ...,
    routeRules: {
        "/api/ping": {
            cors: true,
            headers: {
                "Cache-Control": "no-store",
                "Access-Control-Allow-Origin": "*",
                "Access-Control-Allow-Methods": "GET",
                "Access-Control-Allow-Headers":
                    "Origin, Content-Type, Accept, Authorization, X-Requested-With",
                "Access-Control-Allow-Credentials": "true",
            },
        },
    },
});

An create an api route /api/ping that returns a simple response:

export default defineEventHandler(() => {
    return "pong";
});

Testing & Linting

Format and check code with Biome:

npm run check

Type check the application:

npm run type-check

Production

Build the application for production:

npm run build

Preview production build:

npm run preview

The production build includes:

  • Optimized Vue.js bundle
  • TypeScript compilation
  • Automatic .htaccess file copying for proper routing

Project Architecture

  • src/: Source code directory
    • App.vue: Main application component with redirect logic
    • config.ts: Redirect configuration and types
    • main.ts: Application entry point
    • components/: Vue components
      • Redirect.vue: Loading page shown during redirect
      • NoAccess.vue: Error page for unavailable services
      • PageNotFound.vue: 404 error page
    • assets/: Static assets and styles

How It Works

  1. Path Detection: Extracts the application path from the current URL
  2. Configuration Lookup: Finds matching redirect configuration
  3. Health Check: Pings the target service to verify availability
  4. Smart Routing:
    • If service is available: Redirects user to the target application
    • If service is unavailable: Shows "No Access" page
    • If path not found: Shows 404 page
    • If no path specified: Redirects to Basel-Stadt KI homepage

License

MIT © Data Competence Center Basel-Stadt

DCC Logo

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