SPA Skeleton with Mithril.js and Slim Framework

Overview

SPA Skeleton with Mithril.js and Slim Framework

This is a single-page application (SPA) skeleton based on Mithril.js and Slim Framework 4 trying to use good practices.

Demo

https://mithril-slim-skeleton.tebe.ch/

Requirements

  • PHP >= 8.0
  • Composer >= 2.0
  • Node >= 17.0
  • NPM >= 8.0

Installation

git clone https://github.com/tbreuss/mithril-slim-skeleton
cd mithril-slim-skeleton
npm install --prefix frontend
composer install --working-dir backend

Features

JS frontend

  • Single page application (SPA) using Mithril.js
  • Mitosis pattern for simple state management
  • Types without TypeScript using JSDoc
  • Frontend Tooling with vite.js
  • Minimal CSS with Pico.css
  • ESLint JavaScript Linter
  • Testing

PHP backend

  • REST API using Slim Framework 4
  • Autoloading (PSR-4)
  • Code styles (PSR-12)
  • Dependency injection container (PSR-11)
  • HTTP message interfaces (PSR-7)
  • HTTP Server Request Handlers and Middleware (PSR-15)
  • HTTP factories (PSR-17)
  • HTTP router and dispatcher (Slim)
  • Logging (PSR-3)
  • PHPDoc standard (PSR-5, PSR-19)
  • PHPStan (Level: max)
  • Single action controllers
  • Domain Driven Design (DDD) partially
  • JWT for (synchronous) authentication
  • Unit Tests
  • Integration Tests

Database

  • SQLite database
  • Migration scripts
  • Seed scripts

Development

Start development environment

sh start.sh

Or start backend and frontend manually

Backend

ENVIRONMENT=development php -d variables_order=EGPCS -S localhost:7000 -t backend/public

Frontend

npm run dev --prefix frontend

Scripts

Frontend

Command Description
eslint:check eslint . --ext .js
eslint:fix eslint . --ext .js --fix
ts:check tsc --project jsconfig.json
ts:check:watch tsc --watch --project jsconfig.json

Backend

Command Description
cs:check Runs the cs:check script as defined in composer.json.
cs:fix Runs the cs:fix script as defined in composer.json.
lint:check Runs the lint:check script as defined in composer.json.
sniffer:check Runs the sniffer:check script as defined in composer.json.
sniffer:fix Runs the sniffer:fix script as defined in composer.json.
stan:check Runs the stan:check script as defined in composer.json.

Links

Toolset used

Helpful websites, articles, and blog posts

Contributing

Please create an issue before sending a pull reqest.

License

The MIT License (MIT). Please see License File for more information.

You might also like...
A Laravel 9, Vite, Svelte SPA, Tailwind CSS (w/ Forms Plugin & Aspect Ratio Plugin), Axios & TypeScript starter template.

Laravel 9 + Vite + Svelte + Tailwind CSS This starter template includes: Laravel 9 Vite Svelte Tailwind CSS (w/ @tailwindcss/forms and @tailwindcss/as

This repository is pre-configured, clean and empty skeleton for creating a new projects using Kraken Framework.

Kraken Application Skeleton Note: This repository contains pre-configured application skeleton for fast creation of new projects with Kraken Framework

A skeleton application using the Zend Framework MVC

This is a skeleton application using the Zend Framework MVC layer and module systems. This application is meant to be used as a starting place for those looking to get their feet wet with Zend Framework.

Boilerplate for Slim Framework 3

Boilerplate for Slim Framework 3 Boilerplate for getting started with Slim Framework Use this skeleton application to quickly setup and start working

CodeIgniter 4-based application skeleton

Bonfire 2 Just getting started. More details at Patreon What is Bonfire? Bonfire will be a robust application skeleton for CodeIgniter 4-based applica

A skeleton for creating applications with CakePHP 4.x.

CakePHP Application Skeleton A skeleton for creating applications with CakePHP 4.x. The framework source code can be found here: cakephp/cakephp. Inst

A skeleton for build your Kata with Docker

A skeleton for build your Kata with Docker

Project skeleton generator for Laravel & Lumen projects
Project skeleton generator for Laravel & Lumen projects

Skeletor Skeletor is a PHP based CLI tool that has been built to take away the pain of setting up a base project skeleton for Laravel & Lumen projects

A skeleton WordPress project to be used as a base for new WordPress projects.
A skeleton WordPress project to be used as a base for new WordPress projects.

BoxUK WordPress Project Skeleton A base WordPress project from Box UK to get you up and running quickly. Installation Create a new project with compos

Releases(0.4.0)
Owner
tebe
Old School Developer with a Modern Touch
tebe
Slim Framework 4 Skeleton Application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

Cleonildo Soares Guimaraes Junior 5 Nov 21, 2021
Simple skeleton for the PHP Slim framework

Simple skeleton for the PHP Slim framework

Andrew S Erwin 2 Nov 13, 2021
This is a skeleton to quickly set up a new Slim 4 application.

Slim 4 Skeleton This is a skeleton to quickly set up a new Slim 4 application. Requirements PHP 7.4+ or 8.0+ MySQL 5.7+ or MariaDB Recommended Apache

Daniel Opitz 376 Jan 2, 2023
This is Slim 3 API skeleton project for Composer

Slim 3 API skeleton This is Slim 3 API skeleton project for Composer. Project uses Zend Table Gateway and Phinx for database operations, Monolog for l

Mika Tuupola 304 Dec 28, 2022
A Laravel 8 and Vue 3 SPA boilerplate using tailwind styling and sanctum for authentication :ghost:

Laravel Vue Sanctum SPA Laravel and vue spa using tailwind (laravel/ui looks) for styling and sanctum for authentification Features Laravel 8 Vue + Vu

Hijen EL Khalifi 62 Dec 5, 2022
A simple and clean boilerplate to start a new SPA project with authentication and more features from fortify

A simple and clean boilerplate to start a new SPA project with authentication and more features from fortify. Its like the little sister of Jetstream, but as SPA.

Tobias Schulz 11 Dec 30, 2022
:elephant: A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.

Laravel Vue Boilerplate A Laravel 6 Single Page Application boilerplate using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass and Pug with: A users

Alefe Souza 533 Jan 3, 2023
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
A Laravel-Vue SPA starter kit.

Laravel-Vue SPA A Laravel-Vue SPA starter kit. Features Laravel 8 Vue + VueRouter + Vuex + VueI18n + ESlint Pages with dynamic import and custom layou

Cretu Eusebiu 3k Jan 6, 2023