- Node.js 20+ (22 recommended)
- pnpm 9+
- PostgreSQL 16
- Redis 7 (optional — needed for real-time features)
git clone https://github.com/Maneek21/Deft.git
cd deft
pnpm install
cp .env.example .env
# Edit .env with your database credentials
# Create database and push schema (+ full-text-search extras)
createdb deft
pnpm db:push-full
# Seed demo data (6 Testers Tomatoes users + demo org + sample messages/tasks).
# This wipes the DB — dev only, NEVER run in production.
pnpm db:seed:demo
# Or, for a prod-safe seed (Defty + bundled skills/templates only):
# pnpm db:seed
# Start development servers
pnpm devThe web app runs at http://localhost:3000, API at http://localhost:3001.
| Password | Role | |
|---|---|---|
| diego@testers-tomatoes.com | tomato123 | Owner |
| marigold@testers-tomatoes.com | tomato123 | Admin |
| cesar@testers-tomatoes.com | tomato123 | Member |
| lina@testers-tomatoes.com | tomato123 | Member |
| sage@testers-tomatoes.com | tomato123 | Member |
| tomas@testers-tomatoes.com | tomato123 | Member |
deft/
├── apps/web/src/
│ ├── app/(app)/ # Authenticated pages (dashboard, chat, tasks, agent, settings)
│ ├── app/login/ # Auth pages
│ ├── components/ # Shared React components
│ └── lib/ # Client utilities (api, auth, socket, context)
├── apps/api/src/
│ ├── routes/ # Hono API route handlers
│ ├── lib/ # Server utilities (db, env, agent tools)
│ ├── middleware/ # Auth middleware
│ └── socket.ts # Socket.io setup
├── packages/db/
│ ├── src/schema.ts # Drizzle ORM schema (all 30 tables)
│ ├── seed.ts # Database seed script
│ └── drizzle.config.ts # Migration config
└── packages/shared/ # Shared types and constants
- TypeScript strict mode everywhere — no
anyunless absolutely necessary - Zod for all request validation on API routes
- Drizzle ORM — no raw SQL except in agent queries
- Functional React — no class components, prefer server components where possible
- Tailwind CSS — no CSS modules, no styled-components
- File naming: kebab-case for files, PascalCase for components
- Create or edit a route file in
apps/api/src/routes/ - Use Hono:
export const myRoutes = new Hono(); - Add Zod validation for request body
- Use
c.get('user')for authenticated user context - Always filter by
org_idfor multi-tenant isolation - Return errors as
{ error: string, code: string } - Register in
apps/api/src/index.ts
- Define the tool schema in
apps/api/src/lib/agent-tools.ts - Implement the handler in
apps/api/src/lib/agent-context.ts(read-only) oragent-actions.ts(write) - Write actions must go through approval flow
- Branch names:
feat/short-description,fix/short-description,chore/short-description - Commit messages: conventional commits (
feat:,fix:,chore:,docs:) - PRs: describe changes, link related issue, include screenshots for UI changes
- All PRs must pass TypeScript type-check
Key rules:
- No borders for layout — use tonal layering
- Inter for text, JetBrains Mono for technical data
- All colors via CSS variables in
apps/web/src/app/globals.css - Brand assets live in
apps/web/public/brand/; use the<Logo />component (apps/web/src/components/brand/logo.tsx) rather than inlining SVGs.