-
Notifications
You must be signed in to change notification settings - Fork 0
overview getting started
Sergey Bogorad edited this page Jul 29, 2026
·
3 revisions
- Node.js 22
- pnpm 10.22.0 (the canonical package manager; do not use npm or yarn)
- Docker and Docker Compose (for PostgreSQL)
- Git
pnpm installCopy the example environment file:
cp .env.example .envEdit .env with your local values. The minimum required variables:
DATABASE_URL="postgresql://admin:adminpassword@localhost:5432/cognitika?schema=public"
JWT_SECRET="your-random-secret-here"
PORT=3006
APP_URL="http://localhost:3006"
FRONTEND_URL="http://localhost:3006"
CORS_ORIGIN="http://localhost:3006"
CORS_ALLOW_DEV_WILDCARD="false"
docker compose up -d dbThis starts a PostgreSQL 15 container on port 5432 with user admin, password adminpassword, and database cognitika.
pnpm prisma generate
pnpm prisma db pushpnpm devThe server starts at http://localhost:3006 with Vite dev middleware and hot module reloading.
pnpm test # Vitest unit tests
pnpm test:e2e # Playwright E2E testspnpm lint
pnpm test
pnpm buildpnpm buildThis generates Prisma client and builds the frontend into the dist/ directory.
docker compose up --buildThis builds the app container and starts both the app (port 3006) and PostgreSQL (port 5432).
src/
client/ # GraphQL fragments and client types
components/ # React UI components
core/ # EventBus, engine hooks, generators
events/ # EventBus, schemas, event types
trainers/ # Trainer-specific logic
analyze-session/ # Session analytics pipeline
hooks/ # React hooks (use{Module}Engine patterns)
lib/ # Utility libraries (prisma, auth, knowledge-base, etc.)
server/ # Express server
config/ # CORS, server config
middleware/ # Auth, privacy middleware
realtime/ # Socket.io duel handlers
routes/ # API route handlers
services/ # Business logic services
schemas/ # Zod validation schemas
tests/ # Vitest test files (*.test.ts and *.test.tsx)
workers/ # Analytics web worker
tests/ # Playwright E2E tests
prisma/
schema.prisma # Database schema
migrations/ # Prisma migrations
| Script | Purpose |
|---|---|
pnpm dev |
Start development server with Vite HMR |
pnpm build |
Generate Prisma client and build frontend |
pnpm start |
Start production server |
pnpm test |
Run Vitest test suite |
pnpm test:e2e |
Run Playwright E2E tests |
pnpm test:e2e:attached |
Run Playwright against a running server |
pnpm lint |
TypeScript type check |
pnpm validate |
Run core validation (Vitest) |
pnpm clean |
Remove dist/ directory |
pnpm check:bundle |
Check bundle size budget |