How haydenbleasel/next-forge works
High-Level Architecture Components
The system should be represented as a monorepo structure with the following main components:
a. Apps Layer (Top Level):
• Web Application (apps/web)
• Admin Dashboard (apps/app)
• API Service (apps/api)
• Documentation Site (apps/docs)
• Email Service (apps/email)
• Storybook (apps/storybook)
• Studio (apps/studio)
b. Packages Layer (Shared Libraries):
• Authentication (@packages/auth)
• Database (@packages/database)
• Design System (@packages/design-system)
• Analytics (@packages/analytics)
• AI Integration (@packages/ai)
• Security (@packages/security)
• SEO (@packages/seo)
• Feature Flags (@packages/feature-flags)
• Payments (@packages/payments)
• Storage (@packages/storage)
Relationships and Interactions
• External service integrations:
• Authentication (Clerk)
• Database (Prisma)
• Analytics (PostHog)
• Payments (Stripe)
• Email (Resend)
• Storage solutions
• Collaboration features (Liveblocks)
Key Architectural Patterns to Highlight
• Monorepo Structure (Turborepo)
• Microservices Architecture
• Shared Component Library
• Authentication Flow
• API Layer
• Database Access Pattern
Implementation Details
a. Frontend Layer:
• Next.js Applications
• React Components
• Design System
• Client-side Features
b. Backend Layer:
• API Routes
• Database Connections
• Authentication
• Webhooks
c. Infrastructure Layer:
• Deployment Configuration
• Security Middleware
• Monitoring & Analytics
• Feature Flags
Additional Elements
Include:
• Version information
• External service dependencies
• Security boundaries
• Data flow directions
Notes for Implementation
• Maintain consistent spacing and alignment
• A clear hierarchy of components
• Annotations for important architectural decisions
• Document integration points with external services
Remember to include deployment considerations and how the system scales across different environments (development, staging, production).
This architecture should be represented in a way that clearly shows the benefits of the monorepo structure while highlighting the independence and reusability of each component.