How khanhthanhdev/nex-crawl works
Main Components
a. Frontend Layer:
• Client-side Components (app/ directory structure)
• Authentication Views (/app/(auth))
• Dashboard Views (/app/(dashboard))
• Workflow Editor (/app/workflow)
• UI Components Library (/components/ui)
b. Backend Layer:
• API Routes (/app/api)
• Action Handlers (/actions)
• Workflow Execution Engine (/lib/workflow)
• Database Layer (Prisma)
c. Core Features:
• Authentication System
• Workflow Management
• Billing/Credits System
• Analytics
• Credential Management
┌─ Client Layer ─────────────────────────┐
• Next.js Pages & Components │
• React Components │
• UI Framework │
• ┬────────────────────┘
• ↓
┌─ Server Layer ──────────────────────────┐
• Next.js API Routes │
• Server Actions │
• Workflow Executor │
• ┬────────────────────┘
• ↓
┌─ Database Layer ────────────────────────┐
• Prisma ORM │
• SQLite Database │
• ┘
Key Relationships to Highlight
a. Workflow System:
• Flow from task definition to execution
• Various executor types (browser automation, AI extraction, etc.)
b. Authentication Flow:
• Auth routes integration
• Protected routes and middleware checks
c. Data Flow:
• How actions connect UI to database operations
• Analytics data collection and presentation path
Component Relationships
• Data flow direction
• Dependencies between components
• API calls and responses
• Database queries and mutations
Technical Stack Labels
• Next.js 13+ (App Router)
• React
• Prisma ORM
• SQLite
• TypeScript
• Tailwind CSS
Additional Elements
• Version information
• External service integrations
• Scaling points
Remember to include:
• Error handling flows
• Security boundaries
• Data persistence paths
• Task execution pipeline
• Credit/billing system integration
This will provide a complete picture of the system while keeping it understandable and maintainable.