Profile picture of Shayan

Shayan

ImSh4yy

Published: October 24, 2024
47
22
662
1/1
08:44 PM

In case anyone is interested, here's how I deploy things: Marketing: Astro (mostly static, vanilla JS is fine). Deployed to Cloudflare Pages. - Blog, Docs, Pricing, SEO Pages. - tRPC for server-to-server calls during SSR. Dashboard: React SPA (Remix in SPA mode). Deployed to Cloudflare Pages. - tRPC with React Query for client-to-server calls. Backend: Docker container, stateless. Self-hosted on Docker Swarm. Sits behind Caddy, in a private network, behind a load balancer. - Can scale independently, both vertically and horizontally. - tRPC for typesafe RPC calls between the dashboard and backend. - Can have a temporary in-memory cache, but nothing persisted. Database: Postgres: the primary source of truth for everything. Can be self-hosted or managed (without any proprietary features). - Crons, Queues, Scheduled tasks, Key/Value store. - Internal rate limiting (for low-volume tasks). - pg_vector for vector search. Dependencies: - R2 for file storage - SES for emails - Cloudflare for DNS and DDoS protection. Notes: - Monorepo with shared packages and types. - Runs locally with docker compose or natively. - Caddy dev server with `.local` and TLS certs. - Prod deploy takes ~2 minutes, could be faster. I've probably missed a bunch of stuff, but that's the general idea.

Share this thread

Read on Twitter

View original thread

Navigate thread

1/1