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

142 lines
4.5 KiB
Markdown

# Getting Started Guide
## Overview
This guide helps developers get started with implementing and contributing to the framework's foundation packages. It provides step-by-step instructions for setting up the development environment, understanding the codebase, and making contributions.
## Key Documentation
Before starting, familiarize yourself with our core documentation:
1. **Architecture & Implementation**
- [Laravel Compatibility Roadmap](laravel_compatibility_roadmap.md) - Overall implementation status and plans
- [Foundation Integration Guide](foundation_integration_guide.md) - How packages work together
- [Testing Guide](testing_guide.md) - Testing approaches and standards
2. **Package Documentation**
- [Container Package](container_package_specification.md) - Dependency injection system
- [Container Gap Analysis](container_gap_analysis.md) - Implementation status and plans
- More package docs coming soon...
3. **Development Setup**
- [Melos Configuration](melos_config.md) - Build and development tools
[Previous content remains the same until Project Structure section, then update with:]
## Project Structure
### 1. Package Organization
```
platform/
├── packages/
│ ├── container/ # Dependency injection
│ │ ├── container/ # Core container
│ │ └── container_generator/ # Code generation
│ ├── core/ # Framework core
│ ├── events/ # Event system
│ ├── model/ # Model system
│ ├── pipeline/ # Pipeline pattern
│ ├── process/ # Process management
│ ├── queue/ # Queue system
│ ├── route/ # Routing system
│ ├── support/ # Utilities
│ └── testing/ # Testing utilities
├── apps/ # Example applications
├── config/ # Configuration files
├── docs/ # Documentation
├── examples/ # Usage examples
├── resources/ # Additional resources
├── scripts/ # Development scripts
├── templates/ # Project templates
└── tests/ # Integration tests
```
### 2. Package Structure
```
package/
├── lib/
│ ├── src/
│ │ ├── core/ # Core implementation
│ │ ├── contracts/ # Package interfaces
│ │ └── support/ # Package utilities
│ └── package.dart # Public API
├── test/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── performance/ # Performance tests
├── example/ # Usage examples
└── README.md # Package documentation
```
[Previous content remains the same until Implementation Guidelines section, then update with:]
## Implementation Guidelines
### 1. Laravel Compatibility
```dart
// Follow Laravel patterns where possible
class ServiceProvider {
void register() {
// Register services like Laravel
container.singleton<Service>((c) => ServiceImpl());
// Use contextual binding
container.when(PhotoController)
.needs<Storage>()
.give(LocalStorage());
// Use tagged bindings
container.tag([
EmailNotifier,
SmsNotifier
], 'notifications');
}
}
```
### 2. Testing Approach
```dart
// Follow Laravel testing patterns
void main() {
group('Feature Tests', () {
late TestCase test;
setUp(() {
test = await TestCase.make();
});
test('user can register', () async {
await test
.post('/register', {
'name': 'John Doe',
'email': 'john@example.com',
'password': 'password'
})
.assertStatus(302)
.assertRedirect('/home');
});
});
}
```
[Previous content remains the same until Getting Help section, then update with:]
## Getting Help
1. **Documentation**
- Start with [Laravel Compatibility Roadmap](laravel_compatibility_roadmap.md)
- Review [Foundation Integration Guide](foundation_integration_guide.md)
- Check [Testing Guide](testing_guide.md)
- Read package-specific documentation
2. **Development Setup**
- Follow [Melos Configuration](melos_config.md)
- Setup development environment
- Run example applications
3. **Resources**
- [Laravel Documentation](https://laravel.com/docs)
- [Dart Documentation](https://dart.dev/guides)
- [Package Layout](https://dart.dev/tools/pub/package-layout)
[Rest of the file remains the same]