• Stars
    star
    698
  • Rank 62,776 (Top 2 %)
  • Language
    JavaScript
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Course] API design in Node with Express v3

Course Code for API design in Node.js with Express, v3

Scott Moss & Frontend Masters

Resources

Course

This course has two parts, slides and excercises. The slides describe the excerices in detail. Each excercise has a starting branch and solution branch. Example lesson-1 and lesson-1-solution.

Exercises

Hello world Express

  • branch - lesson-1

In this lesson you'll be creating a simple Express based API in node, just to get your feet wet.

  • install dependencies with yarn (prefered for version locking) 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
  • test command - yarn test-routes or npm run test-routes

This exercise will have you creating routes and sub routers for our soon the be 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
  • ensure all tests pass by running test command

Create Schemas

  • branch - lesson-3
  • test command - yarn test-models or npm run test-models

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
  • ensure all tests pass by running test command

Controllers

  • branch - lesson-4
  • test command - yarn test-controllers or npm run test-controllers

So far we have routes and models. Now we need to 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 utils/crud.js
  • create controllers for the Item resources using the base crud resolvers
  • ensure all tests pass by running test command

Authentication

  • branch - lesson-5
  • test command - yarn test-auth or npm run test-auth

In this exercise you'll be locking down our API using JWT's.

  • create a signup controller
  • create a signin controller
  • create a protect middlware to lock down API routes
  • ensure all tests pass by running test command

Testing

THe other resources don't have any test, go ahead and write some!

More Repositories

1

front-end-handbook-2018

2018 edition of our front-end development handbook
HTML
4,187
star
2

front-end-handbook-2019

[Book] 2019 edition of our front-end development handbook
HTML
4,100
star
3

front-end-handbook-2017

2017 edition of our front-end development guide
HTML
3,824
star
4

front-end-handbook

The resources and tools for learning about the practice of front-end development.
HTML
1,795
star
5

learning-roadmap

The Front-End Developer Learning Roadmap by Frontend Masters
HTML
994
star
6

front-end-handbook-2024

A guide to modern front-end web development / engineering.
HTML
810
star
7

bootcamp

Frontend Masters Bootcamp
HTML
684
star
8

react-enlightenment

A thoughtful and complete introduction to React.
HTML
427
star
9

intro-node-js

[Course] Code for Introduction to Node.js
JavaScript
370
star
10

fullstack-graphql

JavaScript
369
star
11

fmmn

frontend masters minneapolis workshop notes
JavaScript
368
star
12

javascript-enlightenment

[Book] JavaScript (ES2015+) Enlightenment
HTML
301
star
13

api-design-node

[Course] API Design in Node.js code
JavaScript
256
star
14

gatsby-intro

Code for the Introduction to Gatsby course.
JavaScript
253
star
15

remix-fundamentals

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.
TypeScript
247
star
16

api-design-node-v2

[Course] API Design in Node.js, v2: REST & GraphQL code
JavaScript
233
star
17

intro-to-graphql

[Course] Introduction to GraphQL
JavaScript
191
star
18

advanced-remix

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.
TypeScript
181
star
19

intro-mongo-db

[Course] Introduction to MongoDB code
JavaScript
177
star
20

2015-02-13-React

[Course] Code for the 2015 React.js workshop with Ryan Florence
JavaScript
170
star
21

grid-flexbox-v2

Version 2 of the Flexbox and Grid course at Frontend Masters.
CSS
154
star
22

hardcore-functional-js-v2

Code for the Hardcore Functional JavaScript, v2 course
JavaScript
139
star
23

pure-react-state-management

Pure React State Management course documentation
136
star
24

service-workers-offline

Code for the Service Workers / PWA section of the Service Workers & Offline course by Kyle Simpson
JavaScript
132
star
25

serverless-with-aws

[Course] Serverless with AWS: Get a quick start into the world of Serverless functions with AWS Lambda.
JavaScript
131
star
26

advanced-graphql

[Course] Advanced GraphQL - Learn advanced practices and techniques when when building a GraphQL API.
JavaScript
111
star
27

advanced-gql-v2

Code for the Advanced GraphQL Course on Frontend Masters
JavaScript
108
star
28

fm-snippets

Code snippets for course annotations.
JavaScript
107
star
29

fm-transcripts

Transcripts of Frontend Masters Courses
86
star
30

ai-nodejs

JavaScript
70
star
31

react-state-management

64
star
32

angular-components

[Course] Code for the AngularJS 1.x Components & ES6 Course
JavaScript
57
star
33

hardcore-functional-architecture

JavaScript
54
star
34

react-web-starter

[Course] starter for react web app
JavaScript
53
star
35

ember-octane

Mike North's Ember Octane workshop
JavaScript
40
star
36

react-native-todo

[Course] Todo app for the React Native Course
Objective-C
32
star
37

ember-github-ui

[Course] Code for the Ember 2.x Course on Frontend Masters
JavaScript
28
star
38

sweat-book

[Course] Work out demo app for the React Native Course
26
star
39

observablish-values

JavaScript
23
star
40

web-workers

Code for the Web Workers section of the Service Workers course by Kyle Simpson
JavaScript
16
star
41

ember-commently

[Course] Code for the Comment.ly Ember.js app for the Advanced Ember 2.x course
CSS
12
star
42

ios-issues

Repository for managing publicly reported issues with the Frontend Masters iOS App
8
star
43

fullstack-app-next-starter

TypeScript
5
star
44

android-issues

Repository for managing publicly reported issues with the Frontend Masters Android App
5
star
45

blazingly-fast-js

JavaScript
4
star
46

javascript-fundamentals-v3

JavaScript
3
star
47

fem-htmx

JavaScript
2
star
48

gitbook-plugin-open-graph

Adds open graph and twitter share meta tags to gitbook
HTML
1
star
49

cielo24_php

[ARCHIVED] A PHP client library for the cielo24.com API
PHP
1
star