How mrhacker8468/eontrack works
Main Components
• Web Client/UI Layer: This covers the pages and components served to users such as the dynamic booking pages, the dashboard, onboarding, and success pages. The “app” directory and subdirectories like “app/(bookingpage)”, “app/dashboard”, and “app/onboarding” host the various pages.
• UI Component Library: Note the separate “components” directory (and its subdirectory “components/ui”) which contains reusable UI primitives (Buttons, Cards, Dialogs, etc.). These components support consistent styling and behavior across the application.
• API Routes & Server Functions: The “app/api” directory hosts API endpoints for authentication (using NextAuth in the “auth” folders), OAuth exchange (/api/oauth/exchange), and upload functionality (/api/uploadthing). These endpoints outline the backend services that the front-end will interact with.
• Business Logic & Utility Libraries: The “app/lib” directory includes modules for authentication, database interactions, hooks, integrations with external services (like Nylas), time utilities, and upload handling that abstract away core functionality.
• Database Layer: Although not explicitly shown within the file tree as separate services, the presence of a “prisma” folder with a “schema.prisma” file indicates that the application uses Prisma as an ORM to interact with its database. Show the database as an external component connected to the backend parts.
• Authentication & OAuth: The integration of NextAuth and custom OAuth endpoints (including exchange routes) play a vital role in user authentication and authorization in the application.
• End User (Browser) communicates with the Web Client, which renders dynamic pages (booking pages, dashboard, settings, etc.) driven by Next.js.
• The Web Client interacts with API Routes (via HTTP calls) for authentication, file uploads, and OAuth token exchanges.
• Business logic and utilities (lib modules) support both API endpoints and UI pages.
• The Next.js server infrastructure is also responsible for server-side rendering (where applicable) and routing the requests to the corresponding API handlers.
• A persistent connection to an external Database (managed by Prisma) should be shown, connecting from services in the “app/lib/db.ts” and indirectly referenced by the API endpoints.
• The UI component library is used by various pages to ensure consistent design.
Architectural Patterns & Design Principles
• Next.js App Directory Pattern: Highlight the App Directory pattern that organizes both UI logic and API endpoints in a single project.
• Separation of Concerns: Clearly separate presentation (pages and UI components), business logic/utilities (lib), and data access (Prisma, DB connections).
• Dynamic Routing: Note the use of dynamic routing (e.g., [username], [eventUrl], etc.) for user-specific booking pages and dashboard functionality.
• Modularization: The project is split into modules (booking, dashboard, onboarding) which are well encapsulated and interrelated, fostering maintainability.
Relevant Technologies & Frameworks
• Next.js: The main framework driving both UI rendering and server-side code including API routes.
• NextAuth: For handling authentication flows, seen in the “auth” folders.
• Prisma: For managing the database schema and interactions.
• Tailwind CSS: Implied by the presence of tailwind.config.ts (used for styling).
• Vercel Deployment: Reflected by deployment guidelines in the README.
• Additional Libraries: Specific libraries like “uploadthing” for file uploads, and integration with external APIs/services (e.g., Nylas).