thakursachin467 / nodejs-starter-code

NodeJs Starter Code for building API's. A boilerplate for NodeJs web applications API's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is boilerplate or Starter Code?

A boilerplate is a unit of writing that can be reused over and over without change. By extension, the idea is sometimes applied to reusable programming as in "boilerplate code." This is why Starter Code are imporant because you don't want to write same code again and again.

Why this Starter Code?

Every time we start a new project, we’re overwhelmed at the selection of build tools, testing frameworks, component libraries and more. Best solution? A starter kit

This starter kit will provide following purposes:

  1. It encourages consistency.
  2. It avoids repeating work.
  3. It protects from forgetting important details. Sometimes it's very common that you forgot some important libraries and imports and it can waste alot of time in debugging. Starter Kit or boiler plate also helps beginner with getting started with the NodeJs API as fast as possible.

What this starter kit include

It includes api routes for auth where you can easily start with login and register with nodejs and mongoDb(Mongoose) as fast as possible. You can easily expand this project with a proper folder structure which is properly organised in an easy and understandable manner.

How to use this starter code

1. Install NodeJS 🤗

you can get the Latest version of NodeJS from here [The Official NodeJS website] follow the instructions and you’re Good to go.

2. Clone or Download this Repository 🤠

3. Run npm install 🤓

	this will install all the dependecies in you machine

4. Getting started with database 🧐

The database user here is Mongoose which is a MongoDB object modeling tool designed to work in an asynchronous environment. You can get started with mongoose (https://mongoosejs.com/docs/) or you can read thisawesome article on getting started with Mongoose. Fill your databse url in the keys_dev.js file inside the config folder.

5. Run start script with npm start 😇

you can alse run npm start-dev to start the server with Nodemon. Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.

6. And you're good to go. ☺️

You have a starter code with Login and Signup routes. You can add more routes and reasily expand your server with More API's. Happy hacking 🤗🤩😈

What is NodeJs 🤔

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Features of Node.js 😍

Following are some of the important features that make Node.js the first choice of software architects.

Asynchronous and Event Driven − All APIs of Node.js library are asynchronous, that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.

Very Fast − Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast in code execution.

Single Threaded but Highly Scalable − Node.js uses a single threaded model with event looping. Event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.

No Buffering − Node.js applications never buffer any data. These applications simply output the data in chunks.

License − Node.js is released under the MIT license.

Who Uses Node.js? 🤑

Following is the link on github wiki containing an exhaustive list of projects, application and companies which are using Node.js. This list includes eBay, General Electric, GoDaddy, Microsoft, PayPal, Uber, Wikipins, Yahoo!, and Yammer to name a few.

Why use NodeJs? 🤠

First of all, using Node.js as your server technology gives your team a great boost that comes from using the same language on both the front end and the back end. This, means that your team is more efficient and cross-functional, which, in turn, leads to lower development costs. In addition to that, it’s worth mentioning that JavaScript is the most popular programming language, so your application’s codebase will be easier to understand for more engineers. You can also reuse and share the code between the frontend and the backend parts of your application, which speeds up the development process. On top of that, the Node.js community is constantly growing – the number of StackOverflow questions is steadily increasing, so the knowledge base for the technology is widely available. The fact that the whole Node.js technology stack is open-source and free is also great news. Finally, Node offers a great package manager, npm, and the amount of available open-source tools in npm’s registry is massive and growing fast. These are just a few of many advantages of Node.js that you should consider when choosing the technology for your next project.

About

NodeJs Starter Code for building API's. A boilerplate for NodeJs web applications API's

License:MIT License


Languages

Language:JavaScript 100.0%