This project is for anyone wanting to build a web app or web service MVP using Slim Framework, running on PHP, MySQL, and memcache. I created it to help myself and my company go faster, and now you can use it too!
Just go read the docs.
Find a bug? Open an issue on GitHub.
Want a new feature? Fork me and open a pull request, but please grok the open issues first to make sure no one else is already working on the same problem.
I like dreaming about products I want to build. And most of the time when I'm dreaming about products, I'm dreaming about SaaS. Afterall, I've been writing code for the Web a long time.
When I first picked up PHP it was because it was free and Microsoft wasn't. Later, when PHP became the focus of my development, it was because PHP was far easier than Java for building iteratively and testing.
That was before I discovered CodeIgniter, WordPress, and countless other amazing open source projects and communities. All of them were born of this wonderful and sometimes frustrating language we call PHP. I was hooked.
Sometime last year I discovered Slim Framework, and I felt emboldened by its simplicity. Not long after that I discovered Paris and Idiorm, both of which have also became reliable tools in my belt.
Later that same year as I was working to build two different MVPs for two different companies, I decided that there were enough similarities between the two projects to justify creating a "common" repository of code to share between the two.
And with that, slim-common was born.
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
If you're unfamiliar with Slim, you should start by reading their docs.
I started by solving some common lower-level problems: things like how to manage configuration. But soon I moved on to larger challenges—challenges that required me to incorporate third-party libraries like the Facebook PHP SDK. More challenging though they may be, the problems I was solving were still common problems, so into the library went Facebook's code.
- routing requests (Slim Framework)
- configuration management
- credit card transactions (Stripe)
- data modeling (Idiorm and Paris)
- Facebook API integration
- Google API integration
- HTTP requests (Requests)
- markdown rendering
- newsletter subscriptions (MailChimp)
- remote content embedding (Embed.ly)
- sending transactional e-mails (Mandril)
- sending and receiving SMS messages (Twilio)
- UI patterns (Bootstrap)
- user authentication and security
This was almost a deliberate decision.
I like composer, but at the time I was beginning these projects I wasn't familiar with it.
So instead I have enjoyed relying on git submodules for managing dependencies, and I still do. Of course, this makes any project you build using slim-common dependent upon a feature that belongs to git, which technically violates the Dependency factor of the The Twelve-Factor App, but only to the extent that to get started developing with slim-common you need to have git installed—hardly seems like a big ask.
Maybe one day I'll add a composer description file to slim-common and strip out some of the third-party riders (like the Facebook PHP SDK), but until I have time for that kind of meta work, I'm going to stick with what gets the job done.
To use slim-common you need to add it to your own project, just as if it were a giant library of code, because in fact it is a giant library of code—several libraries, in fact.
That said, there is some templated code in ./templates
that you can use to quickstart
your own app—just follow the instructions in the docs.
Just go read the docs.