Code Monkey home page Code Monkey logo

mithril-slim-skeleton's Introduction

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. The application itself offers a frontend and backend, that allows you to view and manage some specific CRM data.

Demo

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

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

  • Database Migrations using Phinx
  • SQLite database (for the sake of simplicity)
  • Migration scripts
  • Seed scripts using Faker

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
sh setup.sh

Development

Start development environment

sh start.sh

Or start backend and frontend manually, see README files in own repos.

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.

mithril-slim-skeleton's People

Contributors

tbreuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dvgol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.