App for experimenting with Next.js + tRPC + Edge Functions + PlanetScale DB serverless driver + Clerk Authentication
- I am using PlanetScale MySQL database. For certain reasons, it doesn't support foreign keys
- DrizzleORM is cool light way to query DB, is uses mostly sql, but also provides some relational queries
- I am using planetscale database driver which doesn't reate SQL connection with database, but rather uses http layer to communicate with planetscale http driver
- For caching Upstash Redis for caching question
- Rest is cool, but lacking type support
- GraphQL is cool with great type support, but there is a lot of boilerplate and other technical challenges like N+1 problem
- tRPC is amazing alternative taking best of both worlds. I am using it within Next.js api
- I am using Edge functions for serverless solution, because AWS Lambda has cold starts
- I am using Upstash Qstash for asynchronnous work and Kafka for messaging
- Sentry for logging errors
- Vercel Analytics for web analytics
- Axiom for data querying and web traffic
- Clerk is nice alternative to Auth0 and works on Edge (Auth0 doesn't 😅🙈)
For testing locally on phone, I can use Cloudflared tunnels:
cloudflared tunnel --url http://localhost:3400