- Node.js + TypeScript
- Fastify (HTTP server)
- Zod (Validation)
- Swagger + Swagger UI (API Documentation)
- Drizzle ORM (Database ORM)
- PostgreSQL (Database)
- Cloudflare R2 via AWS SDK S3
- Vitest (Testing)
- Biome (Linter & Formatter)
Defined and validated in src/env.ts:
PORT(default: 3333)NODE_ENV(development | test | production)DATABASE_URL(e.g.,postgresql://docker:docker@localhost:5432/upload)CLOUDFLARE_BUCKET_NAMECLOUDFLARE_ACCOUNT_IDCLOUDFLARE_ACCESS_KEYCLOUDFLARE_ACCESS_SECRETCLOUDFLARE_PUBLIC_URL
Create a .env file with these variables for local development.
- Start PostgreSQL with Docker Compose:
docker compose up -d
- Install dependencies:
pnpm install
- Apply database migrations (Drizzle):
pnpm db:migrate
- Run the development server:
pnpm dev
- Open API docs (Swagger UI):
POST /uploads: Upload an image (multipart/form-data).GET /uploads: Get a list of all uploads.POST /uploads/exports: Export uploads as a CSV file.
The OpenAPI schema is served and transformed for multipart via src/infra/http/server.ts and src/infra/http/transform-swagger-schema.ts.
Run the test suite:
pnpm testThis project is part of a practical lesson in the postgraduate program "Tech Developer 360" at Rocketseat. Learn more at: https://www.rocketseat.com.br/faculdade/tech-developer-360
ISC (default). See the license field in package.json.