How to Build and Structure a Node.js MVC Application

In a non-trivial application, the architecture is as important as the quality of the code itself. We can have well-written pieces of code, but if we don’t have good organization, we’ll have a hard time as the complexity increases. There’s no need to wait until the project is half-way done to start thinking about the architecture; the best time is before starting, using our goals as beacons for our choices.

Node.js doesn’t have a de facto framework with strong opinions on architecture and code organization in the same way that Ruby has the Rails framework, for example. As such, it can be difficult to get started with building full web applications with Node.

In this tutorial, we’re going to build the basic functionality of a note-taking app using the MVC architecture. To accomplish this, we’re going to employ the Hapi.js framework for Node.js and SQLite as a database, using Sequelize.js, plus other small utilities, to speed up our development. We’re going to build the views using Pug,..

Continue Reading

Need to Edutain Your Kids While Distancing? Here Are Our Suggestions

We've found ourselves with more kids at home, and not enough productive and educational activities to do while schools ramp up their online learning capabilities. So we took to our library to see what we could dig up to keep them engaged with learning, and us able to focus on doing our own remote work.

Are you also looking for a way to educate and entertain your kids while they're stuck at home?

We've put together a list of fun books that'll keep your kids occupied and teach them valuable skills at the same time!

Starting with…

The post Need to Edutain Your Kids While Distancing? Here Are Our Suggestions appeared first on SitePoint.

Continue Reading

20 Essential React Tools for 2020

The React ecosystem has evolved into a growing list of dev tools and libraries. The plethora of tools is a true testament to its popularity. For devs, it can be a dizzying exercise to navigate this maze that changes at neck-breaking speed. To help navigate your course, below is a list of essential React tools for 2020.

GitHub stars: 140,000+
developer: Facebook
version: 16.8
contributors: 1,300+
Hooks are a new addition to React as of version 16.8. They unlock useful features in classless components. With Hooks, React no longer needs lifecycle methods such as componentDidMount to manage state. This encourages separation of concerns because components are not managing their own state. Putting a lot of state management inside class components blows up complexity. This makes stateful components harder to maintain. Hooks attempt to alleviate this problem by providing key features.

The following basic H..

Continue Reading

15 Easy-to-Use Tools & Services to Improve Your Workflow

This sponsored article was created by our content partner, BAW Media. Thank you for supporting the partners who make SitePoint possible.

There's no lack of tools and services out there that you could put to use to improve your products or your business. Also, to increase your productivity, or save you time and money.

It's quite the opposite in fact. There are so many that finding one or more that will satisfy your most urgent needs can be a problem in itself. Some of the tools you use or services you subscribe to today may have served you well, but there's no guarantee they will continue to do so.

The very nature of web design demands that you keep up with the latest trends to stay abreast or keep a step ahead of the competition. That often requires finding new tools or services that will enable you to do so.

We hope this list of top tools and services for 2020 will serve to help you stay on top of your game and increase your productivity as well.

The post 15 Easy-t..

Continue Reading

The Rise of the No-Code Movement

In the internet age, technological innovation has largely been driven by a community of software engineers, web developers, and hardware hackers. Until recently, acclaimed startup accelerator Y Combinator only accepted founding teams with technical backgrounds. Furthermore, the most valuable companies of today are tech-enabled, so there’s been a focus on tech talent for future-proofing economies. Coding education provider Lambda School has raised close to $50M to close this skills gap and there are many other courses teaching the next generation to code.

But what if coding was no longer vital to success in tech? Enter the world of no-code development platforms (NCDPs).

Over the past couple of years, the rise of the no-code movement has started to change the landscape of tech. Ironically, Lamdba School itself is a product of the no-code movement, building its MVP (that has served 3,000 students) using a combination of tools such as Typeform, Airtable, and Retool. The no-code movemen..

Continue Reading

Managing Dates and Times Using Moment.js

Working with dates and times has always been a bit cumbersome. I've always thought that a JavaScript library for manipulating dates would be quite helpful. It was only recently that I was introduced to Moment.js, the awesome JavaScript library for validating, parsing, and manipulating dates and times.

Getting Started with Moment.js
Moment.js is freely available for download from the project's home page. Moment.js can be run from the browser as well as from within a Node.js application. In order to use it with Node, install the module using the following command.

npm install moment

Then, simply require() and use it in your application as shown below.

var moment = require('moment');


In order to run Moment from the browser, download the script and include it using a script tag, as shown in the following example. Moment.js creates a global moment object which can be used to access all the date and time parsing and manip..

Continue Reading

How to Migrate a React App to TypeScript

When I first started learning TypeScript, one of the suggestions I often heard was, “convert one of your existing projects! It's the best way to learn!” Soon after, a friend from Twitter offered to do just that — show me how to migrate a React app to TypeScript.

The purpose of this article is to be that friend for you and help you migrate your own project to TypeScript. For context, I will be using pieces from a personal project which I migrated while going through this process myself.

The Plan
To make this process feel less daunting, we'll break this down into steps so that you can execute the migration in individual chunks. I always find this helpful when taking on a large task. Here are all the steps we'll take to migrate our project:

Add TypeScript
Add tsconfig.json
Start simple
Convert all files
Increase strictness
Clean it up
NOTE: the most important step in this whole process is number 9. Although we can only get there by working through them in s..

Continue Reading

Quick Tip: Configuring NGINX and SSL with Node.js

NGINX is a high-performance HTTP server as well as a reverse proxy. Unlike traditional servers, NGINX follows an event-driven, asynchronous architecture. As a result, the memory footprint is low and performance is high. If you’re running a Node.js-based web app, you should seriously consider using NGINX as a reverse proxy.

NGINX can be very efficient in serving static assets. For all other requests, it will talk to your Node.js back end and send the response to the client. In this tutorial, we’ll discuss how to configure NGINX to work with Node.js. We’ll also see how to setup SSL in the NGINX server.

Note: Node also has a built-in HTTPS module and can be configured to read the necessary certificate files without the need for a reverse proxy. You can find out more about this in our article How to Use SSL/TLS with Node.js.

Installing NGINX
Assuming you already have Node.js installed on your machine (if not, check here), let’s see how to install NGINX.

Installation on Linux
If you’re ..

Continue Reading

10 Git Techniques You Need to Know Before You Join a Team

Have you been using Git for some time but never in a team environment? Are you familiar with the basics of Git but unsure how large teams use Git at work?

In this post, I’ll talk about the basic Git techniques that you must be familiar with before you join a team. I’ve listed them in an order that you’d logically follow to contribute to a repository, as the importance of each step is paramount. Let’s now jump into the list.

1. Cloning: Getting Started in a Team
If you’ve used Git for personal projects, you may only have initialized a project from scratch and added to it over time. When you’re working on an existing codebase, the first step is to clone the codebase into your local system. This enables you to work on your copy of the repository without any interference from other changes.

To clone a repository, run the git clone command, followed by the path to the repository:

git clone /path/to/repo

If your source doesn’t reside in the same system, you can SSH to a remote system an..

Continue Reading

Build a Native Desktop GIF Searcher App Using NodeGui

NodeGui is an open-source library for building cross-platform, native desktop apps with Node.js. NodeGui apps can run on macOS, Windows, and Linux. The apps built with NodeGui are written using JavaScript, styled with CSS and rendered as native desktop widgets using the Qt framework.

Some of the features of NodeGui are:

native widgets with built-in support for dark mode
low CPU and memory footprint
styling with CSS including complete support for Flexbox layout
complete Node.js API support and access to all Node.js compatible npm modules
excellent debugging support using Chrome's DevTools
first-class TypeScript support
NodeGui is powered by the Qt framework, which makes it CPU and memory efficient compared with other Chromium-based solutions such as Electron. This means that applications written using NodeGui do not open up a browser instance and render the UI in it. Instead, all the widgets are rendered natively.

This tutorial will demonstrate how to install NodeGui and use it ..

Continue Reading