How johnleshan/tracksimply works
Purpose and Entry Points
This is a Vite-built React single-page application for business/personal operations management: dashboard, accounts, bookkeeping, budgets, debt, inventory, vehicles, and AI assistance. The browser bootstrap is src/main.jsx; application composition and top-level routing/state layout are centered in src/App.jsx. Styling is primarily colocated CSS plus global styles in src/index.css and src/App.css.
Application Shell and Navigation
The persistent UI shell is built from navigation and workspace components:
• src/components/Navbar.jsx
• src/components/Sidebar.jsx
• src/App.jsx
The sidebar likely selects operational tools while the app root controls which tool/workspace is rendered. Product-oriented UI is separated into reusable display/detail components at src/components/ProductCard.jsx and src/components/ProductModal.jsx.
Authentication and Data Boundary
Authentication state is centralized through React context in src/context/AuthContext.jsx. Supabase client creation/configuration is isolated at src/lib/supabase.js, forming the principal boundary between browser UI and backend authentication/database services.
Tool components should consume authenticated state rather than own credential handling. The repository includes database validation, RLS, user, and deployment investigation scripts under scratch/, indicating Supabase database policies and user access are material operational concerns.
Operational Tool Modules
The primary domain stages are independent React tool views under src/components/tools/:
• Dashboard aggregation: DashboardOverview.jsx
• Account/user administration: AccountManager.jsx
• Financial records: Bookkeeping.jsx
• Planning and liabilities: BudgetPlanner.jsx, DebtTracker.jsx
• Operational assets: InventoryTracker.jsx, VehicleManagement.jsx
These modules are the core feature boundary: each owns domain-specific UI and likely reads/writes its related Supabase tables, while shared authentication and navigation remain outside them.
AI Assistance Flow
src/components/MagicAI.jsx provides the user-facing AI interaction surface. Requests are delegated through src/services/aiService.js, keeping model/API invocation separate from presentation code. The presence of scratch/test_groq.cjs suggests Groq is the intended or tested external AI provider; secrets should be supplied through environment configuration rather than frontend source.
Data, Deployment, and Infrastructure
CSV files in data/ provide seed/import-oriented business datasets for budgets, debts, inventory, users, and transactions, e.g. data/budgets.csv and data/transactions.csv. Database initialization is represented by scratch/initialize_database.sql.
The frontend is configured as a Vite application via vite.config.js, with Vercel deployment configuration in vercel.json. .env.example defines the expected environment-variable contract for services such as Supabase and AI integration.
Main entry points: App.jsx App shell and routing · supabase.js Supabase client · Sidebar.jsx Tool navigation · aiService.js AI request service
Components 19
React application
Browser SPA shell and operational workspaces.
- Browser bootstrap
src/main.jsx - App shell and routing · Composes the persistent workspace and selected tool view.
src/App.jsx - Top navigation
src/components/Navbar.jsx - Tool navigation
src/components/Sidebar.jsx - Product detail UI · Reusable product cards and modal details.
src/components/ProductCard.jsx - Dashboard overview · Aggregates operational data for the dashboard.
src/components/tools/DashboardOverview.jsx - Account management
src/components/tools/AccountManager.jsx - Finance planning tools · Bookkeeping, budgets, and debt tracking workspaces.
src/components/tools/Bookkeeping.jsx - Asset operations tools · Inventory and vehicle management workspaces.
src/components/tools/InventoryTracker.jsx - Magic AI UI
src/components/MagicAI.jsx
Service boundary
Shared authentication, backend, and AI integrations.
- Authentication state · Centralizes signed-in user state for tool views.
src/context/AuthContext.jsx - Supabase client · Browser boundary for authentication and database access.
src/lib/supabase.js - AI request service · Separates model invocation from AI presentation.
src/services/aiService.js - Groq provider · Intended or tested model provider.
scratch/test_groq.cjs
Data and operations
Seed data and database setup artifacts.
- Business CSV data · Budgets, debts, inventory, users, and transactions datasets.
data/budgets.csv - Database initialization · Initializes the Supabase database and its access model.
scratch/initialize_database.sql
Build and deployment
Frontend build, environment, and hosting configuration.
- Environment contract · Defines required Supabase and AI service variables.
.env.example - Vite build
vite.config.js - Vercel deployment
vercel.json
Connections 23
- Browser bootstrap → App shell and routing: mounts
- App shell and routing → Top navigation: renders
- App shell and routing → Tool navigation: renders
- Tool navigation → Dashboard overview: selects
- Tool navigation → Account management: selects
- Tool navigation → Finance planning tools: selects
- Tool navigation → Asset operations tools: selects
- App shell and routing → Product detail UI: uses
- App shell and routing → Magic AI UI: renders
- App shell and routing → Authentication state: provides state
- Authentication state → Supabase client: authenticates through
- Dashboard overview → Supabase client: reads operational data
- Account management → Supabase client: manages users
- Finance planning tools → Supabase client: reads and writes records
- Asset operations tools → Supabase client: reads and writes assets
- Magic AI UI → AI request service: delegates requests
- AI request service → Groq provider: invokes model
- Environment contract → Supabase client: supplies configuration
- Environment contract → AI request service: supplies secrets
- Business CSV data → Database initialization: supports import
- Database initialization → Supabase client: initializes
- Vite build → Browser bootstrap: builds
- Vercel deployment → Vite build: deploys build