Sam Thoyre
Sam Thoyre
  • 11
  • 1 717
Mastering Testing Infrastructure in TypeScript: Vitest, Mocking, & Debugging
Welcome to the fifth installment in our series on building a modern web application for Raleigh AI Solutions! In this video, we take a deep dive into building a robust testing infrastructure to ensure our application is reliable, maintainable, and bug-free.
What You'll Learn in This Video:
Setting up Vitest for comprehensive testing with TypeScript and React.
Configuring an isolated test database for reliable, independent tests.
Creating mock utilities for external services like Clerk and OpenAI.
Writing and running unit and integration tests for core features.
Implementing a debug logging system to make troubleshooting efficient.
Testing is a critical part of any application development process, and this video aims to demystify the complexities of creating a reliable testing setup. We cover everything from installing the necessary dependencies, configuring testing environments, and writing robust tests, to effectively using mocks and debug tools.
Resources & Links Mentioned in the Video:
Full GitHub Branch with Code for Video 5: GitHub - Raleigh AI Content (Video 5 Branch): github.com/thorski1/Raleigh-AI-Content/blob/video-5
Drizzle ORM Documentation: Drizzle ORM Docs: orm.drizzle.team
Vitest Documentation: Vitest Docs: vitest.dev
pgvector for Embedding Storage: pgvector GitHub: github.com/pgvector/pgvector
Key Highlights:
Vitest Configuration: We configure Vitest to work seamlessly with TypeScript, set up plugins to handle React components, and define the proper environment setup.
Database Helper and Test Setup: Learn to manage the test database lifecycle with helper files for database seeding, resetting, and teardown to keep tests isolated.
Mocking External Services: We cover the importance of creating mock files for services like Clerk, OpenAI, and our database, which allows for isolated and reliable testing.
Integration Testing: Dive into writing integration tests for authentication, document management, and content handling with a focus on edge cases.
Debug Logging System: Implement a debugging utility to quickly identify and troubleshoot test failures.
Get the Full Source Code:
Check out the GitHub repository linked above to access all the code shown in the video. You’ll find the configurations, helper files, mock implementations, and test suites we've discussed.
About the Series:
This series covers the full journey of building a modern web application, starting from database setup, integration of AI services, to comprehensive testing, and beyond. If you've missed any part of the series, make sure to check out our playlist: Building Modern Web Apps for Raleigh AI Solutions: th-cam.com/play/PLm8mpUfGYwyE_xPjPyDiVxd9vmKbg6pDA.html.
Next Video in the Series:
In the next video, we’ll be moving on to building our RAG (Retrieval-Augmented Generation) engine. This system will help us create dynamic, relevant content for users by combining information retrieval and content generation techniques. Make sure to subscribe and hit the notification bell so you don't miss it!
Like, Subscribe, and Join the Conversation!
If you enjoyed this video and found it helpful, don’t forget to like and subscribe to the channel for more in-depth guides and tutorials. Have questions or want to share your own insights? Drop a comment below-let’s learn together!
#TypeScript #javascripttraining #webdevelopment #nextjs #javascript #javascriptframework #nextjsframework #nextjs14 #nextjstutorial #React #UnitTesting #IntegrationTesting #Debugging #rag #coding #programming
มุมมอง: 77

วีดีโอ

