platform/doc/project_map.md
2024-11-25 20:33:45 -07:00

4.4 KiB

Platform Project Map

Package Structure

Core Packages

packages/
  illuminate/          # Laravel-compatible implementations
    container/        # ✓ Complete
    support/         # In Progress
    http/           # Planned
    routing/        # Planned
    ...

  contracts/         # ✓ Complete
    lib/src/
      container/    # Container contracts
      events/      # Event dispatcher contracts
      http/        # HTTP contracts
      pipeline/    # Pipeline contracts
      queue/       # Queue contracts
      ...

  core/             # Core functionality
    lib/src/
      core/        # Core components
      http/        # HTTP implementation
      http2/       # HTTP/2 support

Infrastructure Packages

packages/
  bus/              # Command/Event bus
  events/           # Event system
  model/            # Data models
  pipeline/         # Pipeline processing
  process/          # Process management
  queue/            # Queue system
  route/            # Routing system
  support/          # Support utilities
  testing/          # Testing utilities

Package Dependencies

graph TD
    A[contracts] --> B[container]
    A --> C[events]
    A --> D[pipeline]
    A --> E[queue]
    A --> F[http]
    B --> G[core]
    C --> G
    D --> G
    E --> G

Implementation Status

Core Framework

  1. Container Package ✓

    • Basic container
    • Service providers
    • Auto-wiring
    • Contextual binding
    • Method injection
  2. Contracts Package ✓

    • Container contracts
    • Event contracts
    • HTTP contracts
    • Pipeline contracts
    • Queue contracts
  3. Core Package

    • Base application
    • HTTP kernel
    • Service providers
    • Configuration
    • Environment handling

Infrastructure

  1. Events Package

    • Event dispatcher
    • Event subscribers
    • Event broadcasting
    • Queued events
  2. Pipeline Package

    • Pipeline processing
    • Middleware support
    • Pipeline stages
    • Error handling
  3. Queue Package

    • Queue manager
    • Job dispatching
    • Failed jobs
    • Job batching
  4. Route Package

    • Route registration
    • Route matching
    • Route groups
    • Route caching

Laravel API Compatibility

Implemented

  1. Container API

    // Laravel: app()->bind()
    container.bind<Service>((c) => ServiceImpl());
    
    // Laravel: app()->singleton()
    container.singleton<Cache>((c) => RedisCache());
    
  2. Events API

    // Laravel: Event::dispatch()
    events.dispatch(UserCreated(user));
    
    // Laravel: Event::listen()
    events.listen<UserCreated>((event) => ...);
    

In Progress

  1. Support Package

    // Laravel: Str::slug()
    Str.slug('Laravel Framework');
    
    // Laravel: collect()
    Collection.collect(['a', 'b']);
    
  2. HTTP Package

    // Laravel: Request::input()
    request.input('name');
    
    // Laravel: Response::json()
    response.json({'status': 'success'});
    

Next Steps

  1. Support Package

    • String helpers
    • Array helpers
    • Collections
    • Fluent interface
  2. HTTP Package

    • Request handling
    • Response building
    • Middleware system
    • Session management
  3. Database Package

    • Query builder
    • Schema builder
    • Migrations
    • Model system

Development Workflow

  1. Package Development

    # Create new package
    dart create packages/illuminate/[package]
    
    # Set up package
    cd packages/illuminate/[package]
    dart pub get
    
  2. Testing

    # Run tests
    dart test
    
    # Check coverage
    dart test --coverage
    
  3. Documentation

    # Generate docs
    dart doc .
    
    # Serve docs
    dhttpd --path doc/api
    

Resources

  1. Documentation

  2. Specifications

  3. Analysis