# Nanodrop Simple file-sharing platform. TypeScript + Fastify + SQLite. ## Commands - `npm test` — Run all tests (vitest) - `npm run dev` — Start dev server (tsx) - `npm run build` — Compile TypeScript - `npm run register-user -- --username --password ` — Create user ## Architecture - ESM throughout (`"type": "module"`) - Fastify with server-rendered HTML pages - SQLite via better-sqlite3 for persistence - JWT in httpOnly cookies for auth - PRG pattern for HTML forms (no client-side JS except copy-to-clipboard) - Dependency injection — DB/service functions take deps as params for testability ## Code Quality - Review code after every change. Refactor for readability. - Use TDD: write tests first, then implement. - Build and test after every change. - Break large functions into smaller ones, extract duplicate code. - Search for duplicated code in tests and extract into reusable helpers. - Commit after every logical set of changes. Keep commits small and focused.