Skip to content

AmaLS367/meal-planner-pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MealCraft

React Vite TypeScript Tailwind CSS IndexedDB

A modern, offline-first meal planning and nutrition tracking application


Overview

MealCraft is a comprehensive meal planning application that helps you organize recipes, plan weekly meals, track daily nutrition, and manage your dietary goals. Built with modern web technologies, it runs entirely in your browser with local data storage, ensuring your meal plans and nutrition data remain private and accessible offline.

The application provides an intuitive interface for managing your culinary journey, from discovering and organizing recipes to planning weekly meal schedules and monitoring your nutritional intake against personalized targets.

Key Features

πŸ‘€ Profile Management

Create and manage your personal profile with body parameters, activity level, and fitness goals. The app automatically calculates personalized daily nutrition targets (calories, protein, fats, carbohydrates) based on your profile data.

πŸ“– Recipe Collection

Build and maintain a personal recipe library with detailed nutritional information. Each recipe includes ingredients, instructions, serving sizes, and complete macronutrient breakdowns. Browse, search, and organize your favorite recipes for easy meal planning.

πŸ“… Weekly Meal Planner

Plan your meals week by week with an intuitive calendar interface. Assign recipes to specific days and meal types (breakfast, lunch, dinner, snacks). Generate shopping lists automatically from your planned meals, copy meal plans between days, and view weekly nutrition summaries.

πŸ“Š Nutrition Tracker

Log your daily meals and track your nutrition intake in real-time. View progress toward your daily targets with visual indicators for calories, protein, fats, and carbohydrates. Access detailed daily logs and historical nutrition data.

πŸ’Ύ Export & Import

Export all your data (recipes, meal plans, tracker logs, profile, and targets) to a JSON file for backup or transfer. Import data to restore from backups or migrate between devices. All data remains local and private.

🎨 Theme Support

Switch between light and dark themes, or follow your system preferences. The application adapts to your preferred appearance for a comfortable viewing experience.

Tech Stack

  • Frontend Framework: React 18.3.1
  • Build Tool: Vite 5.4.19
  • Language: TypeScript 5.8.3
  • Styling: Tailwind CSS 3.4.17
  • UI Components: shadcn-ui (Radix UI primitives)
  • State Management: React Query (TanStack Query)
  • Routing: React Router DOM 6.30.1
  • Data Storage: IndexedDB via idb 8.0.3
  • Internationalization: react-i18next 15.1.2
  • Form Handling: React Hook Form 7.61.1 with Zod validation
  • Date Handling: date-fns 3.6.0
  • Charts: Recharts 2.15.4
  • Icons: Lucide React 0.462.0

Quick Start

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm (comes with Node.js)

Installation

Open PowerShell in the project directory and run:

# Install dependencies
npm install

# Start development server
npm run dev

The application will be available at http://localhost:5173 (or the next available port).

Build for Production

# Create production build
npm run build

# Preview production build
npm run preview

Additional Commands

# Run linter
npm run lint

# Run tests
npm run test

# Run tests in watch mode
npm run test:watch

# Check i18n strings
npm run lint:i18n

Project Structure

meal-planner-pro/
β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ favicon.svg
β”‚   └── robots.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ layout/         # Layout components (AppLayout)
β”‚   β”‚   └── ui/             # shadcn-ui components
β”‚   β”œβ”€β”€ entities/           # Type definitions
β”‚   β”‚   └── types.ts        # Shared TypeScript types
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ lib/                # Utility functions
β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx   # Overview and daily progress
β”‚   β”‚   β”œβ”€β”€ Profile.tsx     # User profile and targets
β”‚   β”‚   β”œβ”€β”€ Recipes.tsx     # Recipe collection
β”‚   β”‚   β”œβ”€β”€ RecipeDetail.tsx # Individual recipe view
β”‚   β”‚   β”œβ”€β”€ Planner.tsx     # Weekly meal planning
β”‚   β”‚   β”œβ”€β”€ Tracker.tsx     # Daily nutrition tracking
β”‚   β”‚   └── Settings.tsx    # App settings
β”‚   β”œβ”€β”€ shared/             # Shared code
β”‚   β”‚   β”œβ”€β”€ data/           # Seed data and fixtures
β”‚   β”‚   β”œβ”€β”€ hooks/          # Shared hooks (useStorage, useTheme)
β”‚   β”‚   β”œβ”€β”€ i18n/           # Internationalization
β”‚   β”‚   └── lib/            # Shared utilities
β”‚   └── test/               # Test files
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ scripts/                # Build and utility scripts
└── index.html              # Application entry point

Application Flow

graph TD
    A[Start] --> B[Dashboard]
    B --> C{User Action}
    C -->|View Profile| D[Profile]
    C -->|Browse Recipes| E[Recipes]
    C -->|Plan Meals| F[Planner]
    C -->|Track Nutrition| G[Tracker]
    C -->|Configure| H[Settings]
    
    D --> I[Set Body Parameters]
    I --> J[Calculate Targets]
    J --> B
    
    E --> K[Recipe Detail]
    K --> L{Action}
    L -->|Add to Planner| F
    L -->|Add to Tracker| G
    L --> E
    
    F --> M[Select Week]
    M --> N[Assign Recipes]
    N --> O[Generate Shopping List]
    O --> F
    
    G --> P[Select Date]
    P --> Q[Log Meals]
    Q --> R[View Progress]
    R --> G
    
    H --> S{Setting Type}
    S -->|Theme| T[Change Theme]
    S -->|Language| U[Change Language]
    S -->|Export| V[Export Data]
    S -->|Import| W[Import Data]
    T --> H
    U --> H
    V --> H
    W --> H
    
    style A fill:#e1f5ff
    style B fill:#fff4e6
    style D fill:#f3e5f5
    style E fill:#e8f5e9
    style F fill:#fff3e0
    style G fill:#e3f2fd
    style H fill:#fce4ec
Loading

Documentation


Built with ❀️ using React, Vite, and TypeScript

About

MealCraft: meal planning and macro tracking app. Profile, recipes, weekly planner, tracker, export/import. Built with React, Vite, TypeScript.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors