Skip to main content

Tech Stack โ€” Frontpics Image Marketplace

This page documents the current implementation stack. Check package manifests before changing versions.

Runtime and Toolingโ€‹

LayerCurrent choice
LanguageTypeScript 6
RuntimeNode.js 24+ at repo root
Package managerpnpm 11
MonorepoTurborepo 2
FormattingPrettier with Tailwind plugin
Lintingoxlint
ValidationZod shared through packages/shared

Backendโ€‹

LayerCurrent choice
FrameworkNestJS 11
HTTP adapterFastify 5
Database ORMPrisma 7
DatabasePostgreSQL 18 + PostGIS 3.6
QueueBullMQ + Redis
Cache/configRedis
AuthPassport JWT, Nest JWT, JOSE helpers
EmailNodemailer/SMTP (Self-hosted mail server)
Image processingSharp
Object storageAWS SDK v3 S3 client for R2/S3-compatible backends
LoggingPino/NestJS Pino

Backend TypeScript uses module: NodeNext.

Frontendโ€‹

LayerCurrent choice
FrameworkNext.js 16.2 App Router
ReactReact 19
StylingTailwind CSS 4
Server stateTanStack Query 5
FormsReact Hook Form and local controlled forms
MotionFramer Motion
MapsLeaflet
IconsLucide React
NotificationsSonner
Image metadataexifr 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:

  • User has firstName and lastName, not displayName.
  • ImageFile has cdnUrl and fileSizeBytes, not url or sizeBytes.
  • enum values are lowercase snake_case.

Storageโ€‹

Storage is runtime-selectable:

  • r2 for Cloudflare R2;
  • s3 for S3-compatible storage;
  • local for 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.