How ilyaizen/streak-calendar works
Main Components
• Frontend (Next.js App):
• "src/app" directory that contains the localized pages (e.g. routes for about, calendar, calendars, habits, and pricing), layouts, global styles, and providers.
• "src/components" layer which holds atomic UI components (buttons, forms, calendars, habit details, dialogs) as well as analytics and internationalization wrappers.
• Use of custom hooks ("src/hooks") and internationalization resources ("src/i18n" and "src/messages") for dynamic UI behavior and localization support.
• Backend (Convex):
• "convex/" directory which encapsulates backend logic and data schema including routes for authentication, calendar sync, habit management, migrations, and other business logic.
• Both the generated API types (in convex/_generated) and the Convex functions along with configuration files.
• External Services and Libraries:
• Authentication (Clerk): Illustrate where the authentication mechanism fits within the system.
• Payment and Subscription (Stripe): (Documented in the README as a planned integration for premium services.)
• Other libraries (e.g., Tailwind CSS, shadcn/ui, Framer Motion, Chart.js): Mention these as supporting libraries that enhance the UI and UX.
• Static Assets:
Relationships and Interactions
• Data Flow:
• User interactions in the browser trigger requests handled by Next.js components. These then communicate with Convex backend functions/API to fetch or update calendar and habit data.
• Component Dependencies:
• The frontend integrates with authentication providers (Clerk) and various libraries that handle analytics and animations.
• The static assets in "public/" are consumed by the frontend as part of responsive design.
• Internationalization flow: routes and providers leverage configuration files in "src/i18n" and translation files in "src/messages" ensuring localized rendering.
Architectural Patterns and Design Principles
• Modern Full-Stack Structure: Emphasize the separation of concerns between UI (Next.js/front-end) and business logic/data persistence (Convex/back-end), which also makes the project more maintainable and scalable.
• Modular Design:
• The clear separation of directories such as "src/components", "src/hooks", "src/lib", and "convex/" demonstrates modularity.
• Internationalization & Responsive Design:
• That the app is built with multi-locale support (via dynamic routing in "src/app/[locale]") and adaptive UI components.
• Integration of Third-Party Services:
• External systems like Clerk for auth, foresee Stripe for payment, and mention that services like Canvas Confetti and Chart.js are used to enhance user experience.
Final Elements
• Clear labels and distinct nodes for each primary component.
• Annotations that denote the responsibilities of each module (ex: “Handles user authentication via Clerk”, “Manages habit and calendar data using Convex”, “Renders UI with Next.js and shadcn/ui”).
• An overall architectural layer that succinctly shows the breakdown from user interactions (client-side) to server-side processing (backend) and then to any external systems (payment, analytics).