How roberstxx/kaloris works
Project type and purpose
• This is a single‐page, full-stack web application built with React 18 + Vite + TypeScript, using Firebase (Auth + Firestore) for back-end services, Cloudinary for media storage, and localStorage as an offline cache.
• Purpose: daily nutritional tracking—users register, log meals, view dashboards, export PDF reports, and customize profiles/themes.
File structure
• Top-level “src/” contains subfolders:
• api/ – HTTP clients (for future back-end integrations)
• components/ – reusable UI pieces (video: FoodCard, SearchBar, etc.) + “ui/” (shadcn/ui primitives)
• context/ – React Context providers (Session, Theme, Intake)
• data/ – seed JSON for initial foods
• hooks/ – custom hooks (mobile detection, localStorage, TDEE calc)
• lib/ – external integrations & helpers (Firebase, Cloudinary, routing guards)
• pages/ – route components (Login, Register, Dashboard, Historial, Settings, Streak, NotFound, Splash)
• utils/ – pure helpers (PDF export, date, crypto, validators, stats)
• Config and scripts: Vercel, Vite, Tailwind, tsconfig, .env.example
README for additional insights
• Global states via Context Providers: SessionProvider, ThemeProvider, IntakeProvider
• Routing: React Router with guards (RequireAuth, RequireProfile)
• Key sequences: user registration, login, daily intake logging, PDF export
• External services: Firebase Auth/Firestore, Cloudinary, localStorage
Detail without over-splitting
• Essential pieces: providers, routing guards, data stores, external services
• UI components logically (shared vs. page-specific)
• Sequence for critical flows: login/onboarding, daily logging, export
• Patterns: Context API, HOC guards, offline cache sync