Tech Stack โ Frontpics Image Marketplace
This page documents the current implementation stack. Check package manifests before changing versions.
Runtime and Toolingโ
| Layer | Current choice |
|---|---|
| Language | TypeScript 6 |
| Runtime | Node.js 24+ at repo root |
| Package manager | pnpm 11 |
| Monorepo | Turborepo 2 |
| Formatting | Prettier with Tailwind plugin |
| Linting | oxlint |
| Validation | Zod shared through packages/shared |
Backendโ
| Layer | Current choice |
|---|---|
| Framework | NestJS 11 |
| HTTP adapter | Fastify 5 |
| Database ORM | Prisma 7 |
| Database | PostgreSQL 18 + PostGIS 3.6 |
| Queue | BullMQ + Redis |
| Cache/config | Redis |
| Auth | Passport JWT, Nest JWT, JOSE helpers |
| Nodemailer/SMTP (Self-hosted mail server) | |
| Image processing | Sharp |
| Object storage | AWS SDK v3 S3 client for R2/S3-compatible backends |
| Logging | Pino/NestJS Pino |
Backend TypeScript uses module: NodeNext.
Frontendโ
| Layer | Current choice |
|---|---|
| Framework | Next.js 16.2 App Router |
| React | React 19 |
| Styling | Tailwind CSS 4 |
| Server state | TanStack Query 5 |
| Forms | React Hook Form and local controlled forms |
| Motion | Framer Motion |
| Maps | Leaflet |
| Icons | Lucide React |
| Notifications | Sonner |
| Image metadata | exifr in browser upload flow |
Web TypeScript uses bundler-style module resolution.
Database and Schemaโ
Prisma schema lives at:
packages/database/prisma/schema.prisma
The generated Prisma client is emitted under packages/database/src/generated/prisma.
Use the schema as the source of truth for model fields. Common pitfalls:
UserhasfirstNameandlastName, notdisplayName.ImageFilehascdnUrlandfileSizeBytes, noturlorsizeBytes.- enum values are lowercase snake_case.
Storageโ
Storage is runtime-selectable:
r2for Cloudflare R2;s3for S3-compatible storage;localfor development and signed local downloads.
The active backend is stored in Redis as config:storage_backend.
Documentationโ
Docs use Docusaurus 3 in apps/docs.
Build flow:
pnpm --filter docs build
pnpm --filter @frontpics/web build
The web build copies apps/docs/build into apps/web/public/docs.
Testing and Verificationโ
Before finishing code changes, run type checks for changed apps:
pnpm --filter @frontpics/api exec tsc --noEmit
pnpm --filter @frontpics/web exec tsc --noEmit
pnpm --filter @frontpics/shared exec tsc --noEmit
Use focused tests where available. Broaden test coverage when changing shared behavior, API contracts, purchases, payouts, auth, storage, or upload processing.
Infrastructureโ
Production uses:
- Docker Compose;
- Nginx reverse proxy;
- blue/green application stacks;
- shared PostgreSQL and Redis infrastructure;
- optional GitHub Actions deployment.
Pushing to main can trigger CI/CD in configured environments, so do not push automatically unless explicitly requested.