Posts

Quick Tip: Configuring NGINX and SSL with Node.js

Image
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 y...

Build a Native Desktop GIF Searcher App Using NodeGui

Image
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 a...

A Beginner’s Guide to npm, the Node Package Manager

Image
Node.js makes it possible to write applications in JavaScript on the server. It’s built on the V8 JavaScript runtime and written in C++ — so it’s fast. Originally, it was intended as a server environment for applications, but developers started using it to create tools to aid them in local task automation. Since then, a whole new ecosystem of Node-based tools (such as Grunt , Gulp and webpack ) has evolved to transform the face of front-end development. To make use of these tools (or packages) in Node.js, we need to be able to install and manage them in a useful way. This is where npm, the Node package manager, comes in. It installs the packages you want to use and provides a useful interface to work with them. In this guide, we're going to look at the basics of working with npm. We'll show you how to install packages in local and global mode, as well as delete, update and install a certain version of a package. We’ll also show you how to work with package.json to manage a...

5 Projects to Help You Master Modern CSS

Image
Many claim CSS is not a programming language. I agree — it's tougher . A mastery of CSS requires skills in design, determination, inventiveness, experience, as well as coding (especially when using preprocessors such as Sass ). CSS suggests layouts and styles to the browser. A browser can interpret those suggestions whichever way it chooses and, even then, the user or device can ignore or override any properties. Creating high-performance code which works well across all devices and screen resolutions is a challenge that few attempt or successfully complete. However, the rewards can be exhilarating. Starting with the easiest, the following project suggestions will help you on your journey to CSS mastery using books available at SitePoint Premium . 1. Make a Site Printer-friendly Visit a site you're working on and attempt to print (or print preview) a page. Are you happy with the results? HTML pages are a continuous medium which do not necessarily work well on printed medi...

How to Build Your First Discord Bot with Node.js

Image
Nowadays, bots are being used for automating various tasks. Since the release of Amazon’s Alexa devices, the hype surrounding automation bots has only started to grow. Besides Alexa, other communication tools like Discord and Telegram offer APIs to develop custom bots. This article will solely focus on creating your first bot with the exposed Discord API. Maybe the most well-known Discord bot is the Music Bot. The music bot lets you type a song name and the bot will attach a new user to your channel who plays the requested song. It’s a commonly used bot among younger people on gaming or streaming servers. Let’s get started with creating a custom Discord bot. By the way, you can join SitePoint’s Discord community with this link . Come talk tech with us and get notified about our new articles. Prerequisites Node.js v10 or higher installed (basic knowledge) a Discord account and Discord client basic knowledge of using a terminal Step 1: Set Up Test Server First of all, we need ...

How to Build a File Upload Form with Express and DropzoneJS

Image
Let’s face it, nobody likes forms. Developers don’t like building them, designers don’t particularly enjoy styling them, and users certainly don’t like filling them in. Of all the components that can make up a form, the file control could just be the most frustrating of the lot. It’s a real pain to style, it’s clunky and awkward to use, and uploading a file will slow down the submission process of any form. That’s why a plugin to enhance them is always worth a look, and DropzoneJS is just one such option. It will make your file upload controls look better, make them more user-friendly, and by using AJAX to upload the file in the background, it will at the very least make the process seem quicker. It also makes it easier to validate files before they even reach your server, providing near-instantaneous feedback to the user. We’re going to take a look at DropzoneJS in some detail. We’ll show how to implement it. and look at some of the ways in which it can be tweaked and customized....

How to Design for Screen Readers with Adobe XD CC

Image
When it comes to accessibility, designers tend to focus on colors (i.e. contrast) and UX copy (i.e. wording), whereas developers tend to focus on ARIA attributes (i.e. code that makes websites more accessible). This is due to the fact that, often enough, thick lines are drawn between “who does what”. Also, because creating accessible apps and websites isn’t considered to be exciting, this line is hardly ever questioned. Accessibility is still a black sheep, even in 2020. So , since UX copy is the responsibility of the designer and ARIA attributes are the responsibility of the developer, exactly whose responsibility is it to cater for screen readers? Since: Screen reader UX copy is expressed as Braille or dictation (so how do we communicate this when our UI tools are visual?) Implementation is developer territory (so can we really shift the responsibility of writing UX copy to developers?) As you can see, it’s a two-person job — and yet, the tools simply don’t exist to facilita...