
Build a real-time chat app with Next.js, React, Tailwind, and Shadcn, featuring real-time messages, group chats, read receipts, input validation, and a responsive design.
Set up a Next.js project in VSCode by running the boilerplate installer, name it chat-app, enable TypeScript, ESLint, and Tailwind, use the app router, then run npm run dev.
Initialize Shad CDN in your Next.js app to set up the component library, then install components like a button. Customize with CSS variables in globals.css and apply a blue theme.
discover how next.js simplifies full-stack development by bundling routing and backend, and explore the app and public folders, config files, and file-based routing with page.tsx and layouts.
Set up a real-time convex database, log in with GitHub, install convex, and run npm convex dev to auto-update your chat app’s schema and view logs.
Set up authentication and authorization for the chat app with cloak, enabling Google sign-in and deselecting email, then copy keys to env local and add a middleware to protect pages.
Learn to integrate convex with clerk to secure a real-time next.js app by wiring a convex client provider with clerk authentication, including jwt templates and Google sign-in.
Enable Clark webhooks to store new user data in convex db, define a users table with schema and internal mutations, and implement an http endpoint to handle the webhook.
Set up frontend routes and layouts for a real-time chat app, implementing desktop and mobile navigation, conversations and friends pages, dynamic conversation ids, and a redirect from / to /conversations.
Create a responsive sidebar layout for a real-time chat app by implementing a SidebarWrapper with Tailwind classes that renders desktop left navigation and mobile bottom navigation with icons and tooltips.
Build a two-pane user interface with a left items list and a right conversation area, creating reusable item list and conversation components and responsive visibility for mobile and desktop.
Build the backend for friend requests in a real-time chat app: create a requests table with sender and receiver, add indexes, and implement a convex-backed create api with validation.
Create a front-end add friend dialog for a real-time chat app using Next.js, React, Tailwind, and Shadcn, with zod validation, react-hook-form, and convex mutations.
Render a user's received requests by querying the backend for current user's requests with sender details, then display them in a front-end component using convex use query and avatar components.
Add a real-time badge in the navigation bar to display the pending requests count by querying the API and rendering a badge in both desktop and mobile nav.
Define backend schemas for friends, conversations, and messages; implement accept request mutation to create friendship, set up a conversation and members, and remove the request.
Render the conversations list for the conversations page by fetching memberships and related conversations, then show other members' details or group info with avatars and names.
Render the active conversation using the URL conversation ID to fetch and verify membership, then show the header with the other member or group name and the chat body.
Note: I forgot to add the code for focusing on the input once the create message request is completed but it will be addressed in a later lesson
Fetch and render chat messages by conversation, including sender data, time formatting, and adaptive ui with left-right alignment and avatars for real-time conversations.
Create groups by fetching current user's friends, assigning a group name, assembling group members, and inserting group conversations and memberships in the convex backend.
Add a create group dialog to a real-time chat app, enabling name and member selection from fetched friends with avatars, and show success or error feedback.
Render group conversations in the chat app by duplicating the DM item as a group item, using name and avatar fallback, and fix the conversation map to open group chat.
Implement a leave group feature in a real-time chat app built with NextJS, React, Tailwind, and Shadcn; manage memberships by user and conversation and provide a leave group dialog.
Implement read receipts by creating a mark read mutation in convex backend, updating the current user's last seen message, and displaying a read badge in the chat UI.
Add read receipts to the real-time chat app by updating message and body components to track and display who has seen each message, including a multi-user tooltip.
Implement real-time read receipts by calculating unseen messages from last seen times. Display badges on direct message and group conversation items.
In this comprehensive course, we'll build a full stack real-time chat application. You'll dive deep into the world of web development using cutting-edge technologies such as:
Next.js (crash course included)
ReactJS
Tailwind CSS for styling
TypeScript for type-safe code
Shadcn/UI for reusable components and theming
Convex DB as a real-time database
Clerk for authentication
Throughout this course, you'll embark on a journey to create a feature-rich, real-time chat application from scratch. We'll leverage powerful tools like ShadcnUI components, Convex for database management, Clerk for authentication, LiveKit for audio/video calls, and Uploadthing for seamless file uploads. Plus, we'll deploy our app effortlessly using Vercel.
Here's a glimpse of what you'll learn and build:
Add and remove friends seamlessly for enhanced user interaction.
Create conversations and messages in real-time, providing a dynamic user experience.
Establish group chats effortlessly, fostering collaboration among users.
Implement robust authentication with Clerk to ensure secure access to your application.
Enhance user experience with dark mode support.
Keep users informed with real-time notifications, making sure they never miss a beat.
Develop a responsive mobile UI for seamless access across various devices.
Enable audio/video calls using LiveKit, adding a personal touch to communication.
Allow users to upload images, videos, and files seamlessly with Uploadthing integration.
Enhance user engagement with an emoji picker, making conversations more expressive.
Convert your application into a Progressive Web App (PWA), ensuring cross-platform compatibility and native-like experiences on desktop, iOS, and Android.
Utilize Convex for real-time database operations, ensuring data consistency and reliability.
Additionally, this course includes a Next.js crash course tailored for complete beginners. So whether you're new to Next.js or an experienced developer looking to expand your skill set, this course has something for everyone.
By the end of this course, you'll not only have built an impressive real-time chat application but also gained invaluable skills and insights into modern web development practices. Enroll now and take your web development journey to new heights!