- CSE 341 - Web Services - Winter 2024
- Extra Material
- w01 - Introducing our tech stack
- w02 -
- w03 - HTTP Requests & Dev Tools (and, Linters and Formatters)
- w04 - API Documentation
- w05 - REST & JSON Alternatives
- w06 - Validation & Error Handling
- w07 - OAuth
- w08 - OAuth
- w09 - API Gateways and Managers
- w10 -
- w11 -
- w12 -
- w13 -
- Resources
- PROJECT IDEA: CMS (Content Management System)
- Lesson 01 π
- Videos:
- Intro: https://youtu.be/bUKgMUl5JyU
- VS Code: https://youtu.be/5FE7L8syBm4
- How to Install GIT on Windows, MacOS and ChromeOS: https://youtu.be/idN0wJqVTyo
- CSE 341 MongoDB setup (January 2023): https://youtu.be/g4V7n86mMr0
- Deploy Node js API with Env Variables on Render Automatically with GitHub Deploys: https://youtu.be/68ubggfsQlE
- Create Github Repository and save all your code there: https://youtu.be/bLPPQ0R5hj0
- Node and Express Tutorial: https://youtu.be/K00J87SofEc
- Visual Studio Code π
- Microsoft Teams π
- Node.js π
- YouTube Recorders: Zoom, Loom, Screencastify, screencast-o-matic, OBS Studio, best screen recorder for Windows π
- Git π
- Add to the PATH on Windows 10 and Windows 11 π
- GitHub π
- MongoDB Atlas π
- Building the API with Node.js
- (OPTIONAL) JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour π
- Node and Express Tutorial π
- Node docs π
- (OPTIONAL) YouTube: Node.js Tutorial for Beginners: Learn Node in 1 Hour π
- (OPTIONAL) YouTube search: nodejs for beginners π
- Even a simple web search like "nodejs web server example" can be extremely helpful. π
- Saving to GitHub
- What is API Deployment? A2 Hosting, Heroku, Amazon Web Services, DigitalOcean, Glitch, Google Cloud Platform, Microsoft Azure, Platform.sh, NodeChef, Render, Fly, Railway, Vercel, - Render
- Render π
- Testing your deployed API
- REST Client in VSCode π
- VSCode ESLint, Prettier & Airbnb Style Guide Setup π
- eslint.org/docs/latest/ π
- VS Code Autoformatter - Configuring Prettier π
- Setup ESLINT and PRETTIER in React app π
- (OPTIONAL) Youtube: Intro to API Documentation π
- What is API Documentation, and Why It Matters? π
- What is Swagger? π
- Create swagger.json from scratch (Design First) π
- Create swagger.json npm package (Development First) -
swagger-autogen
π- Swagger Autogen Docs π
- swagger-ui-express π
- Be aware that there are other resources for doing very similar types of API documentation. None of them appear to be as widely integrated with npm or as widely used in industry. Two other popular ones are Postman (which started off as just a rest client), and Readme. We will only use Swagger in this course.
- Repo: davibaltar/example-swagger-autogen π
- What is Data Validation? π
- A Clean Approach to Using
express-validator
π validatejs
- Validation in Node js Express Rest API π
- πΊ 7 - JOI Validation Schema to validate request body | Node JS API Authentication π
- Node.js Error Handling Made Easy: Best Practices On Just About Everything You Need to Know π
- Cleaner code in an Express REST API with unified error handling π
- πΊ Handling API Errors | RESTful API using NodeJS and MongoDB π
- From teacher:
- How to handle data validation in Node.js using validatorjs π
validation-express
- Lesson 7 π
- Class Solution π
- Website Authentication: The Complete Guide with FAQs π
- A Modern Password: 6 Top Tips for A Secure Login Process π
- RESTful API Authentication Basics π
- Authorization vs Authentication π
- OAuth 2.0 Playground π
- Whatβs the difference? OAuth 1.0 vs OAuth 2.0 π
- Differences Between OAuth 1 and 2 π
- OAuth 2.0: Benefits and use cases β why? π
- Simplified Oauth 2.0 Tutorial - Example with Node.js π πΊ ~11m
- Google OAuth Docs - Node.js quickstart π
- Node.js App From Scratch | Express, MongoDB & Google OAuth π πΊ 2h 28m
- OAuth (Passport.js) Tutorial #12 - Saving User to MongoDB π πΊ ~10m
- NodeJS & Express - Google OAuth2 using PassportJS π πΊ ~20m
- Lesson 7 Class Activity Walkthrough: Auth0 + Google π
User
model implementation:
- Lesson 8 π
- Class Solution π
- OAuth 2.0 π
- The OAuth 2.0 Authorization Framework - fc6749 π
- OAuth 2.0 configuration π
- Introduction to JSON Web Tokens π
- JSON Web Token (JWT) - fc7519 π
- What is JWT and how does it work? π
- (OPTIONAL) YouTube: What Is JWT and Why Should You Use JWT π πΊ ~15m
- OAuth vs JWT (JSON Web Tokens): An In-Depth Comparison π
- API Keys vs OAuth Tokens vs JSON Web Tokens π
- Top 3 Things You Should Know About Webhooks! π
- Passportjs:
- Lesson 9 π
- GitHub source code π
As your API scales, you start to run into questions like "How can I control who makes requests to it and how many requests can they make? How can I make sure the interface with the frontend stays the same while the backend is being updated? How can I handle influxes of requests?" API management tools exist to help with questions like these. One of these tools is an API gateway. API gateways serve as a middle layer to go between your API and the clients that use it.
- (OPTIONAL) YouTube: What is API gateway really all about? π
- Microsoft Tutorial: Hello World: API Management π
- 14 Open Source and Managed API Gateway for Modern Applications π
- Understanding the API Gateway: When You Need It and How to Implement It π
An API Gateway acts as a middle layer between your API services and the clients that use them. Here are some popular solutions out there today:
- WSO2 π
- Azure API Management π
- Amazon API Gateway π
- Kong π
- Tyk π
- KrakenD π
- Gloo Edge π
- Express Gateway π
- GitHub OAuth Apps - https://github.com/settings/developers
supertokens/supertokens-core
- https://github.com/supertokens/supertokens-core- OpenAPI Guide - https://swagger.io/docs/specification/basic-structure/
- A CMS software application allows users to create, manage, and publish digital content like articles, images, and videos.