Giter Site home page Giter Site logo

api-design-node-workshop's Introduction

API design Workshop

Ahmed Abdulrahman | Creative Developer @Oakwood

Requirements

In order to follow a long with workshop, make sure you install the followings:

  • Nodejs: Lastest version >= 10
  • Yarn or NPM: They are both package manager but yarn is prefered for version locking
  • Insomnia or Postman: they are REST client that allwos you to test calls to APIs.
  • MongoDB
  • Robomongo: Its a visual tool helping you manage Database MongoDB.

Tools

You need to have an Code Editor to start with the project. Pick you favorite:

Exercises

You need to check out to each exercise branch as the course progresses.

Hello World

branch - lesson-1

In this exercise, we'll be creating a simple Express based API in node:

  • Install dependencies with yarn or npm
  • Create a route that sends back some json
  • Create a route that accepts json and logs it
  • Start the server

Routing

branch - lesson-2

In this exercise, you'll be creating routes and sub routers for DB resources using Express routing and routers

  • Create a router for the Item resource
  • Create full crud routes and create placeholder controllers
  • Mount router on the root server

Create Schemas

branch - lesson-3

In this exercise, you'll be taking what you learned about Mongoose and MongoDb to create a Schema and Model for the Item resource.

  • Create a schema for the item resource
  • Add the correct fields (look at test)
  • Add the correct validations (look at test)
  • extra add compund index to ensure all tasks in a list have unique names

Controllers

branch - lesson-4

In this exercise, we'ill hook our routes up to our Models so we can perfom CRUD on the models based on the routes + verbs. That's exactly what controllers do.

  • Create CRUD Resolvers in helpers/crud.js
  • Create Controllers for the Item resources using the base CRUD resolvers

Authentication

branch - lesson-5

In this exercise, we'll be securing down our API using JWT's (JSON Web Token)

  • Create a Signup controller
  • Create a Signin controller
  • Create a protect middlware to lock down API routes

api-design-node-workshop's People

Contributors

ahmedabdulrahman avatar

Watchers

 avatar

Forkers

shirin-muataz

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.