Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What is a good way to build a web application in 2021
35 points by ab_testing 3 days ago | hide | past | favorite | 28 comments
Hello HN, I last build web applications almost a decade or more back and am mostly in a PM role for now. About a decade back, we were building web applications with JQuery and Javascript. The frameworks involved a lot of manual work and the separation of business rules and data was hard to maintain. But the plus point was that every line of code that went into the system was known to me.

However, exploring the current web application development landscape seems a lot more scary now. Nodejs with 100's of dependencies for each basic task and tools like yarn, gulp, bower confuse me more today.

My business requirements are mostly to build a transactional crud system with a moderately complex workflow rules (i.e data passes to various stakeholders who approve/reject/modify data).

I am exploring a the right development methodology for this task. My skillset is just HTML, CSS, Javascript and Python.

I still use jQuery. I spent a lot of time at todoMVC.com and after going through a bunch of their demos I decided to not use a framework.

I use jQuery, Bootstrap, Mustache.js, Accounting.js, and PouchDB.js.

I use CouchDB to manage users and user data on the server side and Service Workers to make the app fast and give it Offline-First functionality.

PouchDB.js is a great tool. It makes it very easy to work with a CouchDB on the server side.

PouchDB also works with the IndexedDB in the client side web browser, and with a CouchDB installed on a desktop PC for a local-first app that runs at near native app speeds.

And it will "live sync" a user's desktop CouchdB with your server side CouchDB to give your app's users Cloud access too. So, you can create an app that's a Cloud app, and a offline first app, and a local-first app.

CouchDB's Fauxton DB manager makes it easy to set up users, create DBs, and define user permissions on those DBs down to a document level.

That set of tools provides a huge feature set that's rock solid and easy to use and as powerful as any framework, and with the exception of your server side CouchDB it all runs on the client side so the load on your server is minimal.

Never heard of accounting.js but it seems very useful to my use case.

I've been in the same place that I wanted to do everything the modern way, because its 2021 and there are sure better tools out there!

After trying to use go/nodejs/php ecosystems and their frameworks, while being proficient at python I just realized that django's batteries included can solve 90% of cases that you may have for simple and even complicated apps.

One thing I've really struggled with was getting database layer working and not standing in my way doing anything basic.

