My Boring Yet Modern Web Starter Stack
I like to use the same stack again and again. It makes me productive, makes code less buggy, and builds knowledge over time. Unless there is a real need like unmaintained software or a different kind of application or unless I am going to build a Facebook or Google, I rarely change things in this stack. Even if I am going to build Facebook, I would start here and then adjust as it grows, just like Facebook did with it's stack.
So currently, my stack looks like this. It's called "Boring" not because it's dull but because there are minimal unwanted surprises. You don't want surprises in your software stack. This stack is both "Modern" and "Boring".
- Bootstrap - front-end open source toolkit
- Flask - micro web framework
- Flask extensions for additional functionalities like REST API etc
- Jinja2 for any server side templating
- SQLAlchemy as ORM
- Celery for Jobs
- Redis as both cache and queue
- PostgreSQL or SQLite as RDBMS
- RESTful web services and OpenAPI
- Gunicorn as Python WSGI HTTP Server
- Gevent - To provide asychronous workers to Gunicorn when required. Specially for SSE.
- NGINX as reverse proxy and serve static content
- Ubuntu LTS - Linux as operating system
When I posted this diagram on twitter, there were some good suggestions. I am adding them below as you might find them interesting.
MariaDB - If you already use MariaDB, you can continue using it. SQLAlchemy should ideally make it easy to change if required unless you use DB-specific features.
RabbitMQ - Instead of Redis as Queue. I have used it before. It's rock solid. I would start with Redis. When you need RabbitMQ, you can transparently change in Celery. It should be just a settings change.
RQ - instead of Celery. Lesser overhead and less complicated. But it has fewer features than Celery. For me, the limitation is its dependency on Redis. Ideally, I would like to have an option to switch to a different Queue when required. That said. Migrating from RQ to Celery or vice versa doesn't look that complicated. So if you are new to jobs and want a simple system, you can start with RQ.
GraphQL - instead of RESTFul, sometimes along with RESTful. I have used them; I like them. But I use it on a case-by-case basis.
I have not added deployment, CI/CD, Dev Tools, monitoring and alerting tools here. I do have standard tools for these tasks too. I will probably write a different post about them. In the meantime send me your comments.