update: updating readme and correcting code in application.dart add cody
This commit is contained in:
parent
9705b49bea
commit
72bfd6a4f0
3 changed files with 116 additions and 15 deletions
10
.vscode/cody.json
vendored
Normal file
10
.vscode/cody.json
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"port": {
|
||||||
|
"prompt": "Act as a Senior Developer who is a master in PHP and Dart langauges. Port the PHP file to Dart.",
|
||||||
|
"context": {
|
||||||
|
"selection": false,
|
||||||
|
"currentFile": true
|
||||||
|
},
|
||||||
|
"mode": "ask"
|
||||||
|
}
|
||||||
|
}
|
93
README.md
93
README.md
|
@ -1 +1,92 @@
|
||||||
# framework
|
# Fabric Framework
|
||||||
|
|
||||||
|
Welcome to the Fabric Framework, a comprehensive port of Laravel's Illuminate components to Dart. Fabric aims to provide a robust, scalable, and feature-rich framework for building modern web applications using Dart.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Fabric is designed to mirror Laravel's Illuminate components, ensuring a familiar structure for developers accustomed to Laravel while leveraging Dart's modern language features. The framework consists of various packages that collectively offer a complete solution for web development.
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
|
||||||
|
1. **Maintain Laravel's Structure:** Keep the directory and component structure identical to Laravel, but adhere to Dart best practices.
|
||||||
|
2. **Ensure Modularity:** Port each Illuminate component as a separate Dart package for modular usage.
|
||||||
|
3. **Enable Rapid Development:** Provide a running base application quickly to facilitate real-time testing and development.
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
- **Modular Packages:** Each Illuminate component is available as a standalone Dart package.
|
||||||
|
- **Comprehensive Routing:** Powerful routing capabilities inspired by Laravel.
|
||||||
|
- **Dependency Injection:** Built-in support for dependency injection to promote loose coupling.
|
||||||
|
- **Middleware Support:** Use middleware for filtering HTTP requests entering your application.
|
||||||
|
- **Authentication & Authorization:** Robust tools for user authentication and authorization.
|
||||||
|
- **Database Abstraction:** Database-agnostic query builder and ORM.
|
||||||
|
- **Queueing System:** Manage background tasks and queues.
|
||||||
|
- **Event Broadcasting:** Real-time event broadcasting for modern applications.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Dart 3.0 or higher
|
||||||
|
- A basic understanding of Dart and Laravel
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
1. **Clone the Repository:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/yourusername/fabric-framework.git
|
||||||
|
cd fabric-framework
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install Dependencies:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dart pub get
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Fabric is structured to be as familiar as possible to Laravel developers. Here’s a quick example of setting up a simple application:
|
||||||
|
|
||||||
|
1. **Create a New Dart File:**
|
||||||
|
|
||||||
|
```dart
|
||||||
|
import 'package:fabric/fabric.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
final app = Application();
|
||||||
|
|
||||||
|
app.get('/', (Request req) {
|
||||||
|
return Response.ok('Hello, World!');
|
||||||
|
});
|
||||||
|
|
||||||
|
app.run();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Run the Application:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dart run
|
||||||
|
```
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
Comprehensive documentation is available to help you get started with Fabric. Visit [Fabric Documentation](https://yourdocumentationlink.com) for detailed guides, tutorials, and API references.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome contributions from the community. If you’re interested in contributing, please read our [Contributing Guide](CONTRIBUTING.md) for information on how to get started.
|
||||||
|
|
||||||
|
### Reporting Issues
|
||||||
|
|
||||||
|
If you encounter any issues or bugs, please report them on our [Issue Tracker](https://github.com/yourusername/fabric-framework/issues).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Fabric is open-source software licensed under the [MIT license](LICENSE).
|
||||||
|
|
||||||
|
## Acknowledgements
|
||||||
|
|
||||||
|
Fabric is inspired by Laravel, and we extend our gratitude to the Laravel community for their continuous efforts in building and maintaining an excellent PHP framework.
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
// TODO: Find dart replacements for missing imports.
|
import 'package:symfony_console/symfony_console.dart';
|
||||||
class ConsoleApplication implements Application {
|
|
||||||
String _lastOutput = '';
|
|
||||||
|
|
||||||
@override
|
abstract class Application {
|
||||||
int call(String command, {List<String> parameters = const [], OutputInterface? outputBuffer}) {
|
/// Run an Artisan console command by name.
|
||||||
// Implementation of the command execution
|
///
|
||||||
// Set _lastOutput with the command output for demonstration
|
/// [command] is the name of the command to run.
|
||||||
_lastOutput = 'Command executed: $command';
|
/// [parameters] is the list of parameters to pass to the command.
|
||||||
return 0; // Return appropriate exit code
|
/// [outputBuffer] is the buffer to capture the command output.
|
||||||
}
|
///
|
||||||
|
/// Returns the exit code of the command.
|
||||||
|
int call(String command, {List<String> parameters = const [], OutputInterface? outputBuffer});
|
||||||
|
|
||||||
@override
|
/// Get the output from the last command.
|
||||||
String output() {
|
///
|
||||||
return _lastOutput;
|
/// Returns the output as a string.
|
||||||
}
|
String output();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue