Lurker News
I am still frustrated with the amount of incidental complexity required whenever I want to do this. My latest attempt was to use a Digital Ocean droplet with Django pre-installed. I guess the biggest issue there was setting up something so that I could easily deploy my local version to the droplet (ended up using git/Github), and ensuring those two environments were in sync. I looked into Docker in some detail about a year ago, and I think it's the only pretty good solution for this I've come across—but there's a steep up front cost in learning/setup etc. (or so it seems).

What services and technologies do you use when you'd like to quickly build a web app which may never be more than a prototype, but may also turn into something real? A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to production, and not having to mess with a bunch of server configuration things, user accounts, security, etc.

Comments (558) 189 threads

Earlier comments
marcus_holmes8 replies#
I write the server-side in Go, cross-compile to a Linux binary, and set that up as a service on a vanilla Ubuntu box (usually Digital Ocean). Deploying a new version is a matter of sftp'ing the new binary (and any templates, images, etc) over the top of the old one and restarting the service.

If I need a database then I use Postgres, and the setup for that can be a pain, so I get it documented/scripted using Ansible.
If I need something more complex than plain HTML on the client side then I use a Makefile to synchronise Webpack + Babel + React (and the hot reload during development), and the compiled bundle.js becomes another file to copy over.
I realise it's not very 2018, but to be honest I've kinda lost the will to live over learning anything more meta at this point.

Xeoncross2 replies#
This is about as 2018 as it gets. Go and Rust are the only modern languages where you don't have to second-guess the stdlib for bad choices (looking at you php/ruby/javascript/etc..) yet provide amazing performance.

Backend: Go (optional embed db: ledisdb / boltdb / leveldb / rocksdb / etc...)
+
Frontend: create-react-app / create-react-native-app

Ecco1 reply#
I find Ruby’s stdlib a pleasure to use.
49bc11 replies#
How many web apps can you name that don’t rely on any external gems? Packaging that mess is a pain in every scripting language.

Continue this thread — 11 replies

beeman#
> as 2018 as it gets

sftp'ing a binary to your deploy target? That's more 2008 iyam...

marcus_holmes4 replies#
That's interesting... I think I'll spend a couple of days playing with Vue to see if I can get rid of Webpack and Babel, because they're an enormous pain to set up (especially as they keep changing their config schema every major version release - I think I've climbed Webpack's config learning cliff three times now).
oreganoz#
React doesn't need webpack or babel. People just see lots of benefit in using them, but there are tutorials out there on how to use just React.

It can be as simple as a script tag at the bottom of your html and then writing ES5 React.

mmusc#
Vue apps depends on webpack as well. But the vue-cli makes the whole set up a breeze. Especially v3 (currently in beta)

If the website you're building is simple you could even have vanilla html pages then attach vue to the divs that need that extra interactivity, then you won't any fancy loaders.

mamcx#
I try dozen of tools for a cross-platform app and finally settle on use vue.

Every time I use node and look at his insanity and get depressed.
So, I dislike STRONGLY the use of Webpack and friends. Is a chore because JS is even more nuts now, and everything assume you want node nonsense everywhere.
So, I persist and do this:
I introduce:
> Non non-sense javascript front-end setup with vue
https://gist.github.com/mamcx/1d3aa692b0d34b0fae696c12292a1a...
Using local .js/.css files downloaded from a cdn, then using cat to concat in the correct order all the deps, and finally let to build your css/js as you please for your logic.
Build time is zero after the first try.
P.D: Maybe using unix pipes I could minimify and stuff like that, but I don't need that.

wishinghand#
If you just have a Vue file script tag in your document, you're good to go. If you want single file components, hot module reloading, Babel features, etc, you'll need Webpack. Luckily, the current and beta versions of the vue-cli make these non-existant problems. Just install using the cli and it's good to go, no setup needed.
friedman234 replies#
How do you handle server side rendering? This is one of the reasons I chose to go full Node+React.
lowry#
Vue also has server side rendering.
gefaber#
Check out gatsbyjs.org for server side react rendering.
slow_donkey#
Look up express-vue
jaequery#
nuxt.js is an all in one vue framework that has ssr and a really cool file based routing functionality
kvm1 reply#
How is this setting things up "quickly" when OP is asking to limit complexity? You're suggesting:

1. Server side in Go 2. Cross-compiling it 3. sftp'ing and restarting the service everytime 4. postgres 5. ansible 6. Makefiles 7. Webpack 8. Babel 9. React

IshKebab1 reply#
Writing web servers in Go is extremely easy. https://golang.org/doc/articles/wiki/

Cross-compiling with Go is done by setting two environment variables. That's it. This is not like the mess of C++ cross-compiling. In LiteIDE it is simply a matter of choosing Linux from a drop-down: https://www.wut.de/pics/screenshot/e-505ww-07-pide-000.png
SFTP is not exactly hard. Nor is `nohup ./server &`.
From 5 on I agree though - is that 4 build systems? Insanity. I would just make a static web page with normal HTML forms or whatever and Go templates. If you really need client-side Javascript, I'd just use jQuery, or something similar and lightweight like minifiedjs.

marcus_holmes1 reply#
yeah, I use straight HTML wherever possible. But for some things it isn't possible, or suitable. I'd love a simpler client-side environment. Any suggestions welcome... I'm looking at Vue.js now, recommended from comments here.

Continue this thread — 1 reply

JepZ#
For me this is the response to 'how do you build stable/scaleable/.../good web apps in 2018', but sadly not to 'favorite way of getting a web app up quickly in 2018?'.

The whole process of starting a new VM for every little project seems to me like overkill and developing components if you just want to get a prototype out the door can be difficult as the components will most likely have such a poor quality that you can't reuse them for anything else.
With that said, I am 100% pro Golang Server + Vue.js UI when it comes to building something which will be definitely more than a prototype (no shortcuts taken).

dom964 replies#
Your start is good but you add complexity on top of it. Install Golang on your VPS, clone the source code on it and compile it there instead of messing with cross compilation.

Also use sqlite to avoid the pain of setting up a SQL server, there is no need for it.
You can then easily get systemd to supervise your binary.
This is how I host all my web apps, the main difference is that I don't use Go but Nim. If you want a great framework match up then check out Jester + Karax, see how I developed the Nim Forum using this combination.

BLanen1 reply#
Better would be to just use docker.
marcus_holmes#
Please explain. I still don't understand the use-case for docker...

How is docker going to make my life easier in this example?

nicoburns#
> instead of messing with cross compilation.

To be fair, cross-compilation in Go is as simple as setting and environment variable.

joobus1 reply#
Why put the source on the VPS? Go cross compilation is much easier then you make it sound.

    GOOS=linux GOARCH=amd64 go build
Nim can't beat that.

Continue this thread — 1 reply

Continue this thread — 1 more reply

Continue this thread — 3 more replies

cdcarter1 reply#
Heroku and Heroku Addons are freely available at my company, so it’s the preferred deployment target. I work on a developer productivity team so being able to stamp out apps fast is one of our most important requirements.

Heroku has given us a ton of flexibility, and with that we’ve been able to become very opinionated and standardize on one stack. 12 factor design patterns (and the opinions of Django-cookiecutter) allowed us to stop arguing about how to do something and just get it done.
We use GitHub for source control and Heroku Pipelines for CI and testing. Every push runs functional tests, every PR spins up a “review app” with full dependencies and test data.
Heroku Postgres is our system of record database. Postgres is stable, fast, and full featured. With jsonb fields we’re able to store complex structured build log data and quickly aggregate on it. Heroku Data Clips are super useful for quick reviews of the data without building a report into an app.
Heroku Redis and S3 are the only other data stores. S3 stores build results and end user assets, and Redis handles anything in memory. We use Brandur’s transactionally drained job queue pattern (https://brandur.org/job-drain) to defer tasks.
The apps currently all render to plain ol HTML and for the most part take a document centric approach to front end. Additionally, our apps are all API first and we use CoreAPI to create CLI clients automatically. Those are usually our administration tools which help make sure we are API complete.

vkeenan#
I'll chime in on the pro-CI discussion and leave the language discussions to "what's the best front end lang" posts.

I just got done revamping my decade-old PHP experience to full OO, and really upped productivity with the Slim framework to build a REST API for our app. I'm using Salesforce platform as the database backend, which is slow but I encapsulate all the business logic there. That's all cool, but, it didn't seem like I was hitting the mainstream of productivity.
Long story short, I'm on the Google/TypeScript/Material/Node bandwagon now. The dev environment is easy, and there's a wide choice of Node deployment platforms. I believe we can get the kind of deployment productivity we want with using a CI pipeline based on Github or Bitbucket that squirts commits to Google App Engine.

amingilani1 reply#
Oh man, do I love this question.

For the stack, Ruby on Rails with React.
But my secret sauce is the DevOps:
+ GitLab
+ GitLab CI
+ Heroku
+ Git + Git tags
I also add some magic npm scripts to take care of semver tagging. And with my build:
+ All pushes are tested
+ All changes to master are tested and deployed to staging
+ All semver tagged commits are tested and deployed to production
+ Also, all database migrations happen automatically.
I documented my entire process by building and deploying a sample app here: https://www.toptal.com/devops/effective-ci-cd-deployment-pip...

ai_ia1 reply#
Can you give me a resource to get started with devops. I have only heard these ideas, but don't have any clue why at all they are required.
rhizome311 reply#
The idea is to automate repetitive tasks as much as you can because doing them by hand takes time and is error-prone. Build, deployment and testing are tasks that are well suited to automation.
amingilani#
This!

I started by automating things that would take too long. At first it was taking code from my repository and deploying it to Heroku. Then I discovered that CI services literally gave you servers to run scripts on to interact with your code after a git push, so I started running tests in these servers.
Fast forward a few years and I automated everything except writing and maintaining the codebase.
I even run linting tests in CI so no badly written code can even make it to code review.

asadjb#
Django web app deployed to Heroku is the fastest way I know of right now.

Django because that's what I know best. I can code a basic CRUD app (which is basically 90% of all apps I have ever needed to build) in a few hours.
Heroku because a simple procfile and push to a git remote is all that's needed to launch the application.
I think the best piece of advice I would give is to use whatever you're most comfortable with. If you use a new technology that saves you 50% on deployment time, but adds days to the time you need for actual development because you are unfamiliar with it, is not worth it in my opinion.
Deployment/setup takes maybe an hour or 2 for the kinds of basic app I think you're talking about. Development is easily days or weeks. Optimizing deployment over development is optimizing the wrong thing in my opinion.

Load more comments