If this stuff sounds familiar, you’re not alone.
We are all new to software development at one point in time, so instead of shaming someone just because they’re new, let’s write a thoughtful post that tries to help the situation.
Most blogs and tutorials assume some base level of knowledge about deploying your own code. So I will try to help out at that.
For development in your local machine, you’ll need to install a browser, NodeJS and your text editor of choice. This will allow you to write code and test them without having to use live server. Node already includes NPM, and developers tend to use
npm start or
node server.js which will look for .js file named server, which usually is responsible for running the app.
There are some useful NPM modules for development, such as Nodemon, which will restart Node when your code changes, so you don’t have to
Why do I need a server?
In that case, you’ll need to setup back end stack properly and then simply build the front end using build tools such as Gulp or Webpack. Laravel Framework is a perfect example to this, as it uses PHP in the back end and you can use Vue or React for the front end. There is also a third alternative, called the JAMstack which comes from the popular surge of serverless software architecture. So yeah, it depends on what you want to build.
This is just too much.. 🤯
Deployment to Production
Assuming you have a working app in the development machine, you’ll then need to deploy them to a production server for sharing your app to the whole world. The process will be different depending on what or where you put up the server, but in general, you might have a Linux machine (usually Ubuntu) that have Apache or Nginx server running. Whatever you’re using, please note you need to have SSH permission so that you can install NodeJS and NPM dependencies on the server. If you’re using Gulp or Webpack You will then run a production build, which usually outputs everything into a
build directory. Also don’t forget to start the app to make it accessible.
npm start or
node server.js? Hit ‘em up. There is also a free but very useful Node process manager for production servers named PM2, which gives you benefit such as monitoring, logging events and restarting node app when the server restart. I hope this post addressed some of the things developer community tends to left out in the dark.