How rajeshdavidbabu/s3-upload-thing works
Project type and purpose
• This is a full-stack, self-hostable file-upload web application built on Next.js (the /app directory with React/TSX pages).
• It provides drag-and-drop uploads (Uppy uploader), paginated galleries, thumbnail generation, file downloads, and Google OAuth via NextAuth.
• Backend logic lives in Next.js API routes (app/api/*), a custom AWS Lambda for thumbnailing, and a PostgreSQL database accessed via Drizzle ORM.
File structure
Top-level directories:
• app/ – Next.js 13 “app router” pages, layouts, and API routes.
• app/page.tsx, app/layout.tsx – root page and layout
• app/(protected) – dashboard, settings, usage pages behind authentication
• app/api/auth/[...nextauth]/route.ts – NextAuth handlers
• app/api/files/[key]/route.ts, app/api/thumbnails/[key]/route.ts – file fetch & thumbnail endpoints
• components/ – shared UI building blocks (shadcn/ui wrappers, uploader components, general navigation, helpers).
• db/ & lib/db/ – Drizzle configuration, migration scripts, TypeScript schema, and data-access helpers (db/api/*.ts, lib/db/action.ts).
• lib/s3/ – S3 upload/download logic.
• lambda/ – standalone AWS Lambda function (zipped) that’s triggered (e.g., via S3 event) to generate thumbnails.
• auth.ts & auth.config.ts – NextAuth configuration.
• config/ – site-level constants.
• Root config files: next.config.mjs, tsconfig.json, tailwind.config.ts, ESLint, PostCSS.
README insights
• Tech stack: Next.js, shadcn/ui, Uppy, AWS S3, Zod, Drizzle + PostgreSQL, NextAuth Google OAuth.
• Features: drag-drop, pagination, filters, thumbnails, downloads.
• Architecture section shows high-level upload/download flows.