How rutujthakare0/pocket-stock works
PocketStock is a household inventory product for tracking supplies, purchases, members, and restocking needs. Users authenticate, select a household, and manage its inventory in the dashboard; inventory can also be added by barcode or bill scan, while purchase and inventory events support prediction features. The frontend’s dashboard and account pages call the backend API, whose routers dispatch to controllers and PostgreSQL. Notification and prediction services are present as distinct backend subsystems. Some service wiring is documented only by the source index, so unverified connections are omitted.
Main entry points: App.jsx App routing · householdController.js Household inventory · api.js API endpoints · db.js PostgreSQL
Components 25
Web client
- App routing
frontend/src/App.jsx - Auth context
frontend/src/context/AuthContext.jsx - Login and signup
frontend/src/pages/LoginPage.jsx - Inventory dashboard
frontend/src/pages/DashboardPage.jsx - Household members
frontend/src/pages/MembersPage.jsx - User settings
frontend/src/pages/UserSettingsPage.jsx - Join household
frontend/src/pages/JoinHouseholdPage.jsx - API endpoints
frontend/src/config/api.js
Backend API
- HTTP application
backend/app.js - User routes
backend/src/routers/userRouter.js - Household routes
backend/src/routers/householdRoutes.js - Authentication
backend/src/controllers/authController.js - Google sign-in
backend/src/controllers/googleAuthController.js - User management
backend/src/controllers/userController.js
Inventory domain
- Household inventory
backend/src/controllers/householdController.js - PostgreSQL
backend/src/config/db.js - Redis cache
backend/src/config/redis.js - Bill parsing
backend/src/utils/billParser.js - Inventory matching
backend/src/utils/inventoryMatcher.js
Background services
- Prediction service
backend/src/prediction-service/services/predictionService.js - Event producer
backend/src/prediction-service/kafka/producer.js - Notifications
backend/src/notification-service/services/notificationService.js - Push delivery
backend/src/notification-service/services/deliveryService.js - Push providers
backend/src/notification-service/providers/pushProviders.js
Other components
- Household user
Connections 32
- Household user → App routing: uses
frontend/src/App.jsx - App routing → Login and signup: routes to
frontend/src/App.jsx - App routing → Inventory dashboard: routes to
frontend/src/App.jsx - App routing → Household members: routes to
frontend/src/App.jsx - App routing → User settings: routes to
frontend/src/App.jsx - App routing → Join household: routes to
frontend/src/App.jsx - App routing → Auth context: provides
frontend/src/App.jsx - Auth context → API endpoints: calls endpoints
frontend/src/context/AuthContext.jsx - Inventory dashboard → API endpoints: calls endpoints
frontend/src/pages/DashboardPage.jsx - Household members → API endpoints: calls endpoints
frontend/src/pages/MembersPage.jsx - User settings → API endpoints: calls endpoints
frontend/src/pages/UserSettingsPage.jsx - Join household → API endpoints: calls endpoints
frontend/src/pages/JoinHouseholdPage.jsx - API endpoints → HTTP application: HTTP requests
- HTTP application → User routes: mounts routes
backend/app.js - HTTP application → Household routes: mounts routes
backend/app.js - User routes → Authentication: dispatches
backend/src/routers/userRouter.js - User routes → Google sign-in: dispatches
backend/src/routers/userRouter.js - User routes → User management: dispatches
backend/src/routers/userRouter.js - Household routes → Household inventory: dispatches
backend/src/routers/householdRoutes.js - Authentication → PostgreSQL: queries
backend/src/controllers/authController.js - Google sign-in → PostgreSQL: queries
backend/src/controllers/googleAuthController.js - User management → PostgreSQL: queries
backend/src/controllers/userController.js - Household inventory → PostgreSQL: reads and writes
backend/src/controllers/householdController.js - Household inventory → Redis cache: checks cache
backend/src/controllers/householdController.js - Household inventory → Bill parsing: parses bill
backend/src/controllers/householdController.js - Household inventory → Inventory matching: matches items
backend/src/controllers/householdController.js - Household inventory → Event producer: publishes events
backend/src/controllers/householdController.js - Event producer → Prediction service: feeds events
- Prediction service → PostgreSQL: queries
backend/src/prediction-service/services/predictionService.js - Prediction service → Redis cache: uses cache
backend/src/prediction-service/services/predictionService.js - Notifications → PostgreSQL: queries
backend/src/notification-service/services/notificationService.js - Push delivery → Push providers: uses providers
backend/src/notification-service/services/deliveryService.js