This comprehensive tutorial teaches how to build a REST API from scratch with Node.js and TypeScript! Our step-by-step guide will cover all the basics of building a scalable, secure, and high-performance API. We'll be using JWT authentication, and TypeORM for data management, including the core concepts of TypeORM and relational databases, custom scripts for migrations, file handling, class validators for input validation, and much more. This video is designed for beginners and covers everything you need to know to start with Node.js development. By the end of the tutorial, you'll have a fully-functioning, dockerized REST API and the knowledge to continue your journey as a Node.js developer. So, if you're ready to take your Node.js skills to the next level, enroll now and let's get started!!
Find the source code: https://github.com/sadhakbj/Bookie-No...
Follow me:
/ @sadhakbj
https://github.com/sadhakbj
[00:00] Introduction
[01:15] Folder initialization & basic packages installation
[06:45] Basic REST API
[14:00] TypeORM Configuration
[23:00] Custom scripts to create/revert the migration
[40:00] Create new migration using the command using Migration API
[42:00] Add author routes
[44:00] Create new author entity
[50:45] Create new AuthorsController & implement GET /authors endpoint
[55:00] Seed few data manually using MySQL client
[58:40] Implement /authors/{id} endpoint
[01:03:10] Handle route not found
[01:06:30] Add reusable Reponse util
[01:12:55] Add global error catcher & handler middleware
[01:26:25] Implement re-usable offset paginator
[01:42:20] Implement POST /authors to create new author, use multer to upload the image
[01:58:00] Implement AuthorCreateDTO and add class-validator library to validate the input
[02:08:40] Implement PUT authors/{id}
[02:17:05] Implement DELETE authors/{id}
[02:20:00] Refactor ErrorHandler middleware and clean the code
[02:25:00] Add new custom validator: IsUniqueValidator with ClassValidator
[02:38:35] Format errors to be more readable
[02:40:00] Create new Book entity
[02:44:25] Create new migration to create books table and seed initial data
[02:56:20] Implement Books CRUD operations with all validations and file upload mechanism
[03:28:25] Add new user entity and add migration
[03:38:35] Start implementing users register mechanism
[03:52:40] Implement user login and return JWT token
[04:12:35] Protect few routes so that only authorized user / admin can have access to it by adding new AuthMiddleware
[04:35:29] Refactoring: return full image URL which is accessible and implement some transformers
[05:04:50] Use path alias to import the files
[05:13:45] Dockerize the application
[05:25:00] POSTMAN fixes & publish the API documentation using POSTMAN