Week 3 Worklog

Week 3 Objectives:

  • Backend: Build the application-wide common layer — exception handling, CORS, and the GoalType module.
  • Frontend: Scaffold the complete navigation hierarchy and implement the multi-step Onboarding flow.
  • Ensure end-to-end flow from login → onboarding → main app works before adding deeper features.

Tasks to be carried out this week:

DayTaskStart DateCompletion DateReference Material
2- Implement com.example.fitme.common.exception.GlobalExceptionHandler (@RestControllerAdvice)
  + Handle MethodArgumentNotValidException → field-level validation errors
  + Handle EntityNotFoundException, custom business exceptions
  + All errors returned in ApiResponse envelope with appropriate HTTP status
01/20/202601/20/2026
2- Configure CorsConfig globally
  + Allow origins for local dev and production frontend URLs
  + Allow headers: Authorization, Content-Type
  + Allow all HTTP methods
01/20/202601/20/2026
3- Build GoalType module
  + Entity: name (UNIQUE), description
  + Repository, Service, Controller
  + Endpoints (all public): POST /api/goal-types, GET /api/goal-types, GET /api/goal-types/{id}, GET /api/goal-types/by-name/{name}
01/21/202601/21/2026
4- Build Frontend RootNavigator (within src/navigation/)
  + Reads Redux isAuthenticated + hasCompletedOnboarding from authSlice
  + Routes to AuthStack (unauthenticated) / OnboardingStack (pending) / MainTabs (ready)
- Build AuthStack: WelcomeScreen + LoginScreen
- Build MainTabs with CustomTabBar
  + 4 bottom tabs: Home, Workout, Diet, Health
  + Center floating Chat button splitting left/right tabs
01/22/202601/22/2026https://reactnavigation.org/
5- Build OnboardingStack (5-step wizard)
  + Step 1: Gender + Date-of-birth (day/month/year sliders) + Height + Weight
  + Step 2: Activity level + Job type
  + Step 3: Main fitness goal + Target weight + Target body areas
  + Step 4: Diet preferences + Food allergies + Meals per day + Water intake
  + Step 5: Experience level + Workout location + Frequency + Session duration
01/23/202601/23/2026
6- Add CaloriesScreen and TrainingScreen to Onboarding preview
  + CaloriesScreen: animated calorie management demo UI
  + TrainingScreen: weekly workout plan by day preview
- Wire onboarding completion: dispatch(completeOnboarding()) → sync user profile to backend via POST /user/sync
01/24/202601/24/2026

Week 3 Achievements:

  • Backend — Common Layer:
    • GlobalExceptionHandler catches all standard and custom exceptions; returns consistent ApiResponse to clients.
    • CORS configured globally — frontend running on localhost:8081 can communicate with the API on localhost:8080.
  • Backend — GoalType module:
    • GoalType entity persisted to PostgreSQL; supports types like Weight Loss, Muscle Gain, Maintenance.
    • All 4 public endpoints operational: create, list all, get by ID, get by name.
    • GoalTypes serve as the backbone for linking workout plans to user fitness goals.
  • Frontend — Navigation:
    • RootNavigator correctly redirects based on auth + onboarding state — no logic in individual screens.
    • MainTabs renders with CustomTabBar; tab bar splits left (Home, Workout) and right (Diet, Health) around a center Chat button.
    • All stacks registered: AuthStack, OnboardingStack, WorkoutStack, DietStack, HealthStack.
  • Frontend — Onboarding:
    • Full 5-step wizard implemented with slide animations between steps.
    • User data collected (gender, DOB, height, weight, goals, diet prefs, workout prefs) ready to be stored in profile.
    • Onboarding completion dispatches completeOnboarding() and calls the backend sync endpoint.

AWS Knowledge Learned:

  • Learned the cloud deployment implications of CORS when frontend and backend live on different domains or subdomains.
  • Understood preflight OPTIONS behavior and how misconfigured headers or methods can silently break authenticated production traffic.
  • Mapped the current API structure to a future API Gateway style boundary with clear separation of public, authenticated, and admin routes.
  • Recognized why standardized error envelopes make CloudWatch troubleshooting faster and client-side debugging more predictable.
  • Practiced the idea of request correlation using request IDs or trace IDs so multi-service debugging becomes easier later.
  • Understood how centralized exception handling supports cleaner alarm rules because error shapes become consistent.
  • Prepared the code structure for future tracing and observability integration by keeping responses and logs structured.

In summary, week 3 focused on AWS-relevant API governance and observability foundations rather than infrastructure provisioning alone.

Next Week Plan:

  • Backend: Build the System Workout module — MuscleGroup, Exercise, WorkoutPlan, WorkoutPlanExercise entities with admin CRUD and public read endpoints.
  • Frontend: Implement the SuggestedPlanScreen (3-step plan selection wizard) and PlanExercisePicker.