File: /var/www/mealplan.rtfmfm.com/README.md
# Meal Plan Calculator
A comprehensive web-based calorie calculation application built with Laravel and MySQL. This application helps users create personalized meal plans with accurate calorie and macronutrient tracking.
## Features
### User Management
- ✅ User registration and authentication
- ✅ Weight tracking for accurate calorie calculations
### Day Types
- ✅ Create custom day types (Training Day, Rest Day, etc.)
- ✅ Set target calories and macronutrients (protein, carbs, fat, fiber)
- ✅ Automatic macro calculations based on user weight
### Meal Planning
- ✅ Define meal types with percentage-based calorie distribution
- ✅ Create daily menus linked to specific day types
- ✅ Add products to meals with precise quantity tracking
### Product Management
- ✅ Organize products into categories
- ✅ Detailed nutritional information per 100g
- ✅ Comprehensive product database
### Nutrition Tracking
- ✅ Real-time calorie calculations
- ✅ Macronutrient tracking (protein, carbs, fat, fiber)
- ✅ Compare actual vs. target values
## Installation
### Prerequisites
- PHP 8.1 or higher
- Composer
- MySQL 8.0 or higher
- Node.js 18+ (for frontend assets)
### Setup Steps
1. **Clone and Install Dependencies**
```bash
git clone <repository-url>
cd mealPlan
composer install
```
2. **Environment Configuration**
```bash
cp .env.example .env
php artisan key:generate
```
3. **Database Setup**
Update your `.env` file with database credentials:
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=meal_plan
DB_USERNAME=your_username
DB_PASSWORD=your_password
```
4. **Run Migrations**
```bash
php artisan migrate
```
5. **Start Development Server**
```bash
php artisan serve
```
## Usage Workflow
1. **Initial Setup**
- Register an account
- Set your weight in User Settings
2. **Create Day Types**
- Define different day types (e.g., "Training Day", "Rest Day")
- Set target calories and macronutrients
3. **Setup Meal Types**
- Create meal types for each day type
- Define calorie percentage for each meal
4. **Add Product Categories**
- Organize products into categories (e.g., "Vegetables", "Meat", "Dairy")
5. **Add Products**
- Add products with nutritional information per 100g
- Include calories, protein, carbs, fat, and fiber
6. **Create Daily Menus**
- Select a day type
- Add products to each meal
- Track real-time calorie and macro calculations
## Database Schema
### Key Tables
- `users` - User accounts with weight tracking
- `day_types` - Custom day types with target macros
- `meal_types` - Meals with percentage-based calorie distribution
- `product_categories` - Product organization
- `products` - Nutritional database
- `daily_menus` - User's daily meal plans
- `menu_items` - Individual products in meals
## Technology Stack
- **Backend**: Laravel 12 (PHP)
- **Database**: MySQL
- **Authentication**: Laravel Breeze
- **Frontend**: Blade templates with Tailwind CSS
- **Authorization**: Laravel Policies
## API Endpoints
The application uses standard Laravel resource routes:
- `GET /dashboard` - Main dashboard
- `GET /settings` - User weight settings
- `GET /day-types` - Day type management
- `GET /meal-types` - Meal type management
- `GET /product-categories` - Category management
- `GET /products` - Product management
- `GET /daily-menus` - Daily menu creation
## Development
### Running the Application
```bash
php artisan serve
```
Access at: http://127.0.0.1:8000
### Database Management
```bash
# Reset database
php artisan migrate:fresh
# Seed sample data (if seeders exist)
php artisan db:seed
```
### Testing
```bash
php artisan test
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
## License
This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
### Premium Partners
- **[Vehikl](https://vehikl.com)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Redberry](https://redberry.international/laravel-development)**
- **[Active Logic](https://activelogic.com)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).