Skip to content

feat: Automatic URL generation for applications #45

@rafaelrsantosti

Description

@rafaelrsantosti

Description

Implement automatic URL generation for application components to prevent conflicts and improve user experience.

Current Behavior

  • Users manually enter the URL for each component
  • URL uniqueness is only validated at database level
  • Confusing error when URL conflicts occur
  • No standard URL pattern

Proposed Solution

Automatic URL Generation

Generate URLs automatically based on:

  • Application name
  • Component name
  • Environment name
  • Organization slug (when #issue_number is implemented)

URL Patterns

Pattern 1: Simple (current)

{component}-{app}-{env}.{domain}
Example: web-myapp-production.example.com

Pattern 2: With Organization

{component}-{app}.{org}.{domain}
Example: web-myapp.acme-corp.example.com

Pattern 3: Environment as subdomain

{component}-{app}.{env}.{domain}
Example: web-myapp.staging.example.com

Features

  1. Auto-generation on creation

    • URL generated automatically if not provided
    • Based on configurable pattern (system setting)
  2. Custom URL override

    • Users can still specify custom URLs
    • Validation ensures uniqueness
    • Clear error messages on conflicts
  3. URL Preview

    • Show generated URL before creation
    • Allow editing before confirming
  4. Domain configuration

    • Configurable base domain per environment
    • Support for wildcard DNS

API Changes

# Settings for URL generation
URL_PATTERN = "{component}-{app}-{env}.{domain}"
DEFAULT_DOMAIN = "apps.example.com"

# Auto-generate if URL not provided
if not component.url:
    component.url = generate_url(
        component=component.name,
        app=application.name,
        env=environment.name,
        org=organization.slug,  # if available
        domain=settings.default_domain
    )

Portal Changes

  • Add URL preview in component creation form
  • Show "Auto-generated" badge when URL is automatic
  • Add "Regenerate URL" button
  • Improve error message for URL conflicts

Benefits

  • Eliminates URL conflicts by design
  • Consistent URL naming across platform
  • Better user experience (less manual input)
  • Predictable URLs for automation/scripts
  • Easier DNS management with wildcard domains

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions