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.
https://mithril-slim-skeleton.tebe.ch/
- 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
- 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 Migrations using Phinx
- SQLite database (for the sake of simplicity)
- Migration scripts
- Seed scripts using Faker
- PHP >= 8.0
- Composer >= 2.0
- Node >= 17.0
- NPM >= 8.0
git clone https://github.com/tbreuss/mithril-slim-skeleton
cd mithril-slim-skeleton
sh setup.sh
Start development environment
sh start.sh
Or start backend and frontend manually, see README files in own repos.
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. |
Toolset used
- https://mithril.js.org
- https://vitejs.dev
- https://picocss.com
- https://www.slimframework.com
- https://eslint.org
- https://jsdoc.app
- https://www.sqlite.org
- https://phinx.org
- https://fakerphp.github.io
Helpful websites, articles, and blog posts
- https://restfulapi.net/http-methods/
- https://dev.to/t7yang/type-safety-in-javascript-with-jsdoc-and-vscode-1a28
- https://depth-first.com/articles/2021/10/20/types-without-typescript/
- https://odan.github.io/slim4-skeleton/
- https://github.com/slimphp/Slim-Skeleton
Please create an issue before sending a pull reqest.
The MIT License (MIT). Please see License File for more information.