Database & Vector Store Setup with Drizzle ORM & pgvector
มุมมอง 16814 วันที่ผ่านมา
🚀 In this video, we'll set up our database with Drizzle ORM, configure vector storage using pgvector, and optimize with HNSW indexes. Follow along as we build a robust backend for our full-stack app! 💻 Here's what we'll cover in detail: Environment Setup - We'll start by setting up our development environment, installing essential dependencies like Drizzle ORM, pgvector, and other tools require...
Type-Safe API Setup with tRPC in Next.js 14 | Full Walkthrough
มุมมอง 21814 วันที่ผ่านมา
👋 Welcome back to our ongoing series where we build an AI content creator app from scratch! In this video, we'll guide you step-by-step 🛠️ through setting up the API layer using tRPC in Next.js 14, with a focus on 🔒 type safety and robust data management. What You'll Learn: How to set up tRPC initialization in Next.js Integration of React Query with tRPC for server state management Server-side...
Master Next.js Security: Integrate Clerk Authentication & Supabase Database Step-by-Step
มุมมอง 33814 วันที่ผ่านมา
Welcome back to our Next.js content creation series! 🚀 In this video, we're taking a deep dive into securing your Next.js application by integrating Clerk for user authentication and setting up a robust database with Supabase. What You'll Learn: Seamless User Authentication with Clerk: Set up Clerk in your Next.js app for effortless sign-in and sign-up flows. Protect routes using middleware to ...
Build an AI-Powered Content Platform with LangChain & Next.js: Project Setup and Best Practices #1
มุมมอง 29314 วันที่ผ่านมา
Welcome to Part 1 of our AI Content Platform Series! 🚀 In this kick-off episode, we'll set the foundation for building a scalable and efficient AI-powered content platform using the LangChain Next.js Starter Template. Here's what we'll cover: 🔹 Introduction to the Series Understand the goals and benefits of integrating AI into content workflows. Learn about Retrieval-Augmented Generation (RAG) ...
Building a Next.js App with LlamaIndex: Setting Up Your First RAG (Retrieval-Augmented Generation)
มุมมอง 20128 วันที่ผ่านมา
In this video, we’re kicking off a series where I’ll guide you through setting up a Retrieval-Augmented Generation (RAG) system for our business using LlamaIndex and Next.js. Today’s focus is on creating the foundational app and walking you through how LlamaIndex can seamlessly integrate with your data sources to power advanced AI applications. This tutorial is perfect for developers and busine...
Building a SaaS Marketing Site Part 4: Tweaking Cursor & Styling the Hero Section with Magic UI
มุมมอง 91หลายเดือนก่อน
In part 4 of this series, we make adjustments to Cursor’s .cursorrules file and fix up the hero section on the homepage. We integrate a marquee component from Magic UI and fine-tune the styling using TailwindCSS. This video focuses on improving the look and feel of the homepage, with a strong emphasis on design tweaks and customizations. In the next part, we’ll be pushing forward to complete th...
Building a SaaS Marketing Site Part 3: Supabase with tRPC, Drizzle ORM & React Query Setup
มุมมอง 134หลายเดือนก่อน
In part 3 of this series, we dive into integrating Supabase with tRPC using Drizzle ORM and React Query to efficiently manage database interactions in our SaaS marketing site. This setup simplifies data fetching, caching, and synchronization between our backend and frontend, ensuring a smooth and scalable development process. Tools used: • Cursor • Supabase • tRPC • Drizzle ORM • React Query Wa...
Building a SaaS Marketing Site: Part 2 | Next.js, Supabase, ShadCN
มุมมอง 99หลายเดือนก่อน
In this video, we continue building our SaaS marketing site using a powerful tech stack that includes Next.js, Supabase, ShadCN, TailwindCSS, tRPC, and Sanity. We set up the content for all main pages and design the hero section of the homepage, leveraging ShadCN components and Aceternity UI for stunning micro animations. Join me as we bring this project to life! Tools Used: • Next.js • Supabas...
Building a SaaS Marketing Site with Cursor - Part 1: Next.js, Tailwind, & ShadCN Setup
มุมมอง 93หลายเดือนก่อน
In this part 1 walkthrough, we kick off building a SaaS marketing site using Cursor, a powerful AI development tool that accelerates your workflow. We'll set up a Next.js project from scratch, integrating Tailwind CSS for styling and ShadCN for UI components. This series is all about showing you how Cursor can make building modern, responsive web applications more efficient and enjoyable. You'l...

ความคิดเห็น

  • @orenmizr
    @orenmizr 9 วันที่ผ่านมา

    you have a vector on drizzle-orm.... why did you create your own ?

    • @SamThoyre
      @SamThoyre 9 วันที่ผ่านมา

      Ah! Oversight on my part, you're totally right!

  • @minaidev
    @minaidev 15 วันที่ผ่านมา

    Cool! It seems that using drizzle and trpc is a better choice than just use the supabase javascript SDK?

    • @SamThoyre
      @SamThoyre 15 วันที่ผ่านมา

      Not necessarily! Supabase alone can handle many tasks efficiently, but when we dive into more complex logic-like building out a robust content creation system-the combination of Drizzle with tRPC shines. These tools streamline development, offering strong type safety across all files, which means fewer errors and a smoother, more scalable experience. In the long run, they can really elevate both the efficiency and reliability of the codebase.

    • @minaidev
      @minaidev 14 วันที่ผ่านมา

      @@SamThoyre Thank you so much, very informative reply.

  • @avidhiru
    @avidhiru 18 วันที่ผ่านมา

    feel good to be here❤

    • @SamThoyre
      @SamThoyre 18 วันที่ผ่านมา

      Thanks for watching! I'll continue to work on my videos and improve, I promise!

  • @minaidev
    @minaidev หลายเดือนก่อน

    Awesome Samuel! I learned a lot from your videos, please keep on updating

    • @SamThoyre
      @SamThoyre หลายเดือนก่อน

      Thank you so much! I'm trying to get better as I go, so please bear with me!

  • @ostriysous8942
    @ostriysous8942 หลายเดือนก่อน

    You're a beauty! it's really nice to watch, keep coding and recording it - success is not far off

    • @SamThoyre
      @SamThoyre หลายเดือนก่อน

      Thank you so much!

  • @minaidev
    @minaidev หลายเดือนก่อน

    Awesome video. Looking forward to sharing more contents especially supabase.

    • @SamThoyre
      @SamThoyre หลายเดือนก่อน

      Thanks! We'll get to that soon! I love Supabase!