Build and deploy a REST API with Deno

In this course, we will learn how to create and deploy a REST API with Deno from scratch.

5.0 46 students started

Published |Updated

What You Will Learn

How to create an application in Deno

Integrating databases into your application

Importance of database migrations in production applications

Deploying Deno applications to production using CICD

Dockerized Deno applications

Developing using TypeScript

In this course, we will learn how to work with Deno to create a REST API using TypeScript with the web framework Oak and the migration tool Nessie. Deno is a JavaScript runtime created by Ryan Dahl, the same creator for Node, as an attempt to simplify the JavaScript landscape by strictly following the WebAPI specs. If you are interested in learning more about the motivation behind Deno, you can watch this video where Ryan Dahl explains "10 Things I Regret About Node.js"

We will explore how to create an application using the powers of TypeScript, and learn how to traverse the Deno ecosystem which is much like the native web ecosystem. There are 5 modules that will take you from installing Deno and running your first lines of code, to working with web frameworks and databases, and in the end, deploying your application to a web server using a deployment pipeline.

Throughout this course, you will experience all the different aspects of Deno which you will need to create your own application in the future. And from this course, you will get a good feeling for if Deno is ready to be your next default for new projects.

Course Content

5 modules39 lessons

Introduction

2 lessons

Welcome to Build and Deploy a REST API with Deno!

Introduction to the newline guide to building and deploying a REST API using Deno.

INTRODUCTION

Setting up our environment

In this lesson, we will install Deno and create our setup for the rest of the course.

PROLOGUE

Getting Started with Deno

6 lessons

Deno Introduction

Introducing Deno and its history

INTRODUCTION

Deno REPL

We will look at the command line interface for running Deno

LESSON

Using Deno

In this lesson, we will look at general usage of Deno by running a file and also introduce the config file

LESSON

Deno Standard Library

Learn how to use the Deno standard library and other external modules with URL imports

LESSON

Deno Server

We will build our first server in Deno

LESSON

Token Authentication

You will learn how to make a simple token authentication in Deno

LESSON

Connect to a database

4 lessons

Using databases with Deno

Introducing Deno databases

INTRODUCTION

PostgreSQL

Using the PostgreSQL client for Deno

LESSON

MySQL

Using the MySQL client for Deno

LESSON

SQLite

Using the SQLite client for Deno

LESSON

Database migrations

7 lessons

Database Migrations

Introduction to database migrations - what, why and how

INTRODUCTION

Getting started with Nessie

Get started with database migrations using Nessie

LESSON

Create Migration

We will go through creating a migration using the Nessie CLI

LESSON

Edit Migration

We will look at how to write a migration script where we create a table

LESSON

Run Migration

We will run our migration and learn how to roll back the migration

LESSON

Create Seed

We will create a seed file using the Nessie CLI

LESSON

Seed Database

We will run our seed file and populate our database

LESSON

REST API

14 lessons

REST API Introduction

Introduction to the concept of REST APIs and why we use them

INTRODUCTION

Planning

We will go through the thought process of planning an application.

LESSON

Deno REST API Setup

We will create the initial project files and set up our environment

LESSON

REST API Endpoints

We will create the router and look at how to test our endpoints

LESSON

Databases and Nessie migrations

It's time to add Nessie! We will now initialize Nessie in our project and also spin up our development database

LESSON

DB Pool

Time to connect our models to our database!

LESSON

Duck Model

In this step, we will create our first data model and create a corresponding table using a migration

LESSON

Duck Service

Creating the methods to access the database

LESSON

Duck Controller

Creating the server endpoints for the Duck namespace

LESSON

Authentication and Authorization

We will look at how to set up authentication and further authorize the requests

LESSON

Quack & Crumb Model

We will create two new tables using a migration and create the equivalent models

LESSON

Quack Service & Controller

We will create our Quack service and controller

LESSON

Crumbs

The last stretch! We will create our final namespace, Crumb, and connect it to our other models and our router

LESSON

API Afterthoughts

Now that our application is completed, we will consider some improvements and discuss alternative approaches.

CONCLUSION

Deployment

6 lessons

Deployment Introduction

We will introduce deployments and what we will learn in this module

INTRODUCTION

Docker Image Creation

We will create a Docker image for our application

LESSON

Continuous Integration

You will learn how to create a basic CI file for GitHub and GitLab, and run tests on them

LESSON

Deploy with SSH and Git

We will deploy our application to a server using CI, SSH and git.

LESSON

Deploy with Digital Ocean Apps

We will deploy our application to Digital Ocean Apps. This is by far the easiest (but most costly) approach.

LESSON

Deploy with Docker

Similar to how we did it in lesson 1, we will be deploying using CI and SSH, but instead of git, we will be using Docker.

LESSON

Your Instructors

Profile image for halvardm

Halvard

👋 Hi! I'm Halvard Mørstad, a Software Engineer and eternal student. As the creator of Nessie and contributor to the Deno Drivers projects, I wanted to share my knowledge with you so that you can get started with making powerful backends in Deno!

I have worked with web development for around half a decade, and have built a multitude of apps for work and hobbies. I hope to be able to present you with some of the knowledge and experience I have acquired over the years, and to help you on the way of learning the next generation of JavaScript and TypeScript development.

Frequently Asked Questions

Who is this course for?

This course is for any skill level, from junior to senior, who wants to learn more about Deno and how to utilize it in production.

What are the prerequisites?

Basic knowledge about JavaScript (TypeScript), SQL and Git is assumed.

What is expected of me?

The interest in learning about Deno and how to make an application using it!

What if I need help?

You can ask us questions anytime through the community Discord channel or by sending us a message.

OrGet this course and every newline Book and Guide with a newline Pro subscription for just $20/mo

$39

$49

Build and Deploy a REST API with Deno

$39

$49