Skip to content

Noesis is an MVP (Model View Presenter) framework for creating Single Page Applications without the need for front-end routing. Built on SlimPHP, React, TailwindCSS and InertiaJS

Notifications You must be signed in to change notification settings

noesis-framework/noesis

Repository files navigation

Noesis Framework (Slim, InertiaJS, React, TailwindCSS)

InteriaJS, React (v18) and TailwindCSS with a Slim Framework (v4) backend and normal PHP views based on Slim/PHP-View

Origins

Started as a fork of the amazing work of cherifGsoul/slim-inertiajs-demo, which uses Symfony Encore and Svelte. This project however does not use Encore and replaces Svelte with React.

Since then however, I have completely rewritten it and organised it into src (noesis-framework), server (php), client (js and react) folders and public (web root, css, js, images etc)

In server, the structure resembles Laravel, and I plan to enable many of the core feature of Laravel

The aim of this project will be to allow developers to have everything for a full featured MVC at their finger tips, but only enable the parts you actually need.

Installation

Clone

NOTE:
composer create-project noesis-framework will be available once the framework is mature in v1.0 For now, cloning is the only method to install

git clone https://github.com/lukewatts/noesis-framework.git

Install Composer packages

composer install

Install NPM packages:

yarn install

Frontend Development

yarn watch
# or yarn dev

Build JS for production

yarn build

Run PHP server

php -S localhost:80 -t public

# or start noe server
php noe serve

Console

Noesis has console commands (like most other frameworks) called 'noe' (pronounced 'know')

php noe list

List all available command

php noe help

Show help documentation for Noesis console

php noe pest

Run all Pest tests

php noe pest:init

Initialize all pest files. Run this to setup tests folder in a new project

php noe pest:cover

Run all Pest tests with code coverage. Requires XDEBUG with env variable XDEBUG_MODE=coverage

php noe create:presenter {presenter_name}

Generates a boilerplate Presenter class in server/app/Presenter

Example:

php noesis create:presenter Test will generate TestPresenter in server/app/Presenter which have the following boilerplate code:

<?php

declare(strict_types=1);

namespace App\Presenter;

use Psr\Http\Message\ResponseInterface;

/**
 * Test Presenter
 */
class TestPresenter extends \Noesis\Presenter\Presenter
{
    public function index($request, $response): ResponseInterface
    {
        return inertia($request)->render('Index', ['var' => 'I can be used in JSX!']);
    }
}

php noe create:provider {provider_name}

Generates a boilerplate Provider class in server/app/Providers

php noe create:react-page {page_name}

Generates boilerplate React page in client/js/Pages

php noe create:react-component {component_name}

Generates boilerplate React component in client/js/Components

php noe inspect

REPL for inspecting and debugging Noesis code directly in the terminal during development (like Laravel's php artisan tinker)

About

Noesis is an MVP (Model View Presenter) framework for creating Single Page Applications without the need for front-end routing. Built on SlimPHP, React, TailwindCSS and InertiaJS

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages