This guide could be used to deploy a Node.js application onto any VPC, such as Amazon EC2, Linode, even a Raspberry Pi.
GitHub repository: https://github.com/TomDoesTech/caddy-nodejs-docker-tutorial
The diagram below visualizes what you will build as a result of following this guide. Requests will come into the VPC, in this case, a DigitalOcean droplet, they will hit the Docker application running Caddy. Caddy will reverse proxy the request to…
In this guide, we are going to build a REST API with Node.js, TypeScript, and MongoDB. This guide is for junior to mid-level developers that want to build APIs like a senior developer.
Finished repository: https://github.com/TomDoesTech/REST-API-Tutorial
Note: This guide uses commands like
touch. For those that are unfamiliar,
mkdir will make a new directory and
touch will create a new file. These commands will work on a Mac or Linux OS, but will not work on a Windows machine as far as I’m aware.
Note 2: For the best learning outcome, watch the video…
In my previous article, we looked at how we can integrate Mongoose and TypeScript to create strongly typed models manually. In this article, you will learn how to create Mongoose models & TypeScript types simultaneously with Typegoose.
See final repository: https://github.com/tomanagle/Typegoose-example
What’s the problem?
Often, the data shapes used throughout our applications start at the model level. We then replicate these data shapes with TypeScript so we can represent the data through the application. Typegoose aims to eliminate the need to create our data shapes in both Mongoose & TypeScript and keep the shapes synchronized throughout the development lifecycle.
In this guide, we will be building a GraphQL API with NestJS. NestJS is a NodeJS framework designed for building scalable, efficient, and reliable applications. The framework is open-source and has easy to follow documentation.
As a result of following this guide, you will have a GraphQL API built on top of NestJS that can be deployed in a Docker container. The GraphQL layer will be developed with TypeGraphQL, reducing the need for TypeScript & GraphQL boilerplate.
⭐You can find the finished repository here⭐: https://github.com/tomanagle/GraphQL-NestJS-MongoDB-TypeScript-Tutorial
⚠️Warning⚠️: NestJS comes with a lot of boilerplate. If you haven't used it before, you…
Almost every NodeJS developer would be familiar with the error message
Error listen EADDRINUSE: address already in use. The message simply means that the application could not start because there is already a process using that port. Here is the easiest way I have found to stop a process running on your Mac that is using a specific port.
stopto this directory:
You can easily do this by typing:
2. Past the following script into the file:
3. Save the script and start using it
You can use the script by…
In a previous post, we explored how to integrate TypeScript with your Mongoose models. In this post, we’ll move up to the service layer and see how we can use Mongoose types to get even more out of your application's Mongoose & Typescript implementations.
Firstly let’s answer some basic questions about the service layer: what is a service layer and how do I use it?
The service layer is used to encapsulate implementations of an application’s business logic and provide an API for invocation of that logic in a consistent way.
Services are functions that perform common tasks on your…
Have you got several projects on the go that you’ll probably never finish? Yeah, me too. In this post, I will go through what I did to successfully develop and launch my latest side project. As a result of reading, I hope to inspire you to finish developing and launch one of your side projects.
Since I started working from home and haven’t been able to leave the house for anything non-essential, I have gained a lot of time and a nice home office setup.
Around the start of April, I made a conscious decision to spend my time creating…
In this post, you will learn how OAuth integrations work and specifically how you can set up a Google OAuth integration with your own Node.js application.
GitHub repository: https://github.com/tomanagle/google-oauth-tutorial
Note: This guide does not use Passport
Setting up an OAuth integration for the first time can be a little confusing. Luckily, most OAuth integrations, including Google, follow the same flow:
In this article we will explore five ways to create a HTTP server with Deno, using the standard library and four packages.
You can find all the code here: https://github.com/tomanagle/deno-http-servers
Note: None of these solutions is a great choice for a brand new application. Deno is not ready for you to risk your job with, so…
In 2018, Ryan Dahl, the creator of Node.js, presented at JSConf on 10 things he regrets about Node.js. In the presentation, Dahl confessed that he couldn’t change Node.js now - It runs on millions of machines worldwide and is loved by millions of developers. So what do you do when you can’t change the old version? You move some of the letters around and create a brand new language.
In May 2020, Ryan Dahl, Bert Belder, and Bartek Iwańczuk announced Deno 1.0.
In the 2019 Stackoverflow developer survey, 50.4% of professional developers said they use Node.js. There’s a good…