0

Akıllı Diyet

Full-stack nutrition and wellness platform where users can track meals, water, sleep, exercise, and weight in one place, manage personal goals, and monitor progress through practical dashboard screens.

Akıllı Diyet is an API-first, production-oriented product for tracking diet and daily wellness in one place. The system is split across two repositories so the Spring Boot service can ship and scale independently from the React client: the backend owns authentication, validation, and persistence; the frontend focuses on typed API integration, routing, and data visualization.

Users work with a food catalog, meal-based food logs (FoodLogEntry, MealType), water, sleep, exercise, and weight history—aligned with profile data such as gender, activity level, and diet goal on AppUser. Password reset is supported end-to-end (PasswordResetToken plus Spring Mail), so account recovery is part of the product rather than an afterthought.

The app is developed and documented for real workflows: H2 for instant runs, PostgreSQL via Docker Compose and the postgres Spring profile for parity with production, JWT secrets enforced in deployment (README: JWT_SECRET at least 32 characters), and Vite dev proxy to http://localhost:8080 so local UI development avoids brittle CORS setup. Live UI: akillidiyet.vercel.app. Source: backend, frontend.

Key Features

  • JWT-based authentication for a stateless SPA + API model
  • User profiles with gender, activity level, diet goal, and related onboarding data
  • Food catalog and meal-type-aware food logging (daily intake tracking)
  • Water, sleep, exercise, and weight logs for a fuller wellness picture
  • Password reset flow with token entity and email delivery (spring-boot-starter-mail)
  • REST API with Bean Validation on inputs (spring-boot-starter-validation)
  • Dual database profiles: embedded H2 for development; PostgreSQL for Docker/local-prod-style runs
  • Spring Boot Actuator for operational endpoints in deployed environments
  • React 19 SPA with React Router, Axios HTTP client, and Recharts for dashboard-style charts
  • Vite dev server with proxy to backend port 8080; .env.example for frontend configuration
  • Vitest + jsdom for frontend unit tests; ESLint flat config
  • Deployment assets: Dockerfile, docker-compose.yml, fly.toml, render.yaml, render.env.example; UI hosted on Vercel

What I Worked On

  • Designed layered backend structure (web, service, repo, domain, security, config) for clear boundaries
  • Implemented Spring Security with JWT (JJWT) and protected route contracts for the SPA
  • Modeled relational domain (users, foods, log entries, tokens, enums) with Spring Data JPA / Hibernate
  • Added mail-backed password reset and secure handling of reset tokens
  • Configured profile-based persistence (H2 vs PostgreSQL) and Docker Compose for local PostgreSQL
  • Documented run paths in README files (Maven quick start; SPRING_PROFILES_ACTIVE=postgres, DB_PASSWORD, production JWT_SECRET); referenced environment docs in backend repo where applicable
  • Built React UI with TypeScript, shared context and hooks, page-level composition, and API modules aligned with backend DTOs
  • Integrated Recharts for metrics visualization and resilient loading/error handling for HTTP calls
  • Set up Vite build pipeline, ESLint, and Vitest scripts for repeatable quality checks
  • Wired cross-origin production strategy (separate UI/API origins) while keeping local proxy ergonomics
  • Prepared container and PaaS metadata (Fly.io, Render) and Vercel deployment for the frontend

Technologies Used

Backend

  • Java 17
  • Spring Boot 3.4
  • Spring Web (REST)
  • Spring Data JPA
  • Spring Security
  • Spring Validation
  • Spring Mail
  • Spring Boot Actuator
  • Spring Boot DevTools (development)
  • JJWT (JSON Web Tokens)
  • Lombok
  • Maven

Frontend

  • React 19
  • TypeScript
  • Vite
  • React Router
  • Axios
  • Recharts
  • HTML5 / CSS3
  • Context API and custom hooks

Database & ORM

  • PostgreSQL (production-style / Docker profile)
  • H2 (development profile)
  • JPA / Hibernate
  • Docker Compose for local database

Security

  • Spring Security
  • JWT access model for the SPA
  • Password reset tokens and email-based recovery
  • Strong JWT_SECRET requirement for production (documented in backend README)

API & quality

  • RESTful JSON API
  • Server-side validation
  • Vitest unit tests (frontend)
  • ESLint (flat config, React Hooks / Refresh plugins)

Tools & DevOps

  • Git (dual-repo workflow: akilli-diyet-backend, akilli-diyet-frontend)
  • Docker / Dockerfile
  • Fly.io (fly.toml)
  • Render (render.yaml, env example)
  • Vercel (frontend)
  • Postman or equivalent for API verification (typical workflow)