Build a Multi-Tenanted, Role-Based Access Control System

TomDoesTech • May 23, 2023
Video Thumbnail
TomDoesTech Logo

TomDoesTech

@tomdoestech

About

I am a full-stack developer from Queensland Australia, specializing in all things JavaScript, Node.js, React & TypeScript. My mission is to help you become a better JavaScript developer and help you land your dream job. I have been fortunate enough to build a career that I absolutely love and I want to help you do the same.

Video Description

Neon: https://bit.ly/tomdoestech In this video, you will build a multi-tenanted, Role-Based access control authentication API with Node.js, Drizzle ORM, TypeScript, PosgresSQL & Neon. Repository: https://github.com/TomDoesTech/user-api 0:00 Introduction 5:07 - Bootstrap application 15:13 - Setup Drizzle ORM 20:04 - Define schemas 35:10 - Application module 44:17 - Default roles 56:50 -Register user 1:18:37 - Login 1:35:18 - Create a role 1:41:22 Assign role to user 1:47:30 Guards 2:01:03 Outro Thank you to Neon for sponsoring this video. If you want a managed PostgresSQL database with a generous free tier, make sure you check out Neon https://bit.ly/tomdoestech What you will learn: - How to create a multi-tenant application - How to create a role-based access control system - Some basic relational database concepts - A nice and neat file structure for backend services - RESTful API design - TypeScript - Fastify - How to use Drizzle ORM 🌎 Follow me here: Discord: https://discord.gg/4ae2Esm6P7 Twitter: https://twitter.com/tomdoes_tech Facebook: https://www.facebook.com/tomdoestech​ Instagram: https://www.instagram.com/tomdoestech​ TikTok: https://www.tiktok.com/@tomdoes_tech ☕ Buy me a coffee: https://www.buymeacoffee.com/tomn

Upgrade Your Gaming Setup Now

AI-recommended products based on this video

Loading...
Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

(38,487)
$199.00$187.32
FREE delivery Fri, Oct 3
10K+ bought in past month
Loading...
Mini Mic Pro (Latest Model) - Professional Wireless Microphone for iPhone, iPad, Android, Lavalier Microphone for Video Recording - iPhone Mic Crystal Clear Recording with USB-C for Content Creators
Best Seller

Mini Mic Pro (Latest Model) - Professional Wireless Microphone for iPhone, iPad, Android, Lavalier Microphone for Video Recording - iPhone Mic Crystal Clear Recording with USB-C for Content Creators

(4,360)
$24.99$24.74
FREE delivery Thu, Sep 4 on $35 of items shipped by Amazon
10K+ bought in past month
Loading...
Lenovo V15 Laptop | 15.6" FHD Anti-Glare Display | AMD Ryzen 7 7730U | 40GB RAM | 1TB PCIe SSD | HDMI | Type-C | Webcam | Wi-Fi | THUNDEROBOT Wireless Ergonomic Mouse | Windows 11 Pro | Black

Lenovo V15 Laptop | 15.6" FHD Anti-Glare Display | AMD Ryzen 7 7730U | 40GB RAM | 1TB PCIe SSD | HDMI | Type-C | Webcam | Wi-Fi | THUNDEROBOT Wireless Ergonomic Mouse | Windows 11 Pro | Black

(26)
$649.00$636.02
FREE delivery Jun 18 - 23
Loading...
Soundcore Liberty 4 Pro by Anker, Noise Cancelling Wireless Earbuds, 7-Sensor and Real-Time Adaptive Noise Cancelling, 2× Faster Charging, Studio-Level Hi-Fi Music, Clear Calls with 6 Mics and AI

Soundcore Liberty 4 Pro by Anker, Noise Cancelling Wireless Earbuds, 7-Sensor and Real-Time Adaptive Noise Cancelling, 2× Faster Charging, Studio-Level Hi-Fi Music, Clear Calls with 6 Mics and AI

(1,105)
149.99
PrimeFREE delivery Saturday, June 14
1K+ bought in past month
Loading...
acer Predator Helios Neo 16 Gaming Laptop,16" WQXGA IPS 240Hz 500 nits Display, 14th Gen Intel i9-14900HX, GeForce RTX 4070, 64 GB DDR5, 4 TB SSD, Backlit KB, Win 11 Pro, with Designed Accessories

acer Predator Helios Neo 16 Gaming Laptop,16" WQXGA IPS 240Hz 500 nits Display, 14th Gen Intel i9-14900HX, GeForce RTX 4070, 64 GB DDR5, 4 TB SSD, Backlit KB, Win 11 Pro, with Designed Accessories

(49)
$2,499.99
FREE delivery Jun 17 - 20
Loading...
acer Predator Helios Neo 18 Gaming Laptop, Intel i7-14700HX, NVIDIA GeForce RTX 4070, 18" WQXGA 2560 x 1600 165Hz Display, 64GB DDR5, 4TB Gen 4 SSD, Backlit Keyboard, Windows 11 Pro & MS Office Pro

acer Predator Helios Neo 18 Gaming Laptop, Intel i7-14700HX, NVIDIA GeForce RTX 4070, 18" WQXGA 2560 x 1600 165Hz Display, 64GB DDR5, 4TB Gen 4 SSD, Backlit Keyboard, Windows 11 Pro & MS Office Pro

(34)
$2,499.99
FREE delivery Jun 17 - 20
Loading...
acer Predator Helios Neo 16 Gaming Laptop, GeForce RTX 4070, Intel i9-14900HX, 16" IPS 240Hz 500 nits Display, 64 GB DDR5 RAM, 4 TB SSD, Windows 11 Pro, Office Pro Lifetime License

