How yongsoo-cho/lims-demo works
Main Components
• The overall Next.js Application layer (web pages, navigation, layout components like AuthLayout, Navbar, etc.).
• Dedicated pages such as the calendar, login, projects, and supplies pages.
• UI Components: Show a sub-layer for the UI elements (e.g., AuthForm, LabDayCard, Loading, and specialized project and supplies components).
• Authentication & User Context: Mark the AuthContext and hooks (useAuth, useAuthGuard) which handle user state and guarded routes.
• External Services & Backend: Note the integration with Supabase that provides:
• User authentication (via email + Slack OAuth).
• API / database interactions with PostgreSQL.
• File storage for uploads.
• Configuration & Utilities: Include configuration components like the Supabase client, environment variables, and utility functions from the utils directory.
• CSS & Global Styles: Note that TailwindCSS is in play, influencing the UI and theming.
Relationships and Interactions
• UI Flow: Illustrate the separation between various pages (login, dashboard, calendar, projects, supplies) and how navigation/layout components like Navbar propagate across them.
• Component Hierarchy: Emphasize that layout components wrap the pages and that modals (for new project creation, discard warnings, etc.) overlay the core application.
• Context and Hooks: Show how the AuthContext communicates with various components to guard routes and manage session states.
Architectural Patterns
• Next.js App Router and File-based Routing: Indicate that pages (.tsx files under src/app) correspond to routes which the Next.js router manages.
• Component-Based UI: The layered directory structure (components/ui, components/ui/projects, etc.) suggests a modular and reusable design.
• Third-Party Integration: Supabase plays a central role as the backend-as-a-service for authentication, database CRUD operations, and storage. The use of React Flow for the protocol builder and Headless UI for the UI elements should be highlighted.
• Separation of Concerns: Differentiate between view logic (React Components), data fetching (hooks, utility functions) and backend integration (config/supabaseClient).
Relevant Technologies
• Frontend Framework: Next.js 14
• Styling: TailwindCSS
• Backend Integration: Supabase (Authentication, PostgreSQL, Storage)
• Development Tools: ESLint, PostCSS, TypeScript (tsconfig.json)
• Components are clearly labelled.