How jsantiago318/scaling-lamp works
1. This repository is a client-side single-page application built with React, TypeScript, and Vite. There is no server application in the tree; the frontend is the whole runtime surface, with backend interaction funneled through a Supabase client.
2. The top-level application entry points are src/main.tsx and src/App.tsx. main.tsx is the bootstrapping layer that mounts React into index.html, while App.tsx is the root composition layer that likely selects and wires the app’s main screens.
3. The feature surface is organized around three screen-level views in src/screens: Auth.tsx, Home.tsx, and Calendar.tsx. These are the highest-level domain boundaries in the repo and are the best candidates for diagramming user flows and page transitions.
4. Shared UI is split into two levels: app-specific components in src/components and a larger reusable design system in src/components/ui. The ui folder contains shadcn-style primitives such as button, dialog, tabs, calendar, chart, and navigation components, which indicate the app builds feature screens from composable, low-level UI blocks rather than custom one-off widgets.
5. src/components/CountBtn.tsx is the only clearly custom non-UI component visible in the tree. It likely represents app-specific interaction logic layered on top of the shared component library.
6. supabaseClient.ts is the explicit integration boundary to external services. That file centralizes Supabase access, so any authentication or data-driven calendar behavior is probably mediated through this module rather than direct API calls scattered across screens.
7. The likely data flow is: user action in a screen component → shared UI primitives and custom components handle presentation and interaction → screen logic calls the Supabase client for auth or persisted data → results are rendered back into the screen. In architecture terms, Supabase is the only external system visible from the repository structure.
8. Styling is handled through Tailwind CSS and global stylesheet layering. src/styles/globals.css, tailwind.config.js, and postcss.config.js define the design token and utility-class pipeline, with component styles expected to be mostly utility-driven rather than CSS-module based.
9. src/lib/utils.ts serves as the shared utility boundary for client-side helpers. In shadcn-based projects this typically includes class name composition and related cross-cutting helpers used by many UI components.
10. The project is strongly tool-driven on the frontend build side: Vite for local dev and production bundling, TypeScript for type safety, ESLint for static analysis, and PostCSS/Tailwind for style processing. These are build-time concerns and do not add runtime subsystems, but they shape how the app is assembled and deployed as static assets.
11. public/ and src/assets/ represent the static content boundary. public/ is for assets served as-is by Vite, while src/assets contains importable assets managed through the module graph.
12. The repository also contains broad shadcn/ui coverage in src/components/ui, including calendar, tabs, accordion, dialog, pagination, resizable panels, and charts. That suggests the app is designed to support richer interactive screens and dashboard-like interfaces without introducing a separate UI framework or component server.
13. In diagram terms, the clearest architecture is: Vite-hosted React SPA at the center, three primary screens at the feature layer, shared UI primitives beneath them, a small utility layer for helpers, and a Supabase integration edge for authentication and persistent data.
Main entry points: App.tsx App.tsx · Home.tsx Home · utils.ts utils · globals.css globals.css
Components 20
Runtime shell
SPA entrypoints and root composition.
Screens
Top-level user-facing views.
- Auth · Authentication-facing screen.
src/screens/Auth.tsx - Home · Primary landing or dashboard screen.
src/screens/Home.tsx - Calendar · Calendar-centric screen for scheduling or dated data.
src/screens/Calendar.tsx - CountBtn · App-specific interaction component layered on shared UI.
src/components/CountBtn.tsx
Shared UI
Reusable primitives and app-specific controls.
- Button · Core action button primitive.
src/components/ui/button.tsx - Dialog · Modal and overlay primitive.
src/components/ui/dialog.tsx - Tabs · Tabbed navigation and panel switching primitive.
src/components/ui/tabs.tsx - Calendar UI · Date picker and calendar display primitive.
src/components/ui/calendar.tsx - Chart · Visualization primitive for dashboard-style views.
src/components/ui/chart.tsx - Nav Menu · Navigation menu primitive.
src/components/ui/navigation-menu.tsx
Data & external
Client integration boundary and shared helpers.
Styling & assets
Global styling and static asset boundaries.
- globals.css · Global stylesheet and Tailwind layer definitions.
src/styles/globals.css - public · Vite-served static files boundary.
public - assets · Module-managed static assets imported from the app.
src/assets - Vite config · Frontend build and dev-server configuration.
vite.config.ts - Tailwind config · Design-token and utility-class configuration.
tailwind.config.js - PostCSS config · CSS transformation pipeline configuration.
postcss.config.js
Connections 31
- main.tsx → App.tsx: mounts · Bootstraps the root React composition.
- App.tsx → Auth: routes to · Composes the authentication screen.
- App.tsx → Home: routes to · Composes the home screen.
- App.tsx → Calendar: routes to · Composes the calendar screen.
- App.tsx → CountBtn: uses · Includes the custom app-specific control.
- Auth → Button: builds on · Uses shared primitives for interaction.
- Auth → Dialog: builds on · Uses shared primitives for overlays or flows.
- Auth → Supabase: auth/data · Delegates authentication and backend interaction.
- Home → Button: builds on · Uses shared primitives for actions.
- Home → Tabs: builds on · Uses tabbed UI for view organization.
- Home → Chart: builds on · Uses visualization primitives for dashboard content.
- Home → Supabase: data · Fetches or persists app data through the client.
- Calendar → Calendar UI: builds on · Uses the calendar primitive for date interaction.
- Calendar → Dialog: builds on · Uses overlay patterns for editing or detail views.
- Calendar → Supabase: data · Reads and writes calendar-related persisted data.
- CountBtn → Button: wraps · Extends the base button primitive.
- Button → utils: helpers · Shares class-composition and common UI helpers.
- Dialog → utils: helpers · Shares class-composition and common UI helpers.
- Tabs → utils: helpers · Shares class-composition and common UI helpers.
- Calendar UI → utils: helpers · Shares class-composition and common UI helpers.
- Chart → utils: helpers · Shares class-composition and common UI helpers.
- Nav Menu → utils: helpers · Shares class-composition and common UI helpers.
- App.tsx → globals.css: styles · Consumes the global style layer.
- Auth → globals.css: styles · Rendered within the global style layer.
- Home → globals.css: styles · Rendered within the global style layer.
- Calendar → globals.css: styles · Rendered within the global style layer.
- App.tsx → assets: imports · May consume module-managed static assets.
- App.tsx → public: serves · Uses Vite-served static files as part of the SPA.
- Vite config → main.tsx: builds · Defines the dev and production bundle pipeline.
- Tailwind config → globals.css: configures · Shapes the global utility and theme layer.
- PostCSS config → globals.css: processes · Feeds the CSS build pipeline.