AI-powered, interview-driven BRD/PRD generator. Client-only, 100% TypeScript/HTML5/SCSS.
- TypeScript (strict, ES2022 target)
- Vite (multi-entry build + async chunking for heavy exports)
- Puter.js (
openai/gpt-oss-120b:free) for AI - i18next (EN/TR/AR with RTL)
- marked + DOMPurify for safe Markdown rendering
- jspdf + docx for exports
- @fontsource/cairo (npm package)
- Fully responsive, mobile-first UI with thumb-friendly layouts
- No JavaScript or CSS frameworks
yarn install
yarn dev # local dev server
yarn typecheck # tsc --noEmit
yarn lint # eslint
yarn build # tsc check + asset hashing + vite build
yarn preview # serve dist/
yarn deploy # build + push to gh-pages branchLayered, signal-based reactive state, History API routing 8000 with GitHub Pages SPA shim.
src/
├── main.ts Bootstrap: i18n → store → router → host
├── types.ts Shared types
├── core/ signal, store, selectors, eventBus, result
├── services/
│ ├── ai/ Puter wrapper, prompt builders
│ ├── interview/ Question banks + engine
│ ├── markdown/ render, sections, html↔md round-trip
│ ├── storage/ localStorage (session) + IndexedDB (library)
│ └── export/ md, html, pdf, docx, clipboard, print, filename
├── router/ History API + sessionStorage SPA-shim restore
├── i18n/ i18next + en/tr/ar JSON locales
└── ui/
├── layout/ header + footer + lang switch
├── components/ toast, modal, banner, progress, inputs, focusTrap
└── views/ welcome, interview, generating, result, library
/Welcome/interviewActive interview/generatingAI streaming/resultGenerated document (edit/refine/export)/libraryUp to 100 saved documents (search/open/resume/rename/delete/export)
core/signal.ts implements minimal signal(), computed(), effect() primitives (SolidJS-style). core/store.ts exposes typed signals for step, docType, history, currentQuestion, document, isBusy, error, lang, etc. Views subscribe to only the signals they read.
- localStorage (
@/services/storage/session.ts): in-flight interview, draft, settings (lang, showStepDots). - IndexedDB (
@/services/storage/library.ts): up to 100 saved documents with full interview history; FIFO eviction on overflow.
- Production CSP forbids
'unsafe-inline'for scripts. Inline styles allowed (Vite-injected, scoped). - DOMPurify hardened: no
style, noclassoutside an allow-list; links forced torel="noopener noreferrer nofollow" target="_blank". - Every Puter.js call gated by an
AbortControllerthat is cancelled on route change.
- Semantic landmarks (
header,main,nav,footer). - Focus trap in modals (
@/ui/components/focusTrap.ts). aria-liveregions for toasts and streaming status.- All interactive elements keyboard-reachable; visible focus rings via
:focus-visible. - Color contrast on dark theme passes AA for body text and primary buttons.
en,tr,arJSON dictionaries lazily loaded byi18next-http-backend.- Active language drives
<html dir>and<html lang>. - AI prompts and AI output respect the active locale; filenames preserve Unicode (sanitized for the filesystem).
- RTL handled by
styles/utilities/_v-rtl.scsswith[dir="rtl"]overrides.
vite.config.ts sets base: "/architectly/" in production. public/404.html is the SPA shim that preserves deep links across the GH Pages 404 fallback by stashing the original path in sessionStorage; the router restores it on boot.
404.html is built as a secondary Vite entry point alongside index.html. It acts as the SPA shim that preserves deep links across the GH Pages 404 fallback by stashing the original path in sessionStorage; the router restores it on boot.
Static assets (like the logo) are served from public/ and automatically appended with a SHA-1 hash query parameter (?v=%VITE_ASSET_HASH%) via a pre-build Node script (scripts/asset-hash-refresh.mjs) to ensure aggressive cache busting on GH Pages.
MIT © 2026 Ahmet Fatihoğlu