Phase 1.1: Monorepo Setup & Design System - Turborepo + pnpm workspaces monorepo structure - Shared packages: @yetanother/types, @yetanother/utils, @yetanother/hooks, @yetanother/ui, @yetanother/db - Radix UI primitives with custom shadcn/ui-style components (Button, Dialog, Toast, Tooltip, Tabs, Label) - Tailwind CSS v4 with design tokens (light theme) - TypeScript strict mode with composite project references Phase 1.2: Authentication & User Management - Fastify server setup with JWT auth (register, login, me endpoints) - @fastify/jwt with cookie support - User and workspace models with Prisma ORM Phase 1.3: Database Schema & Migrations - Full Prisma schema: User, Workspace, Node, NodeLink, Tag, Folder, Reminder, Embedding, Activity, Attachment, WorkspaceMember, SyncCheckpoint - pgvector extension for embeddings (vector(1536)) - Seed script for dev data - Comprehensive indexes (GIN, BRIN, B-tree) Phase 1.4: API Foundation & Middleware - Fastify REST API with versioned routes (/api/v1) - Zod request validation on all endpoints - CORS, Helmet security headers, rate limiting - Structured logging with pino-pretty - Swagger/OpenAPI docs at /docs - WebSocket support (collaboration ready) - CRUD routes: nodes, workspaces, search, auth Tooling: - ESLint 9 flat config with TypeScript parser - Prettier with consistent formatting rules - Turbo v2 task orchestration - GitHub Actions CI workflow - Husky + lint-staged pre-commit hooks
51 lines
2.7 KiB
Markdown
51 lines
2.7 KiB
Markdown
# AGENTS.md — YetAnotherSuite
|
|
|
|
## Project state
|
|
|
|
This is a **greenfield project** — no code exists yet. The implementation plan (`yetanothersuite_implementation_plan.md` / `.json`) defines everything: architecture, data model, tech stack, phases, conventions, and API design. Read it first before writing any code.
|
|
|
|
## Tech stack (from the plan)
|
|
|
|
- **Monorepo**: Turborepo + pnpm workspaces
|
|
- **Frontend**: React 18+ / TypeScript strict mode, Vite, Tailwind CSS + shadcn/ui + Radix primitives
|
|
- **State**: Zustand (global), TanStack Query (server state), Jotai (local UI)
|
|
- **Editor**: TipTap / ProseMirror (block-based)
|
|
- **Backend**: Node.js + Fastify, PostgreSQL 15+ (Prisma ORM), Redis, Zod validation
|
|
- **Realtime**: Yjs (CRDT) + WebSocket (Redis adapter)
|
|
- **Search**: Meilisearch (full-text) + pgvector (semantic)
|
|
- **Queue**: BullMQ (Redis-backed)
|
|
- **Desktop**: Tauri; **Mobile**: React Native (Expo)
|
|
- **Testing**: Vitest + React Testing Library + Playwright + MSW
|
|
|
|
## Key conventions (from the plan)
|
|
|
|
- **TypeScript strict mode** — no `any` types except in test mocks
|
|
- **Functional components with hooks** — no class components
|
|
- **Zod** for all runtime validation — never trust client input
|
|
- **Optimistic UI updates** — rollback on error with toast notification
|
|
- **Loading + error states** on every async operation — no silent failures
|
|
- **i18n from day one** — i18n keys for all user-facing strings
|
|
- **Accessible components** — ARIA labels, keyboard navigation, focus management
|
|
- **Conventional commits**: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`
|
|
- **Branch naming**: `feature/xxx`, `fix/xxx`, `refactor/xxx`, `docs/xxx`
|
|
|
|
## Development workflow
|
|
|
|
1. **Phase-by-phase execution** — complete each phase fully before moving to the next
|
|
2. **TDD** — write tests before implementation, maintain >80% coverage on critical paths
|
|
3. **Pre-commit hooks** (Husky): lint → type-check → test affected
|
|
4. **Lint**: ESLint + Prettier (strict config, no warnings allowed)
|
|
5. **Every merged PR must be deployable** — use feature flags for incomplete work
|
|
6. **Profile after every major feature** — no performance regressions
|
|
|
|
## Phases (from the plan)
|
|
|
|
| Phase | Timeline | What |
|
|
|-------|----------|------|
|
|
| 1 | Weeks 1-4 | Foundation: monorepo, auth, DB schema, API, offline sync |
|
|
| 2 | Weeks 5-8 | Notes MVP: block editor, CRUD, search, bidirectional linking |
|
|
| 3 | Weeks 9-14 | Tasks + Calendar: task management, calendar engine, NL input, reminders |
|
|
| 4 | Weeks 15-18 | AI: semantic search, writing assistant, knowledge graph, smart scheduling |
|
|
| 5 | Weeks 19-22 | Collaboration: real-time editing, workspaces, sharing, templates |
|
|
| 6 | Weeks 23-28 | Platform: public API, plugins, desktop/mobile apps, SSO, self-hosting |
|