As patterns go, REST APIs are so useful and ubiquitous that every web developer, regardless of language or platform, should know how to build one.
JSON web tokens (JWTs) provide a method of authenticating requests that’s convenient, compact, and secure. More often than not, Angular apps will include them in their data flows.
In this tutorial, Toptal Freelance Software Engineer Sebastian Schocke shows how to implement JWT authentication in an Angular 6 single-page application (SPA), complete with a Node.js back-end.Continue reading →
Online users are becoming increasingly resistant to traditional email/password registration processes. One-click social logins via Facebook, Google, or GitHub are better, but they come with data privacy trade-offs.
This article introduces a one-click, cryptographically-secure login flow using MetaMask, with all data stored on the app’s own back-end.Continue reading →
Dealing with a real database for integration and end-to-end testing can pose some challenges. One way of working around them is to use an in-memory database that integrates well with the testing framework and provides APIs to manipulate its state from test code.
In this article, Toptal Freelance Software Engineer Mikhail Angelov shows how you can write integration and end-to-end tests easily for your Node.js and MongoDB application without having to write complicated setup/teardown code.Continue reading →
Asynchronous programming used to be a challenge even for seasoned professionals, leading to aptly named phenomena like Callback Hell.
Serverless computing is an architecture style in which the code is executed in a cloud platform where we don’t need to worry about the hardware and software setup, security, performance, and CPU idle time costs. It’s an advancement of cloud computing that goes beyond infrastructure that abstracts the software environment as well. It means no configuration is required to run the code.Continue reading →
Understanding the Input/Output (I/O) model of your application can mean the difference between an application that deals with the load it is subjected to, and one that crumples in the face of real-world uses cases. Perhaps while your application is small and does not serve high loads, it may matter far less. But as your application’s traffic load increases, working with the wrong I/O model can get you into a world of hurt.Continue reading →
Your software isn’t fully tested until you write integration tests for it. While unit tests help ensure that functions are properly written, integration tests help ensure that the system is working properly as a whole.
In this article, Toptal Software Engineer Luka Blažecki uses Node.js to explain why integration testing is important for every development platform and how to write clean, composable integration tests.Continue reading →
When dealing with web-based projects that run in the production environment, being able to build and deploy changes quickly is a top priority. However, repetitive processes such as building front-end assets, when not automated, can be prone to critical errors.
In this article, Toptal Freelance Software Engineer Chuoxian Yang explores four of the most popular Node.js web frameworks and discusses how each framework stands out from the rest of the crowd in Node.js.Continue reading →
Node-RED, built on Node.js, is a tool designed for programming visually without having to write any code. It comes equipped with a browser-based flow editor that allows hardware devices and APIs to be connected with each other easily, making it an ideal tool for rapidly developing programs for IoT devices.
In this article, Toptal freelance software engineer Jesús Darío Rivera walks us through the process of building a simple program using Node-RED and Netbeast along with a virtual light bulb plugin that mimics the capabilities of a real smart bulb.Continue reading →
Streams are a powerful construct in Node.js and in I/O driven programming in general. Gulp, a tool for task automation, leverages streams in elegant ways to allow developers to enhance their build workflow.
In this article, Toptal engineer Mikhail Angelov gives us some insight into how Gulp works with streams by showing us step-by-step how to build a Gulp-like build automation tool.Continue reading →
Writing code that is easily testable takes some effort and planning. However, some patterns exist that can be used to write simple and functional code, making it easier to test them when the time comes.
An operating system written in Node.js? Yes, it exists, and it’s called NodeOS. Think for a second about the progress Node.js has made in the short time it’s been around. Now, imagine the same thing happening with an operating system.
In this article, Toptal engineer Danny Morabito introduces us to NodeOS, guiding us with a step-by-step tutorial on how to create our first NodeOS application using nothing more than Node.js.Continue reading →
Memory leaks in long running Node.js applications are like ticking time bombs that, if left unchecked in production environments, can result in devastating outcomes. These bugs are often considered to be hard to find. However, with the right tools and a strategic approach, memory leaks can not only be solved but also avoided in the future. In this article, Toptal engineer Vladyslav Millier gives us insight into what memory leaks are, how some sophisticated debugging tools can be used to find memory leaks, and how to plug them once and for all.Continue reading →
Inheriting someone else’s code can be a nightmare, especially when the code is poorly designed and lacks documentation. In this post, Toptal Engineer Juan Pablo Scida provides a case study of how he reengineered a chat server written in Node.js, transforming its original spaghetti code into a cleanly architected and designed piece of software.Continue reading →
WebRTC has opened doors to all kinds of new peer-to-peer web applications and games that can run in the browser without the need of additional plugins. However, being a relatively new technology, it still poses some unique challenges to developers. PeerJS aims to tackle some of those challenges by providing an elegant API and insulating developers from WebRTC’s implementation differences. In this article, Toptal engineer Mahmud Ridwan provides an introductory tutorial to building a simple, peer-to-peer web game using PeerJS.Continue reading →
In-memory data collection manipulation is something that we often need to do in data-centric reporting and visualization applications. When needed, we often tend to resort to complex loops, list comprehensions, and other suboptimal means, which can easily end up being a huge mess of hard-to-maintain spaghetti code. Supergroup.js is an in-memory data manipulation library that can be used to solve some common data manipulation challenges on limited datasets.Continue reading →
Programming is about having fun and enjoying the process of creating something cool. That is why we decided to build a bot-vs-bot game platform around Battleship and make it open source. In this article, we take a look at the code and mechanics of the extensible engine behind this platform.Continue reading →
While Ruby has Rails and Python has Django, the dominant application development framework for Node has yet to be established. But, there is a powerful contender gaining steam: LoopBack, an open source API framework built by StrongLoop, the creators of Express.
Let’s take a closer look at LoopBack and it’s capabilities by turning everything into practice and building an example application.Continue reading →
Deploying instances of a web application to one or more servers manually can often be a monotonous process, and take up a significant amount of your time. With little effort, it is possible to automate the process of deploying your web application with almost zero human intervention. This article outlines a simple approach to automating web application deployments using GitHub webhooks, buildpacks, and Procfiles.Continue reading →
Developers often automate certain repetitive and tedious tasks to save time as well as to stay focused on the task at hand.
This article demonstrates how simple and easy it is to use Gulp as a build tool.Continue reading →
Node.js, the cross-platform runtime environment, has seen its fair share of praise and criticism for what it offers to developers. Often, reasons for such criticisms are rooted in how developers use/misuse the language.
This article explores ten common mistakes that Node.js developers make and how to avoid them.Continue reading →
AllcountJS is an emerging open source framework built with rapid application development in mind. It is based on the idea of declarative application development using JSON-like configuration code that describes the structure and behavior of the application.
In this article, we walk through a step-by-step tutorial for prototyping a data oriented web application using AllcountJS.Continue reading →
As is known worldwide, the Chinese government enforces strict censorship on the internet. Virtually everything is under the government’s surveillance. In order to be allowed to operate, ISPs and internet content providers in China usually have their own content filtering mechanism for blocking or removing the published content by its users, or even deleting users’ account directly if they are assumed to be illegal under the government policy.Continue reading →
As modern web applications do more and more on the client-side (the fact itself that we now refer to them as “web applications” as opposed to “web sites” is quite telling), there has been rising interest in client-side frameworks. There are a lot of players in this field but for applications with lots of functionality and many moving parts, two of them stand out in particular: Angular.js and Ember.js.
Angular.js has already been introduced on this blog, so we’re going to focus on Ember.js in this post, in which we’ll build a simple Ember application to catalog your music collection. You’ll be introduced to the framework’s main building blocks and get a glimpse into its design principles.Continue reading →
Node.js shines in real-time web applications employing push technology over websockets. What is so revolutionary about that? Well, after over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely. This is in stark contrast to the typical web response paradigm, where the client always initiates communication. Additionally, it’s all based on the open web stack (HTML, CSS and JS) running over the standard port 80.Continue reading →
After much thought, I decided to engineer a solution to the idea abandonment problem. I call it the ‘Init’ project (or Init.js).
The core of the idea is to have a single project to start them all, to let the developer or the technical founder make all of the essential decisions at once, and receive an appropriate starting template based on those decisions.Continue reading →
At Toptal, we’re always looking for the best freelancers around. But what makes a freelancer truly great? Luis Martinho, one of our top developers, is beloved by his clients — so we sat down with him to talk about freelancing, technologies, and paying your taxes.Continue reading →