PHPackages                             conecta/framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. conecta/framework

ActiveProject[Framework](/categories/framework)

conecta/framework
=================

ConectaFramework - PHP MVC Framework with RBAC, Agents System

03PHPCI failing

Since Apr 15Pushed 1mo agoCompare

[ Source](https://github.com/hernestodf/ConectaFramework)[ Packagist](https://packagist.org/packages/conecta/framework)[ RSS](/packages/conecta-framework/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

ConectaFramework 🎯
==================

[](#conectaframework-)

> Framework PHP MVC enterprise zero-dependências para projetos rápidos.

[![PHP](https://camo.githubusercontent.com/042d075f20e34e43f9d51e610fcc053009c49956824dc986e72c80f451dd41a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3737374242343f7374796c653d666c6174266c6f676f3d706870)](https://packagist.org/packages/conecta/framework)[![License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Packagist](https://camo.githubusercontent.com/8bf0cbcabbfaf9ade1c4b6434d0b04dcead32c4ad8db4a18f30237c8ee40d7d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d636f6e656374612f6672616d65776f726b2d626c75652e737667)](https://packagist.org/packages/conecta/framework)

Por que usar o ConectaFramework?
--------------------------------

[](#por-que-usar-o-conectaframework)

- ✅ **Zero dependências** - Semvendor hell, PHP puro
- ✅ **PHP 8.2+** - Sem warningsdeprecated
- ✅ **MVC completo** - Router, Controller, Service, Repository
- ✅ **RBAC nativo** - guest, user, manager, admin
- ✅ **Temas dinamicos** - 5 temas prontos
- ✅ **CSRF Protection** - Segurança integrada
- ✅ **Deploy simples** - FTP ou Git

Instalação
----------

[](#instalação)

```
# Criar novo projeto
composer create-project conecta/framework meu-projeto

# Entrar no projeto
cd meu-projeto

# Copiar .env
cp .env.example .env

# Configurar banco no .env
# APP_ENV=local
# DB_LOCAL_HOST=localhost
# DB_LOCAL_NAME=meu_banco
# DB_LOCAL_USER=root
# DB_LOCAL_PASS=sua_senha

# Servir
php -S localhost:8080 -t public
```

Acesse:

Quick Start
-----------

[](#quick-start)

### Criar módulo completo (ex: produtos)

[](#criar-módulo-completo-ex-produtos)

**1. Tabela MySQL:**

```
CREATE TABLE products (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    price DECIMAL(10,2) DEFAULT 0,
    status TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```

**2. Route (public/index.php):**

```
$app->router()->group('/products', function($router) {
    $router->get('/', [ProductController::class, 'index']);
    $router->get('/create', [ProductController::class, 'create']);
    $router->post('/store', [ProductController::class, 'store']);
    $router->get('/edit/{id}', [ProductController::class, 'edit']);
    $router->post('/update/{id}', [ProductController::class, 'update']);
    $router->post('/delete/{id}', [ProductController::class, 'delete']);
}, [\App\Http\Middleware\AuthMiddleware::class]);
```

**3. Repository:**

```
class ProductRepository extends BaseRepository
{
    protected string $table = 'products';
    protected array $fillable = ['name', 'price', 'status'];
}
```

**4. Service:**

```
class ProductService extends BaseService
{
    public function create(array $data): int
    {
        $this->validateRequired($data, ['name']);
        return $this->repository->create($this->sanitize($data));
    }
}
```

**5. Controller:**

```
class ProductController extends Controller
{
    public function index(): Response
    {
        return $this->view('product/index', [
            'products' => $this->service->paginate(1, 15)
        ]);
    }
}
```

Estrutura do Projeto
--------------------

[](#estrutura-do-projeto)

```
meu-projeto/
├── public/
│   ├── index.php       # Entry point
│   └── css/styles.css # CSS único (620+ linhas)
├── src/
│   ├── Controllers/   # App\Controllers\*Controller
│   ├── Service/       # App\Service\*Service
│   ├── Repository/    # App\Repository\*Repository
│   ├── Auth/         # Rbac
│   ├── Http/Middleware/ # Middlewares
│   ├── Database/     # Connection (PDO)
│   └── Core/         # Router, Application, etc
├── views/
│   ├── layout/       # header, sidebar, footer
│   └── modulo/      # index, create, edit, show
├── config/app.php   # name, theme, etc
├── storage/logs/    #_logs_
└── .env           # Configurações

```

Temas
-----

[](#temas)

Altere em `config/app.php`:

```
'theme' => [
    'active' => 'blue',  // default | pink | blue | green | dark
]
```

TemaCordefaultCyan #0B6E8CpinkRosa #E11D48blueBlue #1D4ED8greenGreen #059669darkPurple #8B5CF6RBAC (Roles)
------------

[](#rbac-roles)

```
use App\Auth\Rbac;

// Verificar papel
Rbac::hasRole('admin');   // true/false
Rbac::isAdmin();        // true/false

// Verificar permissão
Rbac::check('users');   // apenas admin
```

RolePermissõesguestVisitanteuserBásicomanagerRelatóriosadminTudoAPI Support
-----------

[](#api-support)

O framework suporta WEB e API simultaneamente:

```
// Rotas API
$app->router()->group('/api', function($router) {
    $router->get('/products', [ProductController::class, 'apiIndex']);
    $router->post('/products', [ProductController::class, 'apiStore']);
});

// Retorno JSON automático
return $this->json(['success' => true, 'data' => $products]);
```

Deploy
------

[](#deploy)

### Via Git (recommendado):

[](#via-git-recommendado)

```
git add .
git commit -m "Deploy v1.0"
git push origin main
```

### Via FTP:

[](#via-ftp)

```
python deploy/deploy.py
```

Comandos Úteis
--------------

[](#comandos-úteis)

```
# Testar rota
curl http://localhost:8080/test

# Verificar conexão
php -r "require 'vendor/autoload.php'; print_r(\App\Database\Connection::testConnection());"
```

Stack
-----

[](#stack)

TecnologiaDetalhePHP8.2+MySQLPDOCSSUnificado (1 arquivo)JSInline por viewServerApache/NginxLicença
-------

[](#licença)

MIT License - see [LICENSE](LICENSE) for details.

---

**Desenvolvido com ❤️ por Hernesto Filho**

[GitHub](https://github.com/hernestodf/ConectaFramework) · [Packagist](https://packagist.org/packages/conecta/framework) · [Contato](hernestodf@gmail.com)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance59

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/10abdf2d159bb0c7c33b1a13ca51c8a10bd42870f82682164be40d3b51a66ad5?d=identicon)[hernestodf](/maintainers/hernestodf)

---

Top Contributors

[![hernestodf](https://avatars.githubusercontent.com/u/98930548?v=4)](https://github.com/hernestodf "hernestodf (6 commits)")

### Embed Badge

![Health badge](/badges/conecta-framework/health.svg)

```
[![Health](https://phpackages.com/badges/conecta-framework/health.svg)](https://phpackages.com/packages/conecta-framework)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M822](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[pinguo/php-msf

Pinguo Micro Service Framework For PHP

1.7k4.2k](/packages/pinguo-php-msf)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
