How salmanyuris/aplikasi-back-end-with-google-cloud works
SAHASTA is an Express REST API for user access and profiles, child records, growth tracking, and food-nutrition scans. The main workflow is an API client request entering the server, being dispatched through feature routes to a controller, and receiving a JSON result. Child records and growth history share in-memory state; controllers use calculator utilities for age and BMI. Nutrition scans accept an optional image or food name and select sample nutrition data. The shown controllers use in-memory/sample data rather than a persistent database or actual image-analysis integration; unsampled details are not inferred.
Main entry points: server.js Express Server · growthController.js Growth History · babyController.js Baby Records · authRoutes.js Auth Routes
Components 13
API Entry
- Express Server
src/server.js
Identity
- Auth Routes
src/routes/authRoutes.js - Auth & Profile
src/controllers/authController.js - User Memory
src/controllers/authController.js
Child Health
- Baby Routes
src/routes/babyRoutes.js - Baby Records
src/controllers/babyController.js - Baby & Growth State
src/controllers/babyController.js - Growth Routes
src/routes/growthRoutes.js - Growth History
src/controllers/growthController.js - Age & BMI
src/utils/calculator.js
Nutrition Scan
- Nutrition Routes
src/routes/nutritionRoutes.js - Nutrition Scan
src/controllers/nutritionController.js
Other components
- API Client
Connections 15
- API Client → Express Server: sends request
- Express Server → Auth Routes: mounts auth
- Express Server → Baby Routes: mounts babies
- Express Server → Growth Routes: mounts growth
- Express Server → Nutrition Routes: mounts nutrition
- Auth Routes → Auth & Profile: dispatches
- Auth & Profile → User Memory: reads and writes
- Baby Routes → Baby Records: dispatches
- Baby Records → Baby & Growth State: reads and writes
- Baby Records → Age & BMI: calculates age and BMI
- Growth Routes → Growth History: dispatches
- Growth History → Baby & Growth State: reads and writes
- Growth History → Baby Records: imports shared state
- Growth History → Age & BMI: calculates age and BMI
- Nutrition Routes → Nutrition Scan: parses image and dispatches