Tutorials

Using Azure DocDB with Node.js

Submitted by admin on
Moving your project to a cloud might be a difficult task especially since there are so many different cloud services out there. AWS is the most popular one and Azure is a very close competitor. In this article I will show you how to start using Azure, namely its NoSQL database service - DocDB. NOTE: Azure is a great platform, however it has significantly less tutorials and examples available online (compared to AWS). Before we start to write the code we will need to prepare the dependencies.

Uploading data to Amazon S3 from Node.js

Submitted by admin on
What can be simpler than uploading file to the server and saving it to hard drive, right? Open read stream, read bytes, open write stream, write bytes, done. Now let's explore the same question but from a high-load high-availability service perspective. You're designing new Instagram, where will you store the photos? Remember, at a bare minimum you need to make sure that a failure to a single node in a data center will not interrupt your service (you can't allow to lose those precious cat pictures that your users are uploading).

Implementing Facebook Authentication With Node.js

Submitted by admin on
In this small project we'll see how to implement Facebook authentication for your Node app with a help of Passport.js. Facebook authentication might sound like a lot of work but with the help of Passport, it is a surprisingly easy task. To give you a good feeling about the volume of code that you're about to write: It is about 80 lines of JavaScript and couple more lines of HTML. Before we start let's see how our application will look like. This is a truely minimalistic app with two pages: a login page and a "secret" page that only authenticated users are allowed to see.

Simple Ordering System with Cash as Method of Payment and Receipt Report

Submitted by rinvizle on
In this tutorial we will show you how to create a Simple Ordering System with Cash as Method of Payment and Receipt Report. This simple system is created for ordering and adding a product. Every product that the admin created will be added to the system, and every product that the customer had been ordered has a discount. The system can also generate a receipt.

Logging in Node.js

Submitted by admin on
Logging is one of the most undervalued and most important features of an enterprise application. Logs is what makes a difference between spending sleepless nights catching a mysterious bug or reading a clear message about what exactly caused an application to crash. It is not just important to write logs. It is important to write logs in a right way. In this article we'll look at most popular Node.js logging solutions and how to use them in your application. console.log ----------------- Option #1 - console.log().

Deploying Node.js production. Part 1: Using pm2.

Submitted by admin on
Once the development is complete - you are ready to share your application or with the world. Here comes the question: how exactly do you deploy it? Obviously, you can't just run "node main.js" and leave it like that. If the application crashes due to untested error or out of memory, you don't want your service to be interrupted. Instead the applicatoin should be automatically restarted, giving you some extra time to investigate the issues. NOTE: have you completed my other tutorials about building Node.js web chat and web game?

Building HTML5 Multiplayer Game with Node.js

Submitted by admin on
In a previous tutorial, I showed how to build a Socket.IO chat and connect few people around the globe with the magic of WebSockets. In this article I want to make this project a little bit more fun and turn it into a multiplayer game: "rock, paper, scissors". So let's grab the previous code and introduce few modifications.