samuelgfeller/slim-example-project

Example project with the slim micro-framework

Fund package maintenance!
Ko Fi

Installs: 78

Dependents: 0

Suggesters: 0

Security: 0

Stars: 29

Watchers: 6

Forks: 2

Open Issues: 1

Type:project

0.4.0 2023-07-12 16:42 UTC

This package is auto-updated.

Last update: 2024-03-28 16:10:09 UTC


README

Latest Version on Packagist Coverage Quality Gate Status Maintainability Rating Lines of Code

This project aims to be a real-world example of a modern Slim 4 web application with a scalable structure and a range of practical components and features.

It showcases the implementation of a simple yet robust architecture with a variety of backend and frontend features built using the Slim 4 micro-framework. The base for this project was the official Slim-Skeleton.

This repository can serve as a learning example or be adapted for developing new applications.

External library dependencies are kept to a minimum to facilitate maintenance and ensure long-term viability.

Current best practices and modern principles are applied throughout the project. Extra care was taken to follow the Single Responsibility Principle (SRP).

A detailed documentation explains the project structure, components, design choices and features.

Please read the installation guide to get started.

Features

All the features were developed with an effort to ensure maximum user-friendliness. The frontend should be intuitive, aesthetically pleasing, minimalistic, and functional. The backend should be efficient and secure.

This project is currently designed for non-profit organizations or foundations that require a platform to manage and maintain a record of communication through notes of people they assist.

Project components:

Functionalities demonstrating real-world features:

  • User management for administrators
  • 4 user roles and different permissions
  • User activity history
  • Client creation and mutation with status and attributed user
  • Client list filtering by text input and filter chips
  • Note creation and mutation
  • Hidden notes from unauthorized users
  • Dashboard with panels
Click to see demo

Link: Login
Usernames: admin@user.com | managing-advisor@user.com | advisor@user.com | newcomer@user.com
Password: 12345678
The database is reset every hour.

Motivation to create this project

There is a ton of great content on the internet about learning how to write clean and sustainable code. However, I found myself searching for more than just skeleton projects or general documentations and tutorials when I wanted to learn how to do things within the scope of a potential real-world application. I never found resources such as an open-source, efficient implementation of all the features surrounding a full-sized project.

This is what I try to provide here. This project isn't just a skeleton, it contains a lot of opinionated practical examples on how to implement features that are often needed in real-world applications.

That includes authorization, integration testing, localization, validation, error handling, database migrations, mailing, console commands, request throttling, lightweight PHP template rendering, GitHub Actions, and more along with detailed explanations in the documentation.

But it's not just about the features. Equally important is the architecture and how the components interact with each other, following modern principles such as the Single Responsibility Principle and Dependency Injection.

Of course, there are big frameworks that have their own well-established set of programming conventions and implementations of features.

However, I find them often too complex, where the code makes too much "behind the scenes" and lots of dependencies, which can lead to time-consuming refactoring on version changes.
I also dislike having to follow the propitiatory rules of a framework and much prefer the freedom of a micro-framework and carefully choosing the libraries I want to use.
This lets me stay in control of the codebase, keep it lightweight, performant and tailored to the needs of the project, and it's easier to maintain and adapt to new requirements.

You can very well adapt it to your own needs as well, remove or add features, and change the libraries.

Disclaimer

This project and its documentation are the result of my personal learning process in the last 6 years in trying to create the best possible template app with lots of real world examples. Three of the 6 years were spent full time on this project alone.
I made what wish I had when I started getting seriously into web development.

The codebase is big and thus lots of subjective decisions had to be made that may not be the best long-term solution for everybody.

The main focus throughout the development was to make the code as dependency free as possible so that it's long living and can be adapted to different needs and preferences.

Basically, this is my take on what a modern and efficient web app could look like with today's tech.

I worked closely with the software architect Daniel Opitz, who also reviewed this project. I learned a lot during our exchanges and was inspired by his books, articles, tutorials and his slim skeleton-project.

Support

Please read the Support❤️ page if you value this project and want to support it.

License

This project is licensed under the MIT Licence — see the LICENCE file for details.