How devmdfaiz/cloud-clove works
Main Components
• Frontend Interface:
– Represent the “src/app” folder as the primary UI layer.
– Highlight different groups: the (auth) group for sign-in/sign-up flows and the (dashboard) group for logged-in user interactions.
– Include key elements like pages (page.tsx files), layout components (layout.tsx), and shared components such as sidebars, headers, and file cards.
• API Layer:
– Identify “src/app/api” which contains endpoints for authentication (e.g. “api/auth”) and versioned endpoints under “api/v1”.
– Show these API routes as services that handle data requests and business logic.
• Business Logic & Actions:
– Include the “src/action” directory that defines actions like auth.action.ts, file.action.ts, paddle.action.ts, and subscription.action.ts.
– Represent these as the bridge between the user interactions and backend processing.
• UI Components & Presentation:
– Indicate that these components are reused across various pages and layouts.
• State Management & Hooks:
– For application state and interactions, include modules from “src/context” and “src/hooks” (for mobile detection, paddle integration, toast messages, etc.).
• Authentication and External Services:
– Also include “src/lib/paddle”, “src/lib/pinata”, and any other integration libraries for third-party services.
• Database Layer:
– Showcase “src/lib/database” with its schema definitions (e.g., file.model.ts and subscription.model.ts) as the core of persistent storage.
Relationships and Data Flows
• That these actions call API routes under “src/app/api” to perform operations like authentication, file handling, or subscription management.
• That API endpoints interact with internal services – notably authentication via “src/lib/better-auth” and data persistence via the “database” layer.
• How UI components (from the components folder) are assembled into page layouts and how they render data fetched from API endpoints.
• Integration flows where external services come into play (for example, Paddle for payment/subscription processing and Pinata for storage or related tasks).
Architectural Patterns / Key Design Concepts
• Next.js App Router Pattern: Demonstrate the separation of concerns within the “app” directory using nested layouts and grouped routes (e.g., (auth) and (dashboard)).
• API Route Convention: Emphasize how dynamic API routes (using [...all] and [[...route]] patterns) allow for versioning and extensibility.
• Component Driven UI: Use the “components/ui” folder to showcase how presentation logic is modularized, reusable, and styled consistently.
• Business Logic Separation: Indicate that the “action” modules and “lib” functions keep the business logic decoupled from the view logic.