Skip to main content

Getting Started with Backend Development

Prerequisites

Before you begin, ensure you have the following installed:

  • PHP 8.2 or higher
  • Composer
  • PostgreSQL 15+
  • Redis (for caching)
  • Git

Initial Setup

  1. Clone the Repository
git clone https://github.com/ox-agry/backend
cd backend
  1. Install Dependencies
composer install
  1. Environment Configuration
# Copy environment file
cp .env.example .env

# Generate application key
php bin/console secrets:generate-keys

# Generate JWT keys
php bin/console lexik:jwt:generate-keypair
  1. Database Setup
# Create database
php bin/console doctrine:database:create

# Run migrations
php bin/console doctrine:migrations:migrate

# Load initial data (for development)
php bin/console doctrine:fixtures:load

Development Server

Start the Symfony development server:

symfony serve

The API will be available at http://localhost:8000

Development Tools

Symfony CLI Tools

# Create new controller
php bin/console make:controller

# Create new entity
php bin/console make:entity

# Create new migration
php bin/console make:migration

Code Quality Tools

# Run PHP CS Fixer
composer cs-fix

# Run PHPStan
composer analyse

# Run tests
composer test

Next Steps