KRISH MAURYA — FOLIO ©2026
0
[CS /02] Case study — ©2025SELECTED WORK (03)

Droplet

Personal cloud storage that treats uploads as a first-class product: direct-to-CDN transfers, instant previews and a file tree that never lies.

ROLEFull-stack · solo build
TIMELINE2025 · 6 weeks
CORE STACKNext.js · Drizzle · Clerk · ImageKit
STATUSShipped
[01] OverviewTHE SHORT VERSION

What it is.

Droplet is cloud file storage that behaves like a native app. Files upload direct to ImageKit through short-lived signed tokens — they never touch the application server — while PostgreSQL keeps a fast, queryable record of every file, folder and permission.

Auth is handled by Clerk, the schema by Drizzle ORM, and the UI by Next.js App Router with server components doing the heavy lifting. The result: a storage product where the backend stays tiny, uploads stay fast, and the file tree is always consistent with the database.

Next.jsTypeScriptDrizzle ORMPostgreSQLClerkImageKitServer Actions
krishmaurya.me/droplet02 / 03
droplet — my files
Droplet — app preview

Droplet

Clerk auth · ImageKit delivery · SQL storage
[02] The challengeWHY IT WAS HARD

Problems worth solving.

  • Large uploads through a serverless-friendly backend — proxying bytes through Node was slow and expensive.
  • Keeping the file tree, storage quotas and trash state perfectly consistent with what is actually on the CDN.
  • Serving images fast worldwide without paying egress prices on every preview render.
  • Making private files private — no guessable URLs, no leaked tokens.
[03] ApproachHOW IT GOT BUILT

Built in four moves.

STEP 01

Direct-to-cloud uploads

The server issues short-lived signed upload tokens; bytes flow straight from browser to ImageKit, so large files never hit the app server.

STEP 02

SQL as the source of truth

Drizzle ORM over PostgreSQL models folders, files, versions and trash — the tree view is one indexed query, never a CDN listing.

STEP 03

Clerk for identity

Session management, user profiles and route protection handled by Clerk — every file row is scoped to an authenticated user.

STEP 04

CDN-powered previews

ImageKit transformations generate thumbnails on the edge; previews load fast everywhere without full-size downloads.

[04] Key featuresSHIPPED & WORKING

What it does.

Drag & drop uploads

Multi-file, resumable uploads with live progress straight to the CDN.

Folder tree

Create, rename and move folders with instant, query-backed consistency.

Trash & restore

Soft-delete with a restore window — nothing is truly gone until you say so.

Image previews

Edge-transformed thumbnails for instant grids, full size on click.

Storage meter

Per-user quota tracking straight from the database, always accurate.

Secure by default

Signed, expiring URLs — private files are never publicly addressable.

[05] Under the hood$ tree ./droplet

How it fits together.

krish@dev — zsh — 80×24
krish@dev ~ % tree ./droplet --depth 1
./droplet
├── app/ Next.js App Router — RSC + server actions
├── auth/ Clerk — sessions, users, route guards
├── db/ PostgreSQL + Drizzle — files, folders, quotas
├── storage/ ImageKit — signed uploads, CDN delivery
└── ui/ Upload queue, file grid, trash views
KEY DECISIONSDECISIONS.md
  • Signed direct uploads over server proxying — cuts upload latency and server load dramatically.
  • Drizzle over a heavyweight ORM — type-safe SQL with near-zero runtime overhead.
  • Soft deletes in SQL — trash/restore is a status column, not a second storage bucket.
[06] Results & learningsBY THE NUMBERS

What it proved.

faster large uploads via direct transfer64%
file bytes through the app server0
files access-scoped per user100%
  • The best upload server is the one that never sees the upload — signed URLs plus a metadata store beats byte proxying every time.
  • Treat the database as the product's source of truth and the CDN as pure delivery.
  • Server actions made the file operations feel local — one round trip, no hand-written API boilerplate.