DEV_SETUP.md 2.1 KB

Development Setup Instructions

Running Without Docker for Development

You can run the application without Docker containers for easier development by running the frontend and backend services directly on your host machine.

Prerequisites

  • Node.js 18+ and npm
  • PHP 8.1+ with required extensions
  • MySQL/MariaDB database
  • Redis (optional, for caching)

Backend Setup

  1. Install PHP Dependencies:

    cd backend
    composer install
    
  2. Configure Environment:

    cp .env.example .env
    # Edit .env with your database credentials
    
  3. Start Backend Server:

    cd backend
    php -S localhost:8080
    

Frontend Setup

  1. Install Dependencies:

    cd frontend
    npm install
    
  2. Configure Environment:

    cp .env.example .env.local
    # Edit .env.local with your API URL
    
  3. Start Development Server:

    cd frontend
    npm run dev
    

Access the Application

Benefits of Development Setup

  • Hot Reload: Frontend automatically reloads on code changes
  • Fast Debugging: No container overhead, direct file access
  • Easy Logging: Direct access to logs and error messages
  • Database Access: Direct connection to local database for debugging
  • No Docker Issues: Avoid container networking and volume mounting problems

Switching Between Development and Production

To switch back to Docker setup:

# Stop development servers
# Kill PHP server (Ctrl+C)
# Kill npm dev server (Ctrl+C)

# Start Docker containers
docker-compose -f docker-compose.unified.yml up -d

Troubleshooting

If you encounter issues:

  1. Port Conflicts: Make sure ports 8080 (backend) and 5173 (frontend) are available
  2. Database Connection: Verify MySQL is running and credentials in .env are correct
  3. PHP Extensions: Ensure all required PHP extensions are installed
  4. Node Version: Make sure you're using Node.js 18+