Development

Commands, project structure, and deployment workflow for developing and shipping Omega AI.

Development Commands

Setup & Dependencies

composer install

Development Servers

npm run dev

Build & Assets

npm run build

Database

php artisan migrate

Testing

php artisan test --compact

Code Quality

vendor/bin/pint --dirty

Utilities

php artisan health:check

Project Structure

Application Core

  • Name
    app/Models/
    Type
    directory
    Description

    Eloquent models: User, AiAssistant, AiConversation, AiMessage, ApiKey, KnowledgeBase, Product, Email.

  • Name
    app/Http/Controllers/
    Type
    directory
    Description

    HTTP controllers: LandingPageController, SubscriptionController, ChatController, MockAiController.

  • Name
    app/Http/Middleware/
    Type
    directory
    Description

    Custom middleware: CheckMessageLimit, Subscribed, Customer, CheckFeature.

  • Name
    app/Services/
    Type
    directory
    Description

    Business logic services: AiChatService, SubscriptionFeatureService.

  • Name
    app/Enums/
    Type
    directory
    Description

    PHP enums: PlanFeature (feature definitions), PlanFeatureLimits (tier limits), ProductCategory.

  • Name
    app/Traits/
    Type
    directory
    Description

    Reusable traits: HasFeatureAccess, HasSubscriptionAttributes, ImplementSubscriptionFunctions.

UI & Frontend

  • Name
    app/Livewire/
    Type
    directory
    Description

    Livewire components: DashboardChat.

  • Name
    app/Filament/Resources/
    Type
    directory
    Description

    Filament admin resources: AiAssistants, ApiKeys, KnowledgeBases, Products, Users, Roles, Activities, Emails.

  • Name
    app/Filament/Pages/
    Type
    directory
    Description

    Filament pages: Dashboard, BillingInformation, HealthCheckResults, ViewLog, WidgetInstructions.

  • Name
    resources/views/
    Type
    directory
    Description

    Blade views: landing page, Livewire components, Filament page views, reusable components.

  • Name
    resources/css/
    Type
    directory
    Description

    Tailwind CSS 4 stylesheets.

  • Name
    resources/js/
    Type
    directory
    Description

    JavaScript modules bundled with Vite.

MCP & Providers

  • Name
    app/Mcp/
    Type
    directory
    Description

    Model Context Protocol: LocalServer, RulesResource, KnowledgeResource.

  • Name
    app/Providers/
    Type
    directory
    Description

    Service providers including Filament AppPanelProvider.

Routes & Config

  • Name
    routes/web.php
    Type
    file
    Description

    Web routes: landing page, subscription purchase flows, billing portal.

  • Name
    routes/api.php
    Type
    file
    Description

    API routes: chat completions, assistant info, conversation history.

  • Name
    routes/ai.php
    Type
    file
    Description

    MCP server route registration.

  • Name
    config/ai.php
    Type
    file
    Description

    AI service configuration: endpoint URL, timeout, default model.

  • Name
    config/cashier.php
    Type
    file
    Description

    Stripe/Cashier billing configuration.

Database & Tests

  • Name
    database/migrations/
    Type
    directory
    Description

    Database schema migrations for all tables.

  • Name
    database/factories/
    Type
    directory
    Description

    Model factories for testing: User, AiAssistant, AiConversation, AiMessage, ApiKey, KnowledgeBase, Product, Email.

  • Name
    tests/Feature/
    Type
    directory
    Description

    Pest feature tests.

  • Name
    tests/Unit/
    Type
    directory
    Description

    Pest unit tests.

  • Name
    tests/Browser/
    Type
    directory
    Description

    Pest browser tests (Pest 4).

Deployment

Prerequisites

Ensure the production server meets requirements: PHP >= 8.2, MySQL 8.0+, Node.js >= 18, Composer 2.

Environment Configuration

Configure environment variables in .env on the production server:

  • Set APP_ENV=production and APP_DEBUG=false
  • Configure production database credentials
  • Set Stripe live keys (replace test keys)
  • Configure AI endpoint URL
  • Set SENTRY_LARAVEL_DSN for error tracking
  • Configure DEPLOY_USER, DEPLOY_HOST, DEPLOY_REPOSITORY, DEPLOY_APP_DIR, and DEPLOY_BRANCH for Envoy deployments

Automated Deployment via Envoy

vendor/bin/envoy run deploy

Manual Deployment

If not using Envoy, deploy manually with the following steps:

git pull origin main
composer install --no-dev --optimize-autoloader
npm ci && npm run build
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache
php artisan storage:link

Post-Deployment

After deploying, complete these final steps:

  1. Start the queue worker: php artisan horizon (or configure Supervisor for process management)
  2. Register the Stripe webhook URL pointing to /stripe/webhook
  3. Set up a cron job for the Laravel scheduler:
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
  1. Configure automated backups via Spatie Backup (runs on schedule)
  2. Verify deployment by running health checks: php artisan health:check
  3. Monitor errors via the Sentry dashboard and queue status via the Laravel Horizon dashboard at /horizon

Was this page helpful?