acer Predator Helios Neo 16 Gaming Laptop, GeForce RTX 4070, Intel i9-14900HX, 16" IPS 240Hz 500 nits Display, 64 GB DDR5 RAM, 4 TB SSD, Windows 11 Pro, Office Pro Lifetime License

(3,551)
$2,499.99
FREE delivery Jun 17 - 20
Loading...
Lenovo ThinkPad E14 Gen 5 Business Laptop (14" FHD+ Anti-glare, Intel 10-Core i7-1355U, 40GB RAM, 1TB SSD) Backlit, Fingerprint, Fast Charge, 1080p RGB Webcam, Wi-Fi 6, Win 11 Pro w/ Copilot

Lenovo ThinkPad E14 Gen 5 Business Laptop (14" FHD+ Anti-glare, Intel 10-Core i7-1355U, 40GB RAM, 1TB SSD) Backlit, Fingerprint, Fast Charge, 1080p RGB Webcam, Wi-Fi 6, Win 11 Pro w/ Copilot

(12)
$899.99
FREE delivery Wed, Jun 18
Loading...
Lenovo V15 Laptop | 15.6" FHD Anti-Glare Display | AMD Ryzen 7 7730U | 40GB RAM | 1TB PCIe SSD | HDMI | Type-C | Webcam | Wi-Fi | THUNDEROBOT Wireless Ergonomic Mouse | Windows 11 Pro | Black

Lenovo V15 Laptop | 15.6" FHD Anti-Glare Display | AMD Ryzen 7 7730U | 40GB RAM | 1TB PCIe SSD | HDMI | Type-C | Webcam | Wi-Fi | THUNDEROBOT Wireless Ergonomic Mouse | Windows 11 Pro | Black

(26)
$649.00$636.02
FREE delivery Jun 18 - 23
Loading...
Lenovo 15.6" Laptop, Intel 10-Core i7-13620H (Beat Ultra 7 255U), 40GB DDR4 RAM, 2TB PCIe SSD, WiFi 6, Bluetooth 5.2, FHD Computer for Business & Student, RJ45, Type-C, HDMI, Windows 11 Pro, Wendbo

Lenovo 15.6" Laptop, Intel 10-Core i7-13620H (Beat Ultra 7 255U), 40GB DDR4 RAM, 2TB PCIe SSD, WiFi 6, Bluetooth 5.2, FHD Computer for Business & Student, RJ45, Type-C, HDMI, Windows 11 Pro, Wendbo

(11)
$899.00
FREE delivery Jun 18 - 23
Loading...
Lenovo ThinkBook 15 Gen 4 Business Laptop (15.6" FHD Anti-Glare, Intel 10-Core i7-1255U, 40GB RAM, 1TB PCIe SSD), 1080p Webcam, Narrow Bezel, Fingerprint, Wi-Fi 6, Ethernet, Win 11 Pro, Grey

Lenovo ThinkBook 15 Gen 4 Business Laptop (15.6" FHD Anti-Glare, Intel 10-Core i7-1255U, 40GB RAM, 1TB PCIe SSD), 1080p Webcam, Narrow Bezel, Fingerprint, Wi-Fi 6, Ethernet, Win 11 Pro, Grey

(30)
$759.98
FREE delivery Wed, Jun 18
50+ bought in past month
Loading...
acer Nitro V 15 Gaming Laptop, 15.6" 144Hz FHD Display, Intel 10-Core i7-13620H, NVIDIA GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, Backlit Keyboard, Microsoft Office Lifetime License, Windows 11 Pro

acer Nitro V 15 Gaming Laptop, 15.6" 144Hz FHD Display, Intel 10-Core i7-13620H, NVIDIA GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, Backlit Keyboard, Microsoft Office Lifetime License, Windows 11 Pro

(827)
$1,659.99
FREE delivery Jun 17 - 20
Loading...
acer Nitro V16 Gaming Laptop, Microsoft Office 2024 Lifetime License, 16" WUXGA 165Hz, AMD Ryzen 7 8845HS Up to 5.10 GHz, GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, Backlit Keyboard, Win 11 Pro

acer Nitro V16 Gaming Laptop, Microsoft Office 2024 Lifetime License, 16" WUXGA 165Hz, AMD Ryzen 7 8845HS Up to 5.10 GHz, GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, Backlit Keyboard, Win 11 Pro

(0)
$1,769.99
FREE delivery Jun 17 - 20
Loading...
acer Nitro V 15 Gaming Laptop, Microsoft Office Lifetime License & Windows 11 Pro, 15.6" 144Hz FHD Display, Intel 10-Core i7-13620H, NVIDIA GeForce RTX 4060, 64GB DDR5 RAM, 4TB SSD, Backlit Keyboard

acer Nitro V 15 Gaming Laptop, Microsoft Office Lifetime License & Windows 11 Pro, 15.6" 144Hz FHD Display, Intel 10-Core i7-13620H, NVIDIA GeForce RTX 4060, 64GB DDR5 RAM, 4TB SSD, Backlit Keyboard

(348)
$1,579.99
FREE delivery Jun 17 - 20
Loading...
acer Nitro V15 Gaming Laptop, Microsoft Office Lifetime License & Windows 11 Pro, Intel i9-13900H Processor, NVIDIA GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, 15.6" FHD 144Hz Display, Backlit

acer Nitro V15 Gaming Laptop, Microsoft Office Lifetime License & Windows 11 Pro, Intel i9-13900H Processor, NVIDIA GeForce RTX 4060, 64 GB DDR5 RAM, 4 TB SSD, 15.6" FHD 144Hz Display, Backlit

(1,742)
$1,899.99
FREE delivery Jun 17 - 20