https://github.com/isaka-james/thyrus
A lightweight PHP framework designed for effortless hosting and minimal configuration.
https://github.com/isaka-james/thyrus
framework lightweight-framework php php-framework phpframework thyrus thyrus-framework thyrus-php thyrus-php-framework
Last synced: 8 months ago
JSON representation
A lightweight PHP framework designed for effortless hosting and minimal configuration.
- Host: GitHub
- URL: https://github.com/isaka-james/thyrus
- Owner: isaka-james
- License: mit
- Created: 2024-08-03T15:53:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-10T08:55:00.000Z (about 1 year ago)
- Last Synced: 2025-01-26T16:47:23.193Z (9 months ago)
- Topics: framework, lightweight-framework, php, php-framework, phpframework, thyrus, thyrus-framework, thyrus-php, thyrus-php-framework
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
Thyrus is a lightweight PHP framework designed for ease of use and simplicity in deployment. It supports MVC (Model-View-Controller) architecture and is optimized for environments where you may only have limited directory access, such as free hosting platforms.
**Predecessor:** *MasterPHP (which lacked MVC architecture)*
## Features
- **Easy Hosting:** Designed to run on any PHP server without the need for complex configurations.
- **MVC Architecture:** Supports a clear separation of concerns with Model, View, and Controller.
- **Assets Management:** Includes an `assets` directory for managing static assets like CSS and images.
- **Zero Configuration:** Suitable for environments where only a partial directory is accessible.
## Directory Structure
The framework’s file structure is as follows:
```bash
├── assets
│ └── astra.css
├── astra
│ └── helpers
│ └── helpers.php
├── composer.json
├── composer.lock
├── config
│ └── database.php
├── index.php
├── routes
│ └── web.php
├── src
│ ├── Config
│ │ └── CORS.php
│ ├── Controllers
│ │ ├── Controller.php
│ │ └── TestController.php
│ ├── Database
│ │ └── DatabaseManager.php
│ ├── Models
│ │ └── BaseModel.php
│ └── Views
│ └── index.twig
└── vendor
├── autoload.php
├── composer
│ ├── ClassLoader.php
......
```
## Installation
1. **Download or Clone:**
```
git clone https://github.com/isaka-james/thyrus.git
```
2. **Navigate to the Project Directory:**
```
cd thyrus
```
3. **Install Dependencies:**
Ensure you have [Composer](https://getcomposer.org/) installed. Run:
```
composer install
```
## Configuration
1. **Database Configuration:**
Edit the `config/database.php` file to set up your database connection.
2. **Routing:**
Define your routes in the `routes/web.php` file.
## Usage
1. **Create a Controller:**
Extend the base controller class located at `src/Controllers/Controller.php`.
```php
namespace App\Controllers;
use App\Controller;
class MyController extends Controller
{
public function index()
{
return $this->render('index.twig', ['data' => 'Hello World']);
}
}
```
2. **Create a Model:**
Extend the base model class located at `src/Models/BaseModel.php`.
```php
namespace App\Models;
use App\Model;
class MyModel extends BaseModel
{
// Model methods
}
```
3. **Create a View:**
Place your Twig templates in the `src/Views` directory.
```twig
{# src/Views/index.twig #}
{{ data }}
```
## License
Thyrus is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.