Code Monkey home page Code Monkey logo

todoist-api's Introduction

Build a REST API with Node.js, Mongoose & TypeScript

Note: This repository includes the postman collection for the finished API

Note 2: Make sure you add .env to your .gitignore before pushing any changes to your repository. You will also want to generate new public & private keys

Base64 encode the keys: https://www.base64encode.org/

Common issues

Who is this tutorial for?

  • Junior to mid-level developers
  • Anyone interested in building REST APIs with TypeScript

What you will need

  • A running instance of MongoDB
  • Postman
  • An IDE or text editor (VS Code)
  • A web browser
  • A package manager such as NPM or Yarn
  • Node.js installed

What next?

  • Testing the API with Jest
  • Build a React.js user interface
  • Add Prometheus metrics to the API
  • Deploy the API with Caddy & Docker
  • Add Google OAuth

Concepts

  • REST API principals
    • CRUD
    • HTTP methods
  • JWT & refresh tokens
  • Request validation

Technologies

  • Node.js
  • MongoDB with Mongoose
  • TypeScript
  • Express.js & Express.js middleware
  • Zod validation

Video structure

  1. What are we going to build (Postman demo)
  2. Code walk-through
  3. Bootstrap application
    1. Setup express JS
    2. Create routes function
    3. Setup database connection
    4. Setup logger
    5. Validate request middleware
  4. Registration
    1. Create user model
    2. Create user endpoint
    3. Create user session
    4. Deserialize user middleware (refresh tokens)
    5. Get sessions
    6. Delete session
    7. Require user middleware
  5. Task resource
    1. Create task model
    2. Create task
    3. Read task
    4. Update task
    5. Delete task

Data flow

Access & refresh token flow

Deployment

What will we use

  • Docker (image)
  • docker-compose (container)
  • Caddy - Web server
  • DigitalOcean

Note: You will need Docker installed locally if you want to test your Docker configutation

Let's keep in touch

Buy me a Coffee

Sign up to DigitalOcean ๐Ÿ’–

todoist-api's People

Contributors

tomanagle avatar aka-rabbi-inv avatar aron-hd avatar aliensb avatar

Watchers

Ahmed Aziz Abbassi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.