-
inngest-js
The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
Why did I choose Convex over Firebase, Supabase, or even a self-hosted solution? I initially started Fastmind using the T3 stack, but found it to be too much work to handle some of the real-time features I needed. I also required a lot of background jobs, for which I tried solutions like Bull, and services like Inngest and Trigger.dev. While these are great services, I wanted everything in one place, so I decided to give Convex a try, and I’m very happy with the results.
-
InfluxDB
Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
-
The chat widget is a basic Next.js application that connects to the long-running API to get the chatbot configuration, stream, and send messages. The chat widget is hosted on Cloudflare Workers, a serverless platform that allows you to run JavaScript code at the edge of the network. This is very useful for a chat widget, as it’s closer to the user and can significantly reduce latency and costs, especially if a large number of users start using the chat widget. This could easily be hosted alongside the chatbot builder, and it would be perfectly fine—and cheaper. But I am a bit of a performance freak, so I decided to go with Cloudflare Workers. Also, I've heard horror stories about the costs of apps hosted on Vercel being DDoSed, so I decided to go with Cloudflare Workers to prevent this from happening.
-
I have three separate frontend applications. This separation was intentional to maintain a clear division between the chatbot builder (dashboard), the chatbot itself (the chat widget embedded on your website), and the marketing website. This separation makes it easier to maintain and scale the applications independently and push updates without affecting other parts of the system. For me, this setup works because it's the same one I use at work, so I feel very comfortable with this architecture. Again, this might not be your case, and that’s perfectly fine. I won’t go into too much detail about the marketing website, as it's not the focus of this post, but it’s a Next.js app hosted on Vercel.
-
shadcn/ui
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
For the main app (chatbot builder), I used Next.js paired with Shadcn for UI components and Tailwind CSS for styling. Since I use Convex for the DB layer, I used their React library to connect to the DB to perform queries and mutations with real-time features and to call serverless functions with what they call "actions." I'll delve deeper into Convex and all of its amazing features in another post if you're interested. For authentication, I used Clerk to avoid dealing with user management and building all the different auth flows, allowing me to focus on product development. This is one of my favorite tools out there—you have to check them out if you're a React developer. This app is hosted on Vercel, which is a great platform for hosting Next.js apps.
-
For the main app (chatbot builder), I used Next.js paired with Shadcn for UI components and Tailwind CSS for styling. Since I use Convex for the DB layer, I used their React library to connect to the DB to perform queries and mutations with real-time features and to call serverless functions with what they call "actions." I'll delve deeper into Convex and all of its amazing features in another post if you're interested. For authentication, I used Clerk to avoid dealing with user management and building all the different auth flows, allowing me to focus on product development. This is one of my favorite tools out there—you have to check them out if you're a React developer. This app is hosted on Vercel, which is a great platform for hosting Next.js apps.
-
As mentioned above, I use Vercel for the frontend apps, Cloudflare Workers for the chat widget, and Railway for the backend. I also use Sentry for error tracking, Lemonsqueezy for billing as my Merchant of Record so I don't have to worry about taxes, Clerk for authentication, and Convex for the database, cron jobs, and real-time features. The AI models are Command R and Command R+ from Cohere.
-
react-buddy-react
A declarative, efficient, and flexible JavaScript library for building user interfaces.
So what is the best tool for this job? Well, you guessed it! Always choose what you know. In my case, I've been working with the JavaScript ecosystem for a while, so I decided to stick with React for the frontend and Hono for the backend. I also used Convex heavily for the database, cron jobs, real-time capabilities, and more, all bundled together in a Turborepo. I'll go into more detail about each part of the architecture in the following sections.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
The backend consists of a long-running Hono server that handles most of the chat widget requests, as explained above. It’s a Bun application that connects to Convex to read and write data to the database. It’s hosted on Railway, a platform that allows you to deploy and scale your applications without worrying about infrastructure. This server could be replaced with Convex and use their serverless functions or even HTTP solution, but I prefer to have a long-running API server for the chat widget to prevent DDoS attacks on my serverless functions. To achieve this, I have a local Redis instance available for the server to rate-limit requests by IP. Then I have another rate-limit layer directly on the DB (Convex) to block multiple requests for an account. Believe it or not, this helps me sleep at night.
-
I have three separate frontend applications. This separation was intentional to maintain a clear division between the chatbot builder (dashboard), the chatbot itself (the chat widget embedded on your website), and the marketing website. This separation makes it easier to maintain and scale the applications independently and push updates without affecting other parts of the system. For me, this setup works because it's the same one I use at work, so I feel very comfortable with this architecture. Again, this might not be your case, and that’s perfectly fine. I won’t go into too much detail about the marketing website, as it's not the focus of this post, but it’s a Next.js app hosted on Vercel.
-
So what is the best tool for this job? Well, you guessed it! Always choose what you know. In my case, I've been working with the JavaScript ecosystem for a while, so I decided to stick with React for the frontend and Hono for the backend. I also used Convex heavily for the database, cron jobs, real-time capabilities, and more, all bundled together in a Turborepo. I'll go into more detail about each part of the architecture in the following sections.
-
The backend consists of a long-running Hono server that handles most of the chat widget requests, as explained above. It’s a Bun application that connects to Convex to read and write data to the database. It’s hosted on Railway, a platform that allows you to deploy and scale your applications without worrying about infrastructure. This server could be replaced with Convex and use their serverless functions or even HTTP solution, but I prefer to have a long-running API server for the chat widget to prevent DDoS attacks on my serverless functions. To achieve this, I have a local Redis instance available for the server to rate-limit requests by IP. Then I have another rate-limit layer directly on the DB (Convex) to block multiple requests for an account. Believe it or not, this helps me sleep at night.
-
Why did I choose Convex over Firebase, Supabase, or even a self-hosted solution? I initially started Fastmind using the T3 stack, but found it to be too much work to handle some of the real-time features I needed. I also required a lot of background jobs, for which I tried solutions like Bull, and services like Inngest and Trigger.dev. While these are great services, I wanted everything in one place, so I decided to give Convex a try, and I’m very happy with the results.