PHPackages                             phdomiciano/phcodemvc - 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. phdomiciano/phcodemvc

ActiveProject[Framework](/categories/framework)

phdomiciano/phcodemvc
=====================

This is a simple CRUD of courses list with MVC but without Frameworks.

v1.0.0(3y ago)04MITPHP

Since Aug 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/phdomiciano/phcodemvc)[ Packagist](https://packagist.org/packages/phdomiciano/phcodemvc)[ RSS](/packages/phdomiciano-phcodemvc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

About this project
------------------

[](#about-this-project)

This is a simple CRUD of courses list with MVC but without Frameworks. The challenge is not to use external frameworks but to develop an entire MVC structure following good practices and concepts.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Composer

This code uses
--------------

[](#this-code-uses)

- PSR-4: Autoloading (Composer)
- DOCTRINE/ORM
- SQLITE

Installation
------------

[](#installation)

Install the package through [Composer](http://getcomposer.org/).

Run the Composer require command from the Terminal:

```
composer create-project phdomiciano/phcodemvc

```

If necessary update your requiries, run on Terminal:

```
composer update

composer dump-autoload

```

Create the sqlite database and all tables required, run on terminal:

```
php db.php migrate

```

Run on Terminal your php server and access the url from project in a web browser.

```
php -S localhost:8080

```

Applied solutions
-----------------

[](#applied-solutions)

- Requests Forms Validation
- Dependency Injection
- Polymorphism
- Anonymous classes

Developed solutions
-------------------

[](#developed-solutions)

#### Migration

[](#migration)

To be used in a development environment, a script was created that can be executed by Terminal, for small instructions to the database, such as creating the database, executing migrations, consulting records and tables, among others. For try and more information, run on Terminal:

```
php db.php help

```

For new migrations, a structure similar to other Frameworks was created, just create a new file in the "database/migrate" folder

#### Index

[](#index)

The index.php file is the application's Core, responsible for filtering, forwarding the routes and executing the first validations.

#### Routes

[](#routes)

To create a new route, simply add it to the "config/routes.php" file. Intuitively, following in a simplified way the pattern of the main existing Frameworks.

The Route class, located in the "src/infra" folder, is responsible for identifying and filtering the route information, according to the "routes.php" list.

#### Request

[](#request)

The parent Request class, located in "src/requests", manages http requests, facilitates data handling and sanitizes all input data automatically regardless of the submitted method. This class can be used for manual or automatic validation of form data through the "validate()" method.

The "validate()" method can receive an array of filters manually or capture the validation rules automatically from the child classes of Request.

The custom Request class can be configured in the "routes.php" file. If no custom Request is provided for the route, the system automatically loads the parent class, allowing manual validations.

#### Controller

[](#controller)

The Controller parent class already has an entityManager and an object of the Request class.

#### Auth

[](#auth)

The Auth class, located in the "src/infra" folder, can be used anywhere on the system. It handles and stores user authentication information, record ownership validation, and CSRF token management.

#### View

[](#view)

The View class, located in the "src/infra" folder, must be used in controllers to display views. This class is responsible for finding view files, managing alerts and errors with automatic capture. Alerts and errors are treated like flash messages, being automatically deleted after the first read.

#### CSRF protection

[](#csrf-protection)

This code is concerned with CSRF (Cross-site request forgery). The Auth class manages random tokens that change with each submit and all forms must contain a hidden one with this token, which is automatically compared by the Request class every time some data is requested. Form submits don't work if the form doesn't have this hidden with valid token. Hidden can be easily created in any view, as the View class loads an Auth object with a method that generates a hidden. Just print this inside each form:

```

```

#### ORM by Attributes

[](#orm-by-attributes)

Doctrine was used as ORM, configured with mapping by Attributes instead of Annotations, in a more visual way and without having to use comments as code.

#### PSRs and best practices

[](#psrs-and-best-practices)

This code meets PSRs, following some of the established standards like PSR-4, PSR-1 and PSR-12. Code identification, clean code, code structure, typing variables and function parameters, as well as defining return types.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1361d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/776fd8833769fd6b54a8cd3c50bae5c74877b86c0ece1156fcb5c1fd006ce5e6?d=identicon)[phdomiciano](/maintainers/phdomiciano)

---

Top Contributors

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

---

Tags

frameworkmvccrudcoursescourseslist

### Embed Badge

![Health badge](/badges/phdomiciano-phcodemvc/health.svg)

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

###  Alternatives

[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[letsdrink/ouzo

Ouzo PHP MVC framework

7210.5k1](/packages/letsdrink-ouzo)[openpsa/midcom

Content-oriented Model-View-Controller framework for PHP

293.2k1](/packages/openpsa-midcom)

PHPackages © 2026

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