# Craft - Rapid Web

🚀 **Niveau RAPID** - Ship Fast, Web Only (Community Tier - FREE)

## Configuration

- **Tier**: Community (Free)
- **Niveau**: Rapid (Ship Fast)
- **Platform**: Web Only (Next.js)
- **Équipe**: 1-2 développeurs
- **Durée**: 3-6 mois (test marché)
- **Users**: 0-100 early adopters
- **Revenue**: $0-5K MRR

## AI Tooling Included (Community Tier)

### 2 AI Agents
- 🤖 **Developer** - Implements features following quality rules
- 🧪 **Tester** - Writes tests for auth and payment flows

### 4 Basic MCP Servers
- `craft-cli` - Craft CLI tools integration
- `typescript` - TypeScript development support
- `filesystem` - File operations (provided by Claude Code)
- `github` - GitHub integration (provided by Claude Code)

**Upgrade to Pro** for 17+ skills, all agents, and 10 MCP servers.

## Architecture

**Flat Structure** - Logique directement dans routers tRPC

```
apps/
└── web/              # Next.js 15 app

packages/
├── api/              # tRPC routers (logique ici, max 100 lignes)
├── database/         # Prisma
├── auth/             # Supabase Auth
├── payments/         # Stripe
├── emails/           # Resend + React Email
└── ui/               # shadcn/ui components
```

## Règles de Code

| Aspect | Règle |
|--------|-------|
| **Max lignes/fonction** | 100 lignes |
| **Parameters** | Flexible |
| **Duplication** | OK si < 3 fois |
| **Cyclomatic complexity** | Pas de limite |
| **Comments** | WHY seulement (NO inline comments) |

## Testing

- ✅ Auth flows (login, register, logout)
- ✅ Payment flows (checkout, webhooks)
- ❌ Business logic unit tests
- ❌ Component tests
- ❌ E2E tests

**Coverage**: Aucun minimum requis

## Quick Start

```bash
# Install dependencies
pnpm install

# Setup environment
cp .env.example .env.local
# Edit .env.local with your keys

# Generate Prisma client
pnpm --filter @craft/database db:generate

# Start dev server
pnpm --filter @craft/web dev
```

## Features Included

- ✅ Authentication (Supabase)
- ✅ Payments (Stripe)
- ✅ Emails (Resend)
- ✅ Database (Prisma + PostgreSQL)
- ✅ UI Components (shadcn/ui)
- ✅ Type-safe API (tRPC)

## Stack

- **Frontend**: Next.js 15 (App Router), React 19, TypeScript, Tailwind
- **Backend**: tRPC 11, Zod validation
- **Database**: Prisma + PostgreSQL (Supabase)
- **Auth**: Supabase Auth
- **Payments**: Stripe
- **Emails**: Resend + React Email

## Philosophie

> "Code qui fonctionne > Code parfait. Ship, learn, iterate."

## Principes Craft Actifs (6/16)

- ✅ Type Safety (TypeScript strict + Zod)
- ✅ Linting (ESLint basic)
- ✅ Git Hooks (pre-commit minimal)
- ✅ Error Handling (basic try-catch)
- ✅ Security (input validation + auth)
- ✅ Self-Documenting Code (pas de comments inline)

## When to Upgrade?

### Upgrade to Pro Tier ($199 one-time)
- Access all 6 templates (Rapid, Balanced, Crafted × Web/Web+Mobile)
- 17+ AI Skills (workflows, agents, utils)
- 10 MCP servers (complete development stack)
- Priority support

### Migrate to Balanced Level
- Équipe > 3 développeurs
- Users > 100
- MRR > $5K
- Besoin de meilleure maintenabilité
- Refactoring devient difficile

## Documentation

- `CLAUDE.md` - Rules pour Claude Code
- `.cursorrules` - Rules pour Cursor
- `.clinerules` - Rules pour Cline
- `.windsurfrules` - Rules pour Windsurf
