I'm a developer. I know you're curious. "How is this built?"
Jottings is a modern serverless application. Here is a peek under the hood.
The Core: AWS Serverless
The backend is built entirely on AWS Serverless technologies.
- AWS Lambda: For all compute. The API, the background workers, the build system—it's all Lambda. We pay only for what we use.
- DynamoDB: For the database. It's fast, scalable, and flexible. We use a single-table design (mostly) to keep things efficient.
- Cognito: For authentication. Secure, standard, and handles all the messy identity stuff.
- SQS: For asynchronous tasks. When you publish a jot, it goes into a queue. This ensures the API stays fast and we can handle bursts of traffic.
The Storage: Cloudflare R2
We use Cloudflare R2 for storing your media and your generated static sites.
Why R2?
- No Egress Fees: This is huge. We can serve your images and sites to millions of people without going bankrupt.
- S3 Compatibility: It works with all our existing tools.
The Edge: Cloudflare Pages & Workers
The dashboard you use to manage your site is hosted on Cloudflare Pages. It's a React app (Vite) that talks to our AWS API.
Your actual Jottings site (e.g., vishal.jottings.me) is served via Cloudflare Workers.
- We use a Worker to route traffic.
- It checks if the domain is a custom domain or a subdomain.
- It fetches the correct HTML file from the R2 bucket.
- It handles caching at the edge.
The Build System
This is the coolest part. When you click "Publish", we don't just update a database record. We actually build your site.
- Trigger: API sends a message to SQS.
- Builder: A Lambda function wakes up.
- Generate: It fetches your jots from DynamoDB.
- Render: It renders HTML using your site's theme and templates.
- Upload: It uploads the new HTML files to R2.
This means your site is static. It can't be hacked via SQL injection (there's no database connected to your public site). It loads instantly. It can withstand the "Hacker News Hug of Death."
Why This Architecture?
It scales to zero (cheap to run when small) and scales to infinity (handles massive traffic without breaking a sweat). It gives you the best of both worlds: the dynamic power of a CMS for writing, and the speed and security of a static site for reading.