Convex is a reactive backend: define your schema and queries in TypeScript, get real-time updates in your frontend automatically. No WebSocket setup, no polling.
Quick Start
npm create convex@latest
Define Schema
// convex/schema.ts
import { defineSchema, defineTable } from 'convex/server'
import { v } from 'convex/values'
export default defineSchema({
messages: defineTable({
author: v.string(),
body: v.string(),
})
})
Write Queries
// convex/messages.ts
import { query, mutation } from './_generated/server'
import { v } from 'convex/values'
export const list = query({
handler: async (ctx) => {
return await ctx.db.query('messages').order('desc').take(50)
}
})
export const send = mutation({
args: { author: v.string(), body: v.string() },
handler: async (ctx, args) => {
await ctx.db.insert('messages', args)
}
})
Use in React (Real-Time!)
import { useQuery, useMutation } from 'convex/react'
import { api } from '../convex/_generated/api'
function Chat() {
const messages = useQuery(api.messages.list) // Auto-updates!
const send = useMutation(api.messages.send)
return (
<div>
{messages?.map(m => <p key={m._id}>{m.author}: {m.body}</p>)}
<button onClick={() => send({ author: 'Me', body: 'Hello!' })}>Send</button>
</div>
)
}
When anyone sends a message, ALL connected clients update instantly. No WebSocket code.
Free Tier
- 100K function calls/month
- 1M database reads/month
- 1GB storage
- Real-time sync included
The Bottom Line
Convex is the simplest path to a real-time backend. TypeScript end-to-end, reactive by default, generous free tier.
Need to automate data collection or build custom scrapers? Check out my Apify actors for ready-made tools, or email spinov001@gmail.com for custom solutions.
Top comments (0)