How eccealgo/calories-tracker-v1 works
This repository is a web application for account registration/login and food-product lookup. The user-facing flow is signup or login through the React app, with profile recovery when a token exists; separately, product searches reach an Express endpoint that queries Open Food Facts. The backend also exposes person create/read/update/delete operations. The README is empty, and some route mounting and frontend-to-backend wiring are not shown, so those links are omitted or marked unverified rather than inferred.
Main entry points: App.tsx Route app · authService.ts Auth requests · Signup.tsx Signup form · Login.tsx Login form
Components 21
Web application
- Route app
frontend/src/App.tsx - Auth state
frontend/src/contexts/AuthContext.tsx - User profile state
frontend/src/contexts/UserContext.tsx - Private route
frontend/src/components/PrivateRoute.tsx - Signup form
frontend/src/pages/authentification/Signup.tsx - Login form
frontend/src/pages/authentification/Login.tsx - Dashboard
frontend/src/pages/dashboard/Dashboard.tsx - Account header
frontend/src/components/layout/Header.tsx - Auth requests
frontend/src/services/authService.ts - JSON transport
frontend/src/utils/fetchJson.ts
Backend API
- Express server
backend/src/index.ts - Person routes
backend/src/routes/personRouter.ts - Person controller
backend/src/controllers/personController.ts - Person service
backend/src/services/personService.ts - Person persistence
backend/src/models/personModel.ts - Person database
backend/prisma/schema.prisma
Product lookup
- Product routes
backend/src/routes/productRouter.ts - Product controller
backend/src/controllers/productController.ts - Product search service
backend/src/services/productService.ts
Other components
- Visitor
- Open Food Facts
Connections 25
- Visitor → Route app: uses
- Route app → Auth state: provides
frontend/src/App.tsx - Route app → User profile state: provides
frontend/src/App.tsx - Route app → Signup form: routes to
frontend/src/App.tsx - Route app → Login form: routes to
frontend/src/App.tsx - Route app → Private route: guards route
frontend/src/App.tsx - Route app → Dashboard: routes to
frontend/src/App.tsx - Signup form → Auth requests: submits to
frontend/src/pages/authentification/Signup.tsx - Signup form → Auth state: checks state
frontend/src/pages/authentification/Signup.tsx - Login form → Auth requests: authenticates via
frontend/src/pages/authentification/Login.tsx - Login form → User profile state: updates profile
frontend/src/pages/authentification/Login.tsx - User profile state → Auth requests: fetches profile
frontend/src/contexts/UserContext.tsx - Auth requests → JSON transport: sends requests
frontend/src/services/authService.ts - Auth requests → Express server: calls API
- Dashboard → Account header: renders
frontend/src/pages/dashboard/Dashboard.tsx - Account header → Auth state: reads state
frontend/src/components/layout/Header.tsx - Express server → Person routes: imports routes
backend/src/index.ts - Express server → Product routes: imports routes
backend/src/index.ts - Person routes → Person controller: dispatches to
backend/src/routes/personRouter.ts - Person controller → Person service: calls
backend/src/controllers/personController.ts - Person service → Person persistence: calls
backend/src/services/personService.ts - Person service → Person database: queries
- Product routes → Product controller: dispatches to
backend/src/routes/productRouter.ts - Product controller → Product search service: calls
backend/src/controllers/productController.ts - Product search service → Open Food Facts: searches
backend/src/services/productService.ts