
Install deno on your machine using the OS-specific command, verify the version, and learn to upgrade or install a specific version such as 1.75.
Master the Deno command line interface to fetch, run, and cache code from the internet, inspect downloaded locations, use help and info options, and execute a simple project offline.
Learn three Deno file writing APIs—write text file, write file, and a lower-level write approach—covering path, data, optional options, and how permissions govern read and write.
Learn to centralize Deno dependencies by creating a dedicated dependency module that imports a remote library, re-exports its functions, and lets you update versions in one place.
Use import maps to manage dependencies in deno by mapping left-hand side names to right-hand side module urls, configure the import map design, and import modules with explicit versions.
Learn how to replace basic api module code with a real Deno web api using third-party libraries and frameworks in the Deno ecosystem.
Explore Oak, a Deno middleware framework, and learn how a request from web, mobile, or microservices flows through a call context and middleware to produce a response.
Learn to handle file uploads with form data using the farm data format in deno, including parsing request bodies, saving files to disk, and managing in-memory limits for multi-file uploads.
Learn to extract query strings in Deno with a helper function, import the utility, and use a limit parameter in requests to fetch products from the database.
Build on the previous lecture by starting a new e-commerce project, using the code finished in the last lecture as a starting point, and prepare for the next section.
Refactor the code by creating a routes folder, moving products and author into modules, exporting and renaming constants, and updating imports to create a cleaner, admin-friendly structure.
Log in as a super user, create an e-commerce database, enable the required extension, define seven tables with foreign keys, and implement update-timestamp triggers for automatic timestamps.
Explore two files on query statements and types in Deno for web developers, using template strings to prevent injection and mapping TypeScript types to PostgreSQL columns across joined tables.
After sign-in, issue an access token with seven days expiry and a five-minute refresh token in cookies. Renew via the refresh token to maintain access and invalidate old sessions.
Set up the sign up route with router and middleware, validate the json body for username, email, and password, then hash the password before storing.
Add authorization to the existing authentication by reading and verifying the access token from the authorization header, then ensure the user id matches before proceeding.
Implement a reset password flow by creating routes for requesting and confirming resets, generating a reset token with expiration time, updating user in the database, and sending a confirmation email.
Validate add product data by checking image presence and exactly five key-value pairs with valid keys and nonempty values, then upload the image to cloud storage and insert the product.
Learn to upload images to a cloud service by configuring api key, timestamp, and signature, then prepare and send a form-data request with the image and transformation settings.
Delete an image from Cloudinary and update the corresponding item in the database, including replacing the image and testing the request.
Implement a delete product workflow in a Deno web app, including admin authorization, existence check, database removal, and cloud image deletion on Cloud Inari, with testing via Postman.
Build a list products endpoint in a Deno web app by separating middleware, exporting the products controller, and importing the products query; test the public route with Postman.
Implement pagination for product queries by calculating limit and skip, determining total queries, and exposing has more with query parameters, using a get products function.
Implement a get product by id endpoint in a Deno web app using middleware and try-catch error handling, returning product data in the response body. Test with Postman.
Update cart items by validating the request body, adjusting the hot item quantity, deleting items when the final quantity reaches zero, and returning the updated hot item details.
Learn to build a deno web endpoint that lists a user's shipping addresses by validating the user, authorizing access, querying the database, and returning the address list.
Update a shipping address by validating input, verifying address ownership, and updating the database with the new address data through a Deno-based shipping address query.
Test selecting a shipping address by ID, sending a request to set the address in the card, and verify the card reflects the shipping address details and cost.
Implement the Deno checkout flow, parse and validate json request bodies, compute the total from cart items, ensure shipping address, and create or fetch a Stripe customer.
Validate the request against the stored stripe customer id, then clear the stripe customer using the secret key and API, and update the user record with the result.
Learn to create a Stripe payment intent, build the request body with amount and currency, confirm the payment via the Stripe SDK, and handle results for checkout.
Build a stripe-based confirm payment flow in Deno, validating card details, clearing and confirming a payment method, and finalizing a payment with a payment intent.
Clear a new order after checkout by authenticating and authorizing the user, then update inventory, convert cart items to order items, insert the order and items, and clear the cart.
Learn to list a user's orders and retrieve a specific order by id in Deno for web developers, using get orders and get order to return order details.
Learn to implement an admin update order endpoint in Deno, validate the request body, ensure shipment status validity, update the order in the database, and test with Postman.
Explore the admin area to manage Menez products with the product form and custom hooks. Submit form data with authorization, and add, update, or delete items in the admin interface.
Navigate the admin area to view and open orders, edit order details, and update shipment status with the update order mutation.
Read environment-specific settings from a .env file using dotenv to configure db name, user, password, host, and port in deno apps.
Test the signup mutation using GraphQL playground and pgAdmin, validate username, email, and password, create users with hashed passwords, default token_version and roles, and enforce unique emails.
create an isAuthenticated function in authUtils.ts to verify request.userId, fetch the user by id from the database, validate tokenVersion, and return a UserResponse payload for GraphQL queries.
implement a signout mutation in a GraphQL API using deno, updating the token_version, deleting the jwt cookie, and returning a responsemessage to signal logout.
Deno for web developers implements two mutations: requestToResetPassword and resetPassword, emailing a reset link with a 30-minute time-limited token and updating the user with token and expiry.
describe sending a password reset email in Deno using Sendgrid by posting to the API endpoint with an API key, composing an html message with a reset token.
Add authentication and authorization checks to the users query using isAuthenticated and role checks for admin and super admin, then filter and return a five-property user list.
Test the automatic extension of token expiration via the check token middleware, observe token versions advancing and new tokens generated and stored in cookies after login.
Centralize library imports in a single deps.ts within a deps folder to simplify version updates for oak, oak_graphql, bcrypt, djwt, dotenv, and uuid across index.ts, mutations.ts, and queries.ts.
protect routes on the client side by using the context API's loggedInUser to guard the dashboard and admin pages, redirecting unauthenticated users with router.push to the home page.
Learn to implement sign up by using React Hook Form to collect username, email, and password, validate inputs with defined rules, and submit data with Apollo Client.
Implement cross-tab signout by storing a signout key in local storage and listening for storage events in React, syncing loggedInUser to null across tabs and redirecting to home.
Test the reset password workflow by signing up with a real email, requesting a reset, and checking the email link to complete the first part.
Fetch user information on the server with Next.js getServerSideProps, demonstrating SSR data loading, props propagation, and immediate rendering of server-fetched data on the admin page.
Learn to redirect users on the server side using getServerSideProps, check tokens, enforce authentication and admin access, and pass user data to the client to update auth state.
Add delete user functionality via a GraphQL mutation triggered by a trash icon, confirm with the user, and refresh the user list with useMutation and refetchQueries.
Test social media logins using Facebook and Google, verify user creation in pgAdmin with facebook_id and google_id, and confirm sign in modal buttons.
*** This course has been 100% re-recorded in April 2021 ***
Use Deno v1.8.0
This course will guild you on how to use Deno in modern web development. We are going to learn Deno's basics and then use the knowledge to build a real-world application.
# The contents covered in this course are:
What is Deno?
Command Line Interface
Deno APIs / Web APIs / Standard Library
Read File / Write File
Modules And Dependencies Management
HTTP Server
Request / Response / Routing
Using Oak Framework
Error Handling
Authentication / Authorization / Reset Password
JWTs Refresh Token / Access Token
Working with Database (PostgreSQL)
Sending Email Using SendGrid
Validating Request Body
File Upload to Cloudinary
Pagination
Add to Cart
Payment System with Stripe
Admin Area
# What are we going to build?
A full-fledged REST APIs for An eCommerce Application
===========================================================================
*** The below contents are now legacy ***
This course will guild you on how to use/integrate modern and well-established technologies such as Deno.js, GraphQL, NextJS, and PostgreSQL to build a professional, real-world full-stack application.
# What are we going to build?
A full-stack JWT authentication system
# What topics this course will cover?
Create a web server with Deno.js and Oak framework
Create GraphQL server with Oak GraphQL library
Setup PostgreSQL database and connect to the server
Write GraphQL API (schema, queries, mutations)
How to use Oak middleware function
How to manipulate Oak Context and use it to pass data between middleware
How to use Cookies
How to create, send, and validate JWT token
Perform PostgreSQL Create, Read, Update, Delete (CRUD) operations
How to send email in Deno.js
How to connect NextJS application with Deno web server using Apollo Client (v3)
Fetch data from GraphQL API with Apollo Client Hooks (useQuery, useMutation)
How to write Apollo Hooks as custom hook function
How to fetch data from GraphQL API on server-side in NextJS
Manage state with React Context API
How to protect route on client-side in NextJS
How to protect route on server-side in NextJS