77 points · by ryanSrich · 6y ago · 88 comments
Since then a lot has changed. I'm curious what people consider the fastest/easiest way to build a full-stack SaaS app in 2020.
Assume the following:
- Can be picked up by almost anyone (assume basic HTM/CSS/JS understanding), doesn't require any deep CS understanding (think how easy Rails was in 2006)
- Has full-stack capabilities, not just front-end
- Is open source and can be deployed anywhere
- Is complex enough to rule our no code solutions like Bubble or Webflow
It can do anything you could possibly want to do with a standard web app and if you really want to do crazy Javascript things you can always just use it as an extremely powerful backend for whatever the frontend framework of the day is. The admin site alone has saved me weeks of work and I keep finding amazing features in it that often just seem like magic (formsets!!).
Most social auth uses OAuth2, which doesn't exactly make sense with REST, but you can still use it alongside a REST-based app.
I see 4 scenarios:
1. A JS web app that uses SessionAuthentication can just use python-social-auth's Django app directly. Since the session is shared, it should Just Work™.
2. A JS web app that uses tokens: django-rest-framework-social-oauth2 seems to be made for this, but you could also do it with plain python-social-auth (which the former uses internally) by generating a token on your /success URL and sticking it into localStorage.
3. A non-web app that uses tokens: like number 2, but in a WebView.
4. A non-web app that uses sessions: like number 1, but copy your cookies into a WebView, do authenticate in there, then copy the cookies back.
I know PHP is super easy but wasn't sure how it was for Python frameworks?
Your first try might take a couple of hours to get right. If you want HTTPS (you should) Caddy might be a better route than nginx. It's certainly easier.
Nginx has a similar module, but I haven't used it personally.
- React for the front end (https://reactjs.org)
- Node.js for your back end (https://nodejs.org)
- Deploy using Adapt, which ties your front and back end together using React-like components. (https://adaptjs.org).
- (Optional) If this project is larger or commercial, definitely use TypeScript on all 3 of the above (http://www.typescriptlang.org/)
[Disclosure: I'm a maintainer of Adapt, but a strong believer in the React model and ecosystem]
Im sorry but why would someone want to use a templating language to configure infrastructure? It’s like using CSS syntax for defining an HTTP API. Doable, but... why? It’s not any easier to pick up or reason about than any existing configuration language.
On React + node, this assumes no rendering on the server, plus you’ll need to pick your own state management solution, data layer, http framework, router, and a whole host of secondary tools, which will comprise about 96% of your actual development time.
At any rate the reason why somebody might want to do this is purely because its declarative. I prefer imperative programming myself, because I want to know exact what the logic is doing from reading the code, but many people don't think that way. Many people want to know what is happening without being overwhelmed by how its happening and they need the code to communicate to them in exactly that way.
Of course, with great power comes great responsibility...
As a project gets larger (more code or more devs), each dev spends more and more time figuring out what the correct types need to be when using various internal APIs. Refactors get harder because it becomes harder to know whether you've correctly found and changed each place that was needed.
And although all projects have this to a certain degree, one typical goal of a commercial project is a higher quality bar for software while still optimizing amount of effort to get that quality. (And commercial projects are often larger too.)
TypeScript helps with these issues (and others). In my opinion, it increases developer productivity for all but the smallest JavaScript projects. It's a combination of both the static typing and the tools available that help the dev immediately, as opposed to waiting for a compile or test run.
I'm actually passionate enough about the topic that I have an old blog article about it: https://medium.com/hackernoon/3-reasons-why-we-use-typescrip...
A 200 l.o.c. promise chain vs a 10 liner in Python or PHP or Ruby?
Just feels dirty to me.
I usually end up with fairly succinct code and it's never difficult coming back to a project that is 5-6 years old. Can always understand what's going on in the project and get my mind back and running quickly with it.
Using it with GraphQL (graphene) makes it feels a bit more like one of the newer frameworks out there.
Really happy I learned it years and years ago. Nice to invest time into a framework that is still going strong so many years later.
(I'm not a web dev, but played around with Flask recently and in general find the giant ecosystem of different frameworks fascinating.)
1. There are some bugs that can't be fixed just because they break backwards compatibility. E.g. usernames are stored to the database incorrectly by default, but the dev team isn't going to change it. So if you don't know that it works the way that it does, it can cause issues.
2. Most people now use a js frontend and a REST backend. Django can do this well, but because it wasn't originally designed to be used that way there is a ton of random cruft that isn't super useful to most people anymore.
3. No good async story. They are working on this, but it's going to be kind of bolted on rather than designed for async from the ground up.
4. Lots of random cruft related to weird design patterns that folks have advocated for over the years. You don't have to use any of it, but the fact that it's there leads a lot of people to believe they should be using it, which leads to bad codebases.
Basically you can do everything you'd want to or need to using Django, but there is just a bunch of random crap in there that you need to prevent people from using. And preventing people from doing stuff that they want to do tends to lead to either conflict or technical debt, so it would be much better if it just weren't there in the first place.
If i saw this sentence out of context I would have bet a decent amount of money you're talking about C++. This describes C++ to a T.
It's still brittle, it's still user hostile and it's still slow. Seems like a massive waste of time and a vanity project to me.
I'm still mainly doing server-side templates coupled with complicated js widgets when I really need them.
So while I'm not sure Rails is easiest to pick up for a complete newbie, I am sure that there is still no framework that can touch Rails when it comes to fast/easy to build an entire web application from scratch that is truly broadly deployable and maintainable for years to come and won't cause you to tear your hair out every other day. :)
I think you're not going to see much consensus to this question, merely a comment-based list of all possible frameworks that people know.
User joshmn had it right in his reply:
> If you know something now, use it.
Anything your team already knows will be easiest and fastest for you to use. Any new person you hire will have a lot to learn no matter which one you choose, unless you hire people for the framework/stack you chose.
There is no "right" answer to this, and there probably never will be, and that's not a bad thing. Trying to find the "perfect" solution is a futile effort.
Not a bad stack, but the development team was a group of PHP developers. Rather than go with something they all knew, the leadership decided that switching stacks and having the entire group learn Python with the CMS/CRM/Fulfillment system being their first professional project was the way to go.
What resulted was a misshapen monstrosity. Plenty of good ideas, ruined by limitations in understanding of the stack they tried to implement, and further hampered by a lack of good direction and herding of the team. The stakeowners of various bits were allowed to snag their pet developer and lean on them until their "feature" was implemented, with little to no cohesive architecture in place.
Perfect is the enemy of good. There are dozens of frameworks because they all have their uses. Stick to what you know, and let that guide you. If you have a desire to learn a new stack, go for it. But don't pick one because someone else says "it's the best".
If you don't, Rails or Laravel are both good options. I'm partial to Ruby, its syntax, its expressiveness; the ecosystem cannot be beat, and the tooling is stable and mature. There's nothing not to like.
PostgREST or Serverless framework for the backend.
Avoid middle ware all together!
Stimulus Reflex for real-time dynamic updates without the complexities of React components. https://github.com/hopsoft/stimulus_reflex
Python => Django
PHP => Laravel
Ruby => Rails
Node/JS => ExpressJS
Elixir => Phoenix
My personal opinion on building web applications the quickest way. I mostly use Laravel.
https://wordpress.tv/2019/04/23/corey-maass-build-a-web-app-...
There are a number of large web apps that use it, so it's not just for MVP's. I also heard the book "Building Web Apps with WordPress: WordPress as an Application Framework" will be getting a second edition this year.
It's not the coolest, shiniest option, but a solid one, I think.
You can indeed use Express.js for the HTTP part, but you’ll need to pick an ORM, a rest framework, etc and make sure they integrate properly which might include writing “glue” code to bring them together.
Unless you’re knowledgeable about Javascript I suggest you avoid this option and instead pick another language you know that happens to have a batteries-included framework like Django, Laravel or Rails just to make development faster as these frameworks include everything you need out of the box and are tested to work well out of the box.
However I would expect at this time of the JS to have one single import that does all the work for me hiding all the configuration files. Making good/best decisions for the default configuration. Also deciding how to do things like database connection, transactions, HTTP server, SSL, UI, ...
Disclaimer, biased as I am the lead maintainer for the project ;)
- Tight integration with React, Vue, Svelte - Natively supports Mongo, but there are good GraphQL and SQL integrations these days - Plug 'n play user accounts (customisable) - Easy to deploy - Builds to Android, iOS, even desktop these days. - Tight integration between back and frontend. Extremely simple to write API's or realtime applications - It's simply Node on backend, do whatever you're used to - Still a very active community - Tons of apps running happily in production (the myth of it not scaling is due to developers not understanding, not the framework itself)
We continue using it, nothing develops as fast and easy - at least in the Node world.
The nice part about Node is that you'll have JS on both the front and back ends.
It really scalable and if you use typescript, you can get type safety as well :)
There is your answer!
But for anyone with a decent amount of programming experience in a mainstream high level language like C# / Java / JS / Python / Ruby etc. it's probably best to stick to your own language and pick it's stack, if it is dev speed you are after. Some might be easier to set up than others, but there are plenty of example github repos you can clone to get started anyway.
For (what I'll call.. sue me) "systems" languages C, C++, Haskell, Rust, GO etc, I'd probably move over to one of the mainstream stacks for getting things done fast, as they will have a better ecosystem. Also if you already know one of those languages you can easily work with the mainstream ones!
Next.js is react + ssr + routing and more. Hasura exposes an auto-generated graphql API in front of a postgres instance, with hooks for auth/authz and much more.
- Front-End: Vue.js with Bulma.css - Webpack/Gulp for building JavaScript/SCSS. (I have the blueprint here: https://github.com/omarabid/front-root but there is still no docs and rough edges). The website is/will always be static files generated by Gulp. First frontier for scaling is eased.
- API: I use a GraphQl server. This avoid the mess that is RESTful. It also give me a nice explorer, so I can make my application and be able to roughly work with it before I have an interface ready. This part is also easy to scale.
- Application: Rust. Technically, you can use anything here. But since I don't have any web components (the site is static and the API is served through GraphQl) then I use Rust which I find very productive. Rust generates a compiled program which run inside a container and makes deployment more enjoyable.
- Database: Postgres/Redis.
- Deployment: Everything runs in a container. I use Hashicorp software for deploying and orchestrating the servers. Terraform if I have a simple single server app. Or Consul/Nomad/Vault if I'm running multiple servers.
It might sound complicated but beyond the initial investment to set things up, you have a stable/reliable micro-services app.
It has a great ecosystem and lots of great packages and tools to make it fun and easy to develop web applications.
Authentication, file upload, admin interface ... are some of those.
https://www.simplecto.com/django-my-go-to-application-framew...
Following on that, enough HNers have laid out the Django story, but I want to give some more depth to it. This is my entire stack:
- Linux Server/VM Hosted anywhere (I like Azure, Digital Ocean, or Scaleway) - Docker. Just plain docker - Postgresql running in docker - Django in a container - Intercoolerjs for easy and slick Ajax-like front-end work - Traefik for reverse proxy and TLS with LetsEncrypt - Sentry for catching production bugs (easy three-lines added to your config) - Bitbucket pipelines for CI/CD
For smaller projects I run tests locally in docker containers and then push directly into produciton. I dont bother with full CI/CD because I don't need the complexity of it all.
If you know JS, just stick to Node + Express.
I stick to Go or Node for the backend, and create-react-app for the web client. I prefer Go in most cases because I don't need to rely on many external deps, and I have my own starters for both Go and Node to create services quickly (rest, real time, assets, data/repository)
It does have graphQL which can get a little tricky, but the constantly rebuilding dev environment and GitHub hook driven deployments make running a site a breeze.
For back-end I'm currently favouring F#/Giraffe. I'm new to .NET Core but F# is reason enough to try it out. Previously I've used Go or Kotlin/Java with Javalin/JDBI which I find lighter and simpler than Spring/Boot.
I'm a front-end developer looking to get serious about practicing my back-end development skills. Any recommendations for a language/framework with static typing (outside of Node + TS)? Spring Boot and Kotlin? .NET Core? Go?
Big Disclaimer: My observations are completely subjective and personal so YMMV.
Spring Boot and Kotlin: I REALLY like Kotlin as a language, though Spring Boot felt heavy and sluggish from a developer productivity standpoint. This could be my inexperience with Spring and the JVM ecosystem, though I've also read comments on Hacker News that roughly say the same thing (1). I've also read that the heavy use of annotations in Spring Boot are great initially, but it creates headaches for more complex projects. The Maven/Gradle package management experience wasn't great either when compared to RubyGems/NPM. I also tried Kotlin + Ktor(2) on a personal project. It felt better, but at the time it was hard to find solutions to problems on Stackoverflow or the web.
Go: I briefly worked on a project that used Go + Gin. I loved the simplicity of Go and features like concurrency and the built in code formatter. Though at times code felt a little too low-level when implementing business logic such as model validation etc. I missed language features such as generics, null checks and discriminated unions that other languages have. Handling errors also felt tedious at times. However I completely understand the appeal of keeping the core language simple.
.NET Core: I'm probably the most torn about .NET Core. I've always preferred a *nix/Mac system and borderline hated Microsoft during the Balmer years. However C# is a properly good language (though not quite as nice as Kotlin) and the .NET Core standard library feels well designed. There are new features coming in C# 9 like discriminated unions (sealed classed in Kotlin) and records (data classes in Kotlin) that will make it even better. It's not all great, I found unit testing is much more tedious in C#, especially compared to something like Jest or RSpec. Mocking/stubbing was especially difficult as you can't easily override a method unless it's tagged as 'virtual'. One way around it is to use interfaces for the argument type, however this can cause your project to be scatted with pointless interfaces that are only used to overcome this restriction (3).
ASP.NET Core overall is very nice to work with and it's blazingly fast (4). It does have remnants of some enterprisey cruft, but overall I found it very productive to work with. Using VS Code and Jetbrain's Rider made coding on a Mac a breeze though full Visual Studio for Mac is pretty awful.
But here's biggest issue with .NET Core: while it's truely cross-platform and open source, I found the broader .NET ecosystem and community is yet to embrace this. I'm not sure if it ever will completely. The vast majority of YouTube videos and articles I've read assume you're using Visual Studio on Windows. That makes sense, as a 2019 Jetbrains survey indicated that 90% of C#/.NET developers use Windows (5). But if Windows is your jam, this might not be an issue for you.
I also have the strong feeling that Microsoft's strategy for an open sourced .NET is to push the use of Azure for hosting. While it's definitely possible to deploy a .NET Core application to AWS or GCP I worry that Microsoft will always have a bias (even if it's unintentional) to make .NET Core be better on Azure and have soft lock-in. E.g .NET Core will run on any cloud provider, but you'll get the most of it if you're running on Azure.
All of these frameworks were weak in the REPL department. One of the great things about Ruby/Rails and Python/Django is the interactive console. There have been countless times when I've SSH'd into a production box to manually trigger a password reset for a user, or use the ORM to run a one-off report for a product manager. I couldn't find anything close in statically typed frameworks. Because of that I'm quite liking the combo of Python + typings + FastAPI (6) for personal projects. It's not perfect but it's ticking most of the boxes for what I'm looking for.
Again I can't stress enough that this is all my biased personal opinion influenced by how I like to code and my strengths and weaknesses as a developer. But hopefully it will help you in choosing a language/framework that you'll enjoy. Another thing to keep in mind is the amount jobs available for each stack near where you live.
1) https://news.ycombinator.com/item?id=20602318 2) https://ktor.io/ 3) https://stackoverflow.com/questions/20400734/how-do-i-mock-a... 4) 'aspcore-mvc-ef-pg' in https://www.techempower.com/benchmarks/#section=data-r18&hw=... 5) https://www.jetbrains.com/lp/devecosystem-2019/csharp/ 6) https://fastapi.tiangolo.com/
edit: typos and formatting
Last night, I went through a lot of research and bikeshedding myself, and a lot of my intuitions aligned with your experiences.
I was curious about Go, but it seemed while it was possible to do mostly everything you wanted to do, it wasn't necessarily a smooth experience.
I looked at Kotlin next. I'd used Spring Boot before with Java, and at the time I was fond of the annotations, but, like you said, I've heard that they can become a burden in larger projects. Thankfully, I saw that there were a number of other Kotlin web frameworks that had vocal support.
Finally, I spent the last bit of my time choosing between C# (.NET Core) and Kotlin with Ktor something else. I ended up finding this very helpful site[1] that showed examples from the two languages side by side. That had settled it for me; C# just looked more like what I wanted out of a programming language's syntax. Plus, LINQ looks really cool.
At some point in the future, I'd also like to gain more comfort with Python and Django. I can't stop hearing good things about those two.
I love Python but have only deployed PHP apps.
Sample for Apache:
https://www.codementor.io/@abhishake/minimal-apache-configur...
The last 2 months have seen more activity after a pretty long silent period.
Back: FastAPI
So why not use Rails?
Plus the advantage is ES6 all around. Node utilizes the host resources much more effectively than PHP. And PHP requires Laravel/Artisan to make up for its shortcomings, IMHO. It feels like those to extensions were built for people with extensive PHP backgrounds, and not newcomers. Whereas Node does a better job onramping IMHO.
I find using JS on both ends is much easier than trying to bring in a bigger system like Rails/Django/Apache+PHP.
Especially if you are starting from Square One.