How alaric-senpai/strategem works
Main Components
• Next.js Application Layer: Highlight that the project uses the Next.js “app” directory to manage pages and layouts. Create separate blocks for:
• Public Pages (e.g., app/(root)/page.tsx)
• Auth Flow (e.g., sign-in and sign-up pages)
• Client Interfaces (app/client with its nested pages like account, activity, chats, projects, etc.)
• Admin Interfaces (app/admin with its own pages for analytics, projects, settings, teams, users)
• API Endpoints: Include a block for the API routes (the app/api folder) that handle chat, projects, and potentially other server-side logic. Indicate how these API endpoints interface with the main application.
• Components Library: Represent the components directory and sub-folders (including UI components) as a reusable library your pages rely on. This includes things such as navigation bars, sidebars, forms, and project-specific components.
• Business Logic & Utilities: Include blocks for the lib, hooks, utils, and types directories. These contain shared business logic, types/interfaces, utility functions, and custom hooks (e.g., use-mobile.ts) that are used across the project.
• External Dependencies: Note integration points leveraging Next.js features (like next/font) and Vercel’s deployment platform. You may also want to mention external CSS, such as the globals.css file.
Establish Relationships and Interactions
• Routing & Layouts: Indicate that a central layout file and specialized layouts (e.g., app/layout.tsx, app/admin/layout.tsx, app/client/layout.tsx) orchestrate the rendering and navigation across different user experiences.
Architectural Patterns and Design Principles
• Component-based Architecture: Emphasize the separation of concerns by splitting the UI into multiple reusable components.
• Server-Side Rendering and API Integration: Note the use of Next.js’s server utilities (server components, API routes) which combine both client-side functionality and backend logic.
• Modularization: Illustrate that application code is organized modularly with distinct directories for different aspects of functionality (e.g., client vs. admin routes, shared libraries).
• Separation of Concerns: Clearly demarcate frontend presentation, API endpoints, business logic in libraries, and utility functions.
Final Advice
• Annotations explaining the interactions (e.g., “Layout management in app/layout.tsx orchestrates global styling and navigation”, “API endpoints are defined under app/api to handle chat and project requests”).