In django I can just create model, make its fields, call `makemigrations` and magic happens. It gets 90% of job done. Even Flask with SQLAlchemy + alembic makes it really complicated compared to django (the fact you've to spend time on getting it to work kills my motivation)

Tried other languages and frameworks and turns out that this step becomes all manual and you have to take care of it yourself. I don't think its efficient to reinvent that wheel every time you want to do something new. I can imagine use cases where you would want to do it manually, and it might be generally better in bigger projects and multiple teams working on same product, but for myself? No way I would waste time for that.

So after few tries of different frameworks I've fallen back to django, and I'm yet to find a framework which does database layer as easy as django does. It really makes a huge difference when you do CRUD apps and any kind of persistence when it "just works".

You are not forced to follow what everyone else is doing today. If you are more comfortable with vanilla JS and a bit of jQuery there is nothing wrong with going down that path (even for new projects).

I think new frameworks they do solve some problems, but so I do recommend to check them out. If you still don't feel like they will help you out for your given project, just stick to what you know and focus on building a great application, more than on which tools you need to use.

IMO the current SPA vogue is overkill for basic CRUD requirements like you have described, particularly if it's a business-oriented product. Unless you are planning to build something that is very consumer-focused with high levels of interaction that will compete with other, established SPA-style offerings, then the traditional server-side approach is all you need (think: choose boring technology).

My personal advice based on your skill set is to investigate a straightforward server-side framework such as Flask, which I believe uses the established MVC pattern. Choose a single framework like this, and stick with that as your "one token of innovation". Build up the rest (e.g. client side) using technologies you're already familiar with.

On a subsequent project, you can dip your toes into a client-side framework such as React, to give you a taste of what might be useful for you from the contemporary suite of tools. Then you can decide whether it's valuable for you or not, based on cost/benefit.

I want to dip into react or blueprint.js due to the data heavy side of this application. However the tutorials around react all assume using non that loads a ton of dependencies that makes it difficult to judge what all is going into production .

There's a certain amount of "just the way it's done now" to the NPM dependency topic. A bit like how with the .NET ecosystem everything has turned into many dependent Nuget packages whereas before it was all integrated into coarse-grained DLLs. Not getting bogged down in the hell that is the dependency upgrade cycle is a key concern here.

If you can accept the inevitability of a bit of noise when it comes to this, you will eventually become familiar and comfortable with the chatty output of the NPM build process. Maybe you could decide on a particularly stable (LTS) release of React, that may not be subject to too many dependencies which are in a state of flux?

Even though you have Python experience I would check out Laravel (PHP).

I moved from Rails to Laravel in 2013.

The community and ecosystem are amazing.

I can go from zero to having a web app with auth + 2FA, user profile and dashboard in 10 minutes.

The package coverage is even better than Rails gems.

laracasts.com is a great place to get started.

forge.laravel.com makes spinning up servers and deploying super easy.

There is Laravel Valet that is a great local development server.

Laravel Livewire has been great to work with, similar to Turbo Rails, Phoenix Liveview. It eleminates the need of using js frameworks like vue, react.

I would recommend starting with this tutorial, using Livewire. https://laracasts.com/series/laravel-authentication-options/...

I've been a PHP developer for 10+ years and I would say learning Laravel is good place to start since it's the most popular choice for "PHP" companies. However, am I the only one who feels like web frameworks (in OOP langs) stopped evolving after Rails?

If I were to develop a new software product with PHP today, I would develop and deploy it as a phar. I'm not sure if there are any modern frameworks that do this however. My advice is make sure your PHP code works and can be tested without a framework or a server.

Couldn't recommend laravel more and especially with VUE!!

Great community, help and generally a great experience.

The community is the biggest selling point for me, it's so amazing.

Dropping another plug for Laravel + Livewire + Alpine js, I think it's even better than using Vue.

Against conventional wisdom and popular opinion, I use AngularJS 1.x for all the SaaS platforms I run. Python (Flask, and Falcon for newer stuff), Postgres, AWS, AngularJS 1.x and will continue to do so for at least the next 24 months. Boring, but making great income. No need to jump on the "the next big thing".

Svelte and Postgres. Everything else is inferior for this use case:

Infinitely scalable MVP with unbeatable DX and performance in a day or two for anyone who knows js, html, and css, and a little SQL.

(Please explain why I’m wrong cus I’m pretty sure I’m not.)

Node's dependencies forming a black hole that will suck in everything that's good is just a meme. Its actual biggest downside is not being opinionated resulting in fragmentation - meaning every Node project is different in its own way. Same thing with React. Some people love it some people hate it.

Since your app's business logic is fairly complex the biggest challenge will be modelling the database, handling data permissions and coming up with a decent user experience.

If you've never developed a backend app and you know both JS and Python I'm sure you'll be more productive with batteries-included Django than assemble-your-own-stack Node.

The best way to build web applications will be determined by the best applications. If you seek inspiration, look for great web apps and find out what they use.

Everything else is nonsense. I’ve never been impressed by static sites or server rendered apps. I’ve also never been impressed by over the top architected web frameworks. Show me a next.js site where I go ‘woah, unbelievable’, don’t care.

Show me a svelte site that makes me go woah. Show me a React one, etc. Server rendered sites were always some of the lamest things I’ve ever seen.

Go get inspired, and the answer will be clear.

You have sufficient skillset to build what you need. If you want to stick within them, you can go with Flask for Python. You can keep things simple by going "old-school" and rendering most of the UI on the server-side.

For more interactive UI on the frontend, you can go with Vue.js for a lightweight framework or stick with pure javascript. As you mentioned the tradeoff is more familiarity with the code. I find that is important to keep things maintainable.

For simple crud apps, often pure javascript with server-side rendering is sufficient.

This is my go-to.

i generally like-ish Laravel, in part because it's PHP so you know it's easy to hack, but...

one potential issue with Laravel is there are 8 trillion pieces of tech you will have to read about or try to ignore to get to a simple deployment.

and even simple deployment is not so simple -- you need tools, lots and lots of tools.

you know, to compile your css. :-D

but i would generally agree-ish with one of the commenters below who recommended Laravel.

it's mostly well done, generally organized, etc.

if you do the current latest install, you'll end up with a Laravel app with a 'Breeze' front end (i think). Breeze being the simpler little cousin of the two 'Jetstream' front ends/routing techs that will also be bundled, but you don't have to use.

The default css is Tailwind, the default templating engine is blade, the default js/component/library implementation is Vue.

laravel also sells - or someone sells - laravel-in-a-box so in theory it's easy to run vagrant-style.

there are now a bunch of 'saas scaffolding' apps out there you can buy for a few hundred bucks - so they give you what every framework should already give you out of the box - authentication, primarily.

and laravel has a trillion plugins/apps/services, some of which are paid. like a deployment service. a fancy admin panel. etc. their own scaffolding, 'Spark', was downgraded to be just a souped-up version of their Cashier plugin/app (I think) - but not sure.

https://www.saaspegasus.com/ is an example for python.

for actual prototyping, if you don't mind learning some app building, low-code services, and don't mind the freemium model with a $50/mo entry fee for non-free level, you could try Anvil or Bubble.

since you know Python i'd look at Anvil first, then Pegasus.

Laravel is pretty quick to get up and running with just a few terminal commands, I wouldn't say there are lots of pieces of tech you have to learn. Laracasts.com is a great starting point.

I'd recommend using Laravel Jetstream + Tailwind + Livewire.

Jetstream is free and give you auth 2FA and nice user profile out of the box. Spark v2 ($199/yr unlimited projects) is only the billing portion now, you could use cashier for that for free.

So you get a decent SaaS starting point with Jetstream + Cashier. Spark is probably a time saver, unless you want to customize plans/payments, then it might be better to just go with Cashier.

For local development checkout Laravel Valet.

There are some paid products and services, but they are well worth it. Laravel Forge is amazing for spinning up VPS, SSL certs and more. Plus they support the open source project and community members putting out great content.

I’d suggest reading up on what’s changed in just those technologies for a start: HTML5, CSS3, ES6, Python3. Then you’ll be better able to evaluate the new tooling built on top of them.

As you have experience with Python and Javascript, I would suggest: Backend: Django or Flask (Python frameworks) Frontend: Vue.js (JS framework)

I you are willing to explore new technologies, I would suggest Laravel.

Use django. It has batteries included and will let you focus on what matters.

> My skillset is just HTML, CSS, Javascript and Python

Why not just use Django?

Stay away from JS. It sucks

Django rest + react is an amazing combination. React is dead simple to work with and Django is super parts included

Are you using JS to refer to something other than JavaScript? React is JS, so your advice seems self-contradictory.

forget about spas. just do it the tried and true way, server side rendered html.

Yes, I would very much recommend this. And when I wanted a little more interactivity, I had a great time using https://unpoly.com/ for a simple CRUD-type app like you’re describing.

I would very much recommend taking a serious look and trying Unpoly or similar before getting sucked in to a SPA

Just posted my reply when I saw this. Yup, I have the same advice. Avoid SPA overhead, keep it simple with server-side rendering and pinch of javascript for some interactive UX.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact