Skip to content

Instantly share code, notes, and snippets.

@cedrickchee
Last active January 13, 2019 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedrickchee/9d4cc91f4d27b557eeeac23b6ddeecc3 to your computer and use it in GitHub Desktop.
Save cedrickchee/9d4cc91f4d27b557eeeac23b6ddeecc3 to your computer and use it in GitHub Desktop.
What is everyone's go-to web stack today in 2019?

If you plan to quickly put together a simple web app or website with React.JS.

YMMV depending on what you’re doing, but the following is a good bet if you want to make the project accessible to other developer, and it doesn't need to quickly scale.

Front-end

Use React.JS with TypeScript.

Create React App now makes it dead easy. Just run this command:

create-react-app myapp --typescript

The general consensus is, do not use Redux until you know React well. You might not need it. If you do need it, use boilerplate/starter kit such as redux-starter-kit, offered by the core Redux team.

Back-end

Use Node.js (if you are comfortable with JavaScript) or Rails (if you prefer Ruby or Django if you have Python skill).

If you go with Node.js:

  • Express is a good starting point if you need a simple abstraction around Node HTTP/web server
  • Sequelize for SQL ORM library
  • Async/await has made things much easier on the Node.js side though. Express doesn't still have async support by default, but there are middlewares and native support is coming with Express v5.

Database

  • Use relational databases (PostgreSQL) by default for all data (primary/important and secondary/meta-data)
  • If possible, avoid NoSQL database such as MongoDB. I wouldn't want to put my important transactional data such as subscription and e-commerce sales data there.

Caching

Redis.

Message queue

RabbitMQ or Kafka.

Authentication and Authorization

  • For authentication on the web, just use cookies (do not use JWT).
  • Put nginx (app proxy) in front of Node.js and your static files (React, etc) from the same domain so that you do not have to use CORS, JWT, etc. So, an easy choice is 'mydomain.com/static' serves your React bundle while the cookies are on 'mydomain.com'

Tips

Tooling tips:

  • Use Visual Studio (VS) Code if using JavaScript.
  • Use Prettier (for JavaScript, CSS, HTML, and relevant VS Code extension) and Black ( for Python) for automated code formatting.
  • Use Jest and VS Code's Jest extension (Orta's) for automated tests within the editor.
  • For deployment, I roll my own using Docker container. As a one-man shop, I try to minimize sysadmin/DevOps works by off-loading as much as I can to the Cloud service providers by going the managed/zero-ops direction.
  • CodeSandbox.io, REPL.it etc are amazing for testing out various stuff without downloading stuff. You can get a React/Vue/whatever environment within seconds that will give you a public url for your app.
  • json-server in NPM will get you a mock REST API with GET/POST/etc support within seconds from a JSON file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment