📋 Phase Overview
This phase establishes the foundational infrastructure for the Blackberry Farm Management System. You'll create a new Laravel project, connect it to the existing MySQL database, set up authentication, and create the basic application structure.
End Goal: A working Laravel application with database connectivity, user authentication, and basic navigation ready for plant tracking development.
⚠️ Prerequisites
- PHP 8.0+ - Check with
php -v
- Composer - PHP dependency manager
- Node.js & NPM - For frontend asset compilation
- MySQL Access - Database: wwwhom8_blackberries
- Web Server - Local development (XAMPP/MAMP) or shared hosting access
Create a new Laravel project specifically for the blackberry farm management system.
Commands:
# Create new Laravel project
composer create-project laravel/laravel blackberry-farm
# Navigate to project directory
cd blackberry-farm
# Install Laravel Breeze for authentication (recommended)
composer require laravel/breeze --dev
php artisan breeze:install blade
npm install && npm run build
Expected Result: A fresh Laravel installation with authentication scaffolding ready.
Alternative Installation Methods:
# Using Laravel Installer (if installed globally)
laravel new blackberry-farm
# Or using Composer directly
composer create-project --prefer-dist laravel/laravel blackberry-farm
Configure the .env file with your specific database and API settings.
Database Configuration:
# Application Settings
APP_NAME="Blackberry Farm Management"
APP_ENV=local
APP_KEY=base64:YOUR_APP_KEY_HERE
APP_DEBUG=true
APP_URL=https://blackberries.homesteadingoutlaws.com
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=wwwhom8_blackberries
DB_USERNAME=wwwhom8_main
DB_PASSWORD=YOUR_DATABASE_PASSWORD
# Weather API Configuration
OPENWEATHER_API_KEY=8a9593124a5e205996ca00deaa857b0d
WEATHER_CITY=Booneville,AR,US
WEATHER_REFRESH_INTERVAL=600000
Security Note: Never commit your actual .env file to version control. Update the database password with your actual credentials.
Generate Application Key:
php artisan key:generate
Connect Laravel to your existing MySQL database and verify the connection.
Test Database Connection:
# Test database connection
php artisan tinker
> DB::connection()->getPdo();
> exit
Run Existing Migrations:
# Run Laravel's default migrations (users, password_resets, etc.)
php artisan migrate
# If you need to rollback and start fresh:
php artisan migrate:fresh
Existing Database: Your existing tables (plants, harvests, weather_data, etc.) should remain intact. We'll create Laravel models to interact with these tables in Phase 2.
Configure Laravel Breeze authentication system for secure user access.
Install and Configure Breeze:
# If not already installed in Step 1
composer require laravel/breeze --dev
php artisan breeze:install blade
# Install frontend dependencies
npm install
# Compile assets
npm run build
# Run migrations for authentication tables
php artisan migrate
Create Admin User:
# Create first admin user via tinker
php artisan tinker
> $user = new App\Models\User;
> $user->name = 'Farm Admin';
> $user->email = 'admin@blackberries.com';
> $user->password = bcrypt('secure_password_here');
> $user->email_verified_at = now();
> $user->save();
> exit
Create basic application structure with navigation and layout templates.
Create Base Layout:
Update resources/views/layouts/app.blade.php with farm-specific navigation:
<!-- Add to navigation section -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
{{ __('Dashboard') }}
</x-nav-link>
<x-nav-link :href="route('plants.index')" :active="request()->routeIs('plants.*')">
{{ __('Plants') }}
</x-nav-link>
<x-nav-link :href="route('harvests.index')" :active="request()->routeIs('harvests.*')">
{{ __('Harvests') }}
</x-nav-link>
<x-nav-link :href="route('weather.index')" :active="request()->routeIs('weather.*')">
{{ __('Weather') }}
</x-nav-link>
</div>
Update Dashboard:
Modify resources/views/dashboard.blade.php for farm overview:
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Blackberry Farm Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<!-- Dashboard content will go here in future phases -->
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 text-gray-900">
Welcome to your Blackberry Farm Management System!
</div>
</div>
</div>
</div>
</x-app-layout>
Initialize Git repository for project version control and backup.
Initialize Git Repository:
# Initialize Git repository
git init
# Add all files to staging
git add .
# Create initial commit
git commit -m "Initial Laravel setup for Blackberry Farm Management System"
# Optional: Add remote repository
git remote add origin YOUR_REPO_URL
git branch -M main
git push -u origin main
Create .gitignore (Laravel includes this by default):
# Verify .gitignore includes:
/vendor
/node_modules
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
Test the installation and verify all components are working correctly.
Run Development Server:
# Start Laravel development server
php artisan serve
# Visit in browser: http://localhost:8000
Test Authentication:
- Register a new user account
- Login/logout functionality
- Access dashboard after login
- Test password reset flow
Run Laravel Tests:
# Run default Laravel tests
php artisan test
# Or with PHPUnit directly
./vendor/bin/phpunit
Your Laravel project should now have this structure:
blackberry-farm/
├── app/
│ ├── Http/Controllers/
│ ├── Models/
│ └── Providers/
├── bootstrap/
├── config/
├── database/
│ ├── factories/
│ ├── migrations/
│ └── seeders/
├── public/
├── resources/
│ ├── css/
│ ├── js/
│ └── views/
├── routes/
│ ├── web.php
│ └── api.php
├── storage/
├── tests/
├── .env
├── composer.json
└── package.json
✅ Phase 1 Completion Checklist
- Laravel project created successfully
- Database connection established to wwwhom8_blackberries
- Authentication system (Breeze) installed and working
- Environment variables configured (.env file)
- Basic navigation structure in place
- Git repository initialized with initial commit
- Development server runs without errors
- User registration/login functionality tested
- Dashboard accessible after login
- All default Laravel tests passing
🔧 Common Issues & Solutions
- Database Connection Failed: Verify credentials in .env file and database server status
- Permission Errors: Ensure storage/ and bootstrap/cache/ directories are writable
- NPM Install Fails: Update Node.js to latest LTS version
- Composer Issues: Update Composer to latest version
- APP_KEY Missing: Run
php artisan key:generate
🎯 Next Steps: Phase 2 Preparation
With Phase 1 complete, you're ready to move to Phase 2: Core Plant Tracking. The next phase will involve:
- Creating Eloquent models for existing database tables
- Building plant management interfaces
- Implementing QR code generation
- Creating mobile-responsive plant tracking forms
Recommended: Take a backup of your current progress before proceeding to Phase 2.
# Create database backup
mysqldump -u wwwhom8_main -p wwwhom8_blackberries > phase1_backup.sql
# Create git tag for Phase 1 completion
git tag -a v1.0-phase1 -m "Phase 1: Foundation & Setup completed"
git push origin v1.0-phase1
# Archive current project state
tar -czf blackberry-farm-phase1.tar.gz .