Skip to content

Latest commit

 

History

History
65 lines (57 loc) · 2.42 KB

File metadata and controls

65 lines (57 loc) · 2.42 KB

taiki — Agent Guide

Quick start

pnpm install        # install + runs postinstall → nuxt prepare
pnpm dev            # nuxt dev server
pnpm fmt            # oxfmt (NOT eslint/prettier)
pnpm build          # generate-icons → nuxt generate
pnpm generate       # nuxt generate (static export)
pnpm preview        # nuxt preview
pnpm generate-icons # sharp: logo.svg → public/pwa-*.png

Key facts

  • Nuxt 4 SPA (ssr: false) — pure client-side, no API backend
  • PWA (@vite-pwa/nuxt) — auto-update, install prompt
  • Data: IndexedDB via app/utils/db.ts (manual IndexedDB, no ORM). Migrates from legacy localStorage on first load.
  • UI: Varlet UI v3 (Material Design 3 dark theme) + Tailwind CSS v4
  • i18n: @nuxtjs/i18n, locale zh only, no_prefix strategy
  • Formatter: oxfmt (config: singleQuote, bracketSameLine)
  • Package manager: pnpm (workspace used for allowBuilds only, not multi-package)
  • Typechecking: no script — relies on IDE / Nuxt's built-in typegen
  • No tests found in the repo
  • postinstall runs nuxt prepare.nuxt/ must exist for type hints
  • PWA icons generated from public/logo.svg via scripts/generate-icons.mjs (ESM, requires sharp)
  • .nuxt/, .output/, dist/ are gitignored

Architecture

app/
  app.vue           — root layout (Varlet AppBar + NuxtPage)
  pages/
    index.vue       — event list + add dialog
    events/[id].vue — event detail/edit
  components/
    EventCard.vue
    EventForm.vue
  composables/
    useEvents.ts    — CRUD over IndexedDB
  utils/
    db.ts           — IndexedDB helpers (DB_NAME: taiki-countdown, v2)
    types.ts        — DayEvent, DayEventInput, RepeatMode
    testData.ts     — sample data for development
  plugins/
    varlet.ts       — MD3 dark theme (client-only)
  assets/css/
    main.css        — Tailwind + scrollbar styles
    font.css        — Noto Sans SC, Material Symbols
scripts/
  generate-icons.mjs
i18n/locales/
  zh.json

Conventions

  • import.meta.client / import.meta.server guards are required for IndexedDB and client-only plugin code
  • useEvents() composable auto-initializes on client mount; import it in any component
  • Event id is Date.now().toString(36) — generated client-side
  • Repeat is 'none' | 'yearly'
  • Date format: YYYY-MM-DD (strings)
  • Varlet components are auto-imported by @varlet/nuxt module; no manual import needed in templates