Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

288 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructor

A web application for authoring and playing back step-by-step instructions. Instructions are authored as human-readable YAML documents and stored in a database. Playback guides the user through each step with timers, progress tracking, and support for concurrent tasks.

Features

  • Instruction authoring via the same type-aware wizard or raw YAML editor on create and edit pages, with validation, bidirectional switching, and templates available only when creating instructions. Failed saves preserve the form and show actionable feedback.
  • Interactive playback with per-step countdown/count-up timers, progress tracking, pause/resume, and local state persistence across sessions.
  • Nested instructions that flatten into the parent flow, with color-coded origins in the step list. sync_end starts nested work at its latest start time when both instructions have duration estimates; late starts are flagged.
  • Concurrent groups for parallel steps with fork-join semantics.
  • Pre-check screen to confirm required tools and ingredients before playback starts.
  • Private media storage with direct signed uploads, instruction-scoped asset IDs in YAML, and lazily signed playback URLs.
  • Accessibility support with a localized skip-to-content link, labeled editor controls, and screen-reader progress feedback.

Warning

This project is a work in progress. Breaking changes can happen at any time, and the application hasn't been optimized yet.

Note

This project made use of AI coding agents.

Getting started

pnpm install
pnpm db:seed    # insert sample instructions
pnpm dev        # start the dev server on :3000

Hosting with Docker Compose

services:
  instructor:
    container_name: instructor
    image: ghcr.io/nimec01/instructor
    user: '1000:1000'
    restart: unless-stopped
    ports:
      - 3000:3000
    volumes:
      - ./data:/app/.data

Make sure the ./data folder has correct permissions.

The app is then reachable at http://localhost:3000.

Media storage

Configure S3-compatible storage using server-only environment variables:

NUXT_MEDIA_STORAGE_ENDPOINT=http://localhost:9000
NUXT_MEDIA_STORAGE_BUCKET=instructor-media
NUXT_MEDIA_STORAGE_REGION=eu-west-1
NUXT_MEDIA_STORAGE_ACCESS_KEY_ID=your-access-key
NUXT_MEDIA_STORAGE_SECRET_ACCESS_KEY=your-secret-key
NUXT_MEDIA_STORAGE_FORCE_PATH_STYLE=true

Create the bucket as private. Configure bucket CORS to allow the local and deployed app origins, GET, HEAD, and PUT, the Content-Type and Range request headers, and expose Accept-Ranges, Content-Length, Content-Range, and ETag. For example:

[
  {
    "AllowedOrigins": ["http://localhost:3000", "https://app.example.com"],
    "AllowedMethods": ["GET", "HEAD", "PUT"],
    "AllowedHeaders": ["Content-Type", "Range"],
    "ExposeHeaders": ["Accept-Ranges", "Content-Length", "Content-Range", "ETag"],
    "MaxAgeSeconds": 3600
  }
]

Optional username/password accounts

Account authentication is disabled by default, so an account-free installation continues to use the shared deployment-wide Instruction list. To enable username/password accounts, configure the following server-only variables:

In account-enabled installations, signed-in Users can list and manage only their own private Instructions. Instance-administrator status does not grant access to another User's Instructions. Existing ownerless Instructions stay hidden and are never assigned automatically; account-free installations continue to share them deployment-wide.

NUXT_AUTH_ENABLED=true
NUXT_AUTH_REQUIRED=false
NUXT_AUTH_USERNAME_PASSWORD_ENABLED=true
NUXT_AUTH_SELF_REGISTRATION_ENABLED=false
NUXT_AUTH_BOOTSTRAP_TOKEN=replace-with-a-private-one-time-token
NUXT_AUTH_BASE_URL=https://instructor.example.com
NUXT_AUTH_SECRET=replace-with-a-random-secret-at-least-32-characters-long

The first account always requires the private bootstrap token; the first registered User becomes the instance administrator. Once an account exists, registration remains closed unless NUXT_AUTH_SELF_REGISTRATION_ENABLED=true. Never expose the bootstrap token or auth secret to the browser.

