YAS/NEXTSTEP.md
YetAnotherSuite Dev 93489d5c2b docs: add BUILDANDRUN.md and NEXTSTEP.md developer guides
BUILDANDRUN.md — developer onboarding guide covering prerequisites,
quick start, CLI commands, scoped package execution, service URLs,
Docker production build, Tauri desktop build, and verification steps.

NEXTSTEP.md — comprehensive assessment of project state across all
6 phases, identifying what is solid vs placeholder, with prioritized
next steps: write tests, wire frontend to API, Prisma migrations,
finish calendar views, wire sync engine, code splitting, i18n.
2026-07-20 22:33:54 +02:00

144 lines
4.9 KiB
Markdown

# Next Steps — YetAnotherSuite
This is a greenfield monorepo (no code existed before this session). All 6 phases from the implementation plan have been scaffolded. Below is an honest assessment of what works, what is placeholder, and what to tackle next.
---
## Current state
### What's solid
| Layer | Status |
|-------|--------|
| Monorepo (Turborepo + pnpm workspaces) | Builds, typechecks, lints clean |
| Prisma schema (12 models, pgvector, indexes) | Generated, matches plan |
| Fastify API (auth, nodes, workspaces, search, AI, webhooks, analytics) | Typechecks, routes registered |
| Shared packages (types, utils, hooks, UI components) | Importable, type-safe |
| TipTap editor (toolbar, slash menu, 9 block types) | Functional |
| Task store + list (views, priorities, DnD reorder) | Working |
| Calendar month view | Renders events |
| AI routes (6 actions, NL parsing) | API ready |
| Collaboration WebSocket server | Registered |
| Docker Compose (Postgres, Redis, Meilisearch) | Configured |
| Tauri desktop skeleton | Scaffolded |
### What's placeholder / incomplete
| Item | What's missing |
|------|----------------|
| **Tests** | No test files exist. Vitest + RTL + Playwright are configured but unused. |
| **Frontend ↔ API binding** | Zustand stores use local state. API routes exist but frontend doesn't call them (except search/AI). |
| **Calendar day/week views** | Only month view renders. Day/Week views show a placeholder. |
| **Knowledge graph** | D3.js container is empty. No graph data fetching or rendering. |
| **Sync engine** | Yjs + WebSocket server exists. No client-side CRDT sync wired into notes/tasks. |
| **i18n** | No i18n keys or translation files. All strings are hardcoded in English. |
| **OAuth** | JWT auth works. No Google/GitHub/Microsoft OAuth flows. |
| **Prisma migrations** | Schema exists. No migration files — uses `db push` for now. |
| **Mobile app** | React Native / Expo not started. |
| **Editor persistence** | Note editor doesn't auto-save to API. Uses localStorage only. |
| **Code splitting** | Single 1MB JS chunk. Needs lazy loading by route. |
---
## Priority next steps
### 1. Write tests (highest ROI)
Configure and write tests for the most critical paths before anything else breaks.
```sh
# Run existing (empty) test suite:
pnpm test
```
**Critical paths to cover:**
- `packages/types` — Zod schema validation
- `packages/ui` — Button, Dialog render + interaction
- `apps/web` — NoteList filtering, TaskList view switching
- `apps/api` — Auth register/login, node CRUD, search
**Setup:**
- `apps/web/vitest.config.ts` exists but needs test files in `__tests__/`
- `apps/api` needs a vitest config and a test database
- MSW should be used to mock the API for frontend tests
### 2. Wire frontend to real API
Currently all data lives in Zustand + localStorage. The API is fully built but unused by the UI.
**Pattern (for each store):**
```
- On app load: fetch from API → hydrate Zustand
- On mutation: optimistically update Zustand → POST/PATCH to API → rollback on error
```
**Store to API mapping:**
- `useNotesStore``api.nodes.list`, `api.nodes.create`, etc.
- `useTasksStore` ↔ same (nodes are polymorphic)
- `useCalendarStore``api.nodes` with `type=event`
### 3. Prisma migrations
Replace `db push` with proper migrations for production safety:
```sh
pnpm --filter @yetanother/db exec prisma migrate dev --name init
```
### 4. Finish calendar views
- `apps/web/src/calendar/WeekView.tsx` — horizontal time grid
- `apps/web/src/calendar/DayView.tsx` — vertical hour slots
- Drag tasks onto calendar (DnD Kit from tasks already a dependency)
- Event creation dialog
### 5. Wire up sync engine
- `apps/web/src/lib/collaboration.ts` has a WebSocket client but nothing calls it
- Connect it to the TipTab editor (y-prosemirror)
- Add presence cursors UI
- Add offline IndexedDB persistence (y-indexeddb already installed)
### 6. Complete remaining Phase 4 AI features
- Wire `AIAssistant.tsx` into the editor toolbar
- Wire `SearchBar.tsx` into the sidebar
- Wire `KnowledgeGraph.tsx` to D3.js force simulation with real data
### 7. Add i18n
Install `react-i18next` or `lingui` and extract all hardcoded strings.
### 8. Code splitting
In `App.tsx`, lazily load Notes, Tasks, and Calendar pages:
```tsx
const NotesPage = lazy(() => import('./notes/NotesPage'));
```
---
## Stretch goals
| Goal | When |
|------|------|
| Storybook design system | After UI package is stable |
| OAuth providers (Google, GitHub, Microsoft) | After auth is tested |
| React Native Expo app | After web is complete |
| Performance profiling (Lighthouse, bundle analysis) | After code splitting |
| E2E tests (Playwright) | After all critical flows work |
| CI pipeline on GitHub Actions | Test the existing workflow |
---
## Verification checklist
Before any PR, run:
```sh
pnpm lint && pnpm typecheck && pnpm build
```
These three commands must pass. No warnings allowed. This is enforced by the CI workflow at `.github/workflows/ci.yml`.