Set NUXT_AUTH_REQUIRED=true to require a signed-in User across application pages and API routes. This setting requires NUXT_AUTH_ENABLED=true; the app fails at startup if the gate is enabled without account authentication. Login, configured provider callbacks, and permitted registration/bootstrap remain available. Anonymous page requests are redirected to /login, while unauthenticated API requests receive 401.

Email verification is optional and off by default. To require it, enable NUXT_AUTH_EMAIL_VERIFICATION_REQUIRED=true and configure SMTP delivery:

NUXT_AUTH_SMTP_HOST=smtp.example.com
NUXT_AUTH_SMTP_PORT=587
NUXT_AUTH_SMTP_SECURE=false
NUXT_AUTH_SMTP_USERNAME=...
NUXT_AUTH_SMTP_PASSWORD=...
NUXT_AUTH_SMTP_FROM=Instructor <no-reply@example.com>

Host-configured OIDC providers

Configure one or more OpenID Connect providers in the deployment environment. Provider credentials are never returned by the auth configuration endpoint or sent to the browser:

NUXT_AUTH_OIDC_PROVIDERS='[
  {
    "providerId": "company",
    "name": "Company SSO",
    "discoveryUrl": "https://idp.example.com/.well-known/openid-configuration",
    "clientId": "replace-with-client-id",
    "clientSecret": "replace-with-client-secret",
    "emailVerificationPolicy": "provider"
  }
]'

Register https://instructor.example.com/api/auth/callback/company as the provider's redirect URI. providerId must start with a lowercase letter, then use lowercase letters, digits, or hyphens; it must be unique. Instructor verifies OIDC ID tokens using the provider's discovery metadata and JWKS, and requests the openid, profile, and email scopes.

Set emailVerificationPolicy to provider to require a valid provider ID token with email_verified: true. Set it to application to require the existing application email-verification policy and SMTP configuration; users must verify the email sent by Instructor before receiving a session. Set it to none to allow sign-in without email verification; Instructor will not send a verification email or mark the email verified for that provider. This does not disable email verification for username/password accounts. The first OIDC account requires the same private bootstrap token as username/password registration. The token is checked by Instructor before redirecting and is not sent to the identity provider. Later OIDC registrations follow NUXT_AUTH_SELF_REGISTRATION_ENABLED.

Users can link another provider from the signed-in account controls. Matching email addresses do not automatically link or merge identities.

The auth tables are managed by Drizzle migrations alongside the existing libSQL schema.

Commands

Command Description
pnpm dev Start the development server
pnpm build Production build
pnpm typecheck Run TypeScript type checking
pnpm lint Run ESLint
pnpm lint:fix Run ESLint with auto-fix
pnpm test:unit Run unit tests (Vitest)
pnpm test:e2e Run end-to-end tests (Playwright)
pnpm db:generate Generate Drizzle migrations
pnpm db:migrate Apply database migrations
pnpm db:seed Seed the database with sample instructions

Stack

Project structure

app/
  components/      # Vue components (playback, editor, pre-check)
  composables/     # Vue composables (editor state, instructions, playback)
  lib/             # Pure logic (schema, YAML, playback engine, timer, storage)
  pages/           # File-based routes
  assets/css/      # Tailwind entrypoint
server/
  api/             # Nitro server routes
  db/              # Drizzle schema, migrations, repository
docs/
  adr/             # Architecture Decision Records
  glossary.md      # Domain terminology
tests/
  unit/            # Vitest unit tests
e2e/               # Playwright end-to-end tests

Architecture

Design decisions are documented as Architecture Decision Records in docs/adr/. The domain vocabulary is defined in docs/glossary.md.

Key decisions:

  • Instructions are validated YAML documents (ADR-0001, ADR-0002).
  • Storage uses Drizzle ORM with libSQL/SQLite (ADR-0012).
  • Playback state persists to localStorage only (ADR-0006).
  • Media metadata is stored in Drizzle and private media objects use configured S3-compatible storage (ADR-0011, ADR-0012).

License

AGPL-3.0-or-later

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages