Skip to content
fernando.catalan
All projects

WorkWeb · Backend · Cloud

Web platform for a school makerspace network

A platform where students from a school network publish and share their digital fabrication projects, with a 3D viewer, moderation and roles. I built nearly all of it and migrated it from Supabase to AWS: Amplify, RDS, S3 with CloudFront and SES.

Role
Lead developer and maintainer. Full stack and cloud
Period
Dec 2025 — Present
Status
In production
Team
Mostly me. The latest visual redesign was done by another team member

Professional project: the name and client details are anonymized. The technical description is real.

Context

A network of technical high schools runs digital fabrication workshops (makerspaces) where students design, 3D print and build prototypes. There was no shared place to store, showcase and download those projects.

I am the lead developer and the repository maintainer: data model, authentication and roles, API, interface, 3D viewer, email, tests, CI and AWS deployment. I have been building and running it for a year.

The problem

Most users are students aged 14 to 18, so a plain file repository is not enough. Each project needs controlled visibility (school only, whole network or public), moderation before publishing, and as little personal data stored as possible.

The files are also heavy: 3D models of up to 50 MB that should never travel through a serverless SSR server.

What I built

  • A Next.js 15 monolith on the App Router: Server Components querying PostgreSQL through Prisma (20 models and 22 versioned migrations) and an API with 29 handlers.

  • Google sign-in, automatic school assignment based on the email domain and four roles, enforced in the middleware and by guards in the API.

  • Project publishing with images and 3D files, three visibility levels and moderation: both new projects and edits to approved ones go through review.

  • An in-browser 3D viewer for STL, OBJ and 3MF built with Three.js, with touch controls on mobile.

  • Direct browser-to-S3 uploads through presigned URLs, a per-destination allowlist of file types, image re-encoding to WebP and a record of who owns each file.

  • Onboarding flows: a public form for a school to request joining the network, email invitations that expire and account activation by link.

  • Transactional email with 12 React Email templates, decoupled from the provider through the Strategy pattern (Amazon SES in production).

  • An audit log with 23 action types and account deletion inside a Serializable transaction that keeps projects anonymously.

  • 3D walkthroughs of the workshops built from scans, with the models protected by CloudFront signed URLs and audience-based access control.

  • 189 automated tests: 120 unit, 44 API integration and 25 end-to-end with Playwright, with per-role session fixtures.

Architecture

architecture.svgSwipe →

Three environments: local with Docker Compose, QA on the `develop` branch and production on `main`, with QA and production storage in different AWS accounts.

  • CI/CD
  • Client
  • External system
  • Compute
  • Edge and network
  • Managed service
  • Data
  • Outside AWS:
    • GitHub: Actions: tests per PR
    • Browser: students · teachers
    • Google OAuth: sign-in
  • Edge and compute:
    • Amplify Hosting: Next.js SSR
    • CloudFront: files · signed URLs
  • Data and services:
    • Amazon SES: 12 templates
    • RDS PostgreSQL: Prisma · 22 migrations
    • Amazon S3: images · 3D models

Connections:

  • GitHub → Amplify Hosting (per-branch build)
  • Browser → Amplify Hosting
  • Browser → CloudFront
  • Browser → Google OAuth
  • Amplify Hosting → Amazon SES
  • Amplify Hosting → RDS PostgreSQL
  • Amplify Hosting → Amazon S3 (presigned URLs)
  • CloudFront → Amazon S3

Technical decisions

  1. Per-branch continuous deployment, with migrations in the build

    Amplify Hosting publishes main as production and develop as QA. The build runs prisma migrate deploy with an admin credential that is only available during the build, while the app runs as a different, least-privilege user. Getting there meant adopting Prisma Migrate on an already existing production database (baselining).

  2. QA and production storage in separate AWS accounts

    In Amplify, app-level variables are inherited by every branch, so one environment can end up pointing at the other's storage because of a single variable. I split storage across two accounts and replaced static keys with per-branch compute roles.

  3. Files never go through the server

    The browser uploads straight to S3 with a presigned URL and files are served through CloudFront. The server only signs, validates the type and records ownership, which prevents using or deleting someone else's files.

  4. JWT sessions that get revalidated

    With JWTs, nothing checks the database again after sign-in. The token is revalidated against the database every 5 minutes, so deleting an account or changing a role actually takes effect.

  5. Nothing session-dependent is cached

    Every response that goes through the middleware is marked as non-cacheable, and the same rule is versioned at the CDN level. Only static files with hashed names are cached.

  6. Privacy by design

    The view counter stores no IP address or browser: for signed-out visitors it uses a daily HMAC of the IP. Student profiles are kept out of search engines, and I produced the data-processing inventory the legal team works from for Chile's data protection law (Ley 21.719).

Stack

Frontend
  • Next.js 15
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • Three.js
Backend and data
  • PostgreSQL
  • Prisma 6
  • Auth.js v5
  • React Email
  • sharp
Cloud
  • AWS Amplify Hosting
  • Amazon RDS
  • Amazon S3
  • Amazon CloudFront
  • Amazon SES
  • IAM
Quality
  • Vitest
  • Playwright
  • GitHub Actions
  • ESLint
  • Docker Compose

Outcome

  • In production, with a separate QA environment and a year of continuous development.

  • Migration from Supabase and Gmail SMTP to AWS (RDS, S3 with CloudFront, SES and Amplify) in three days.

  • 189 tests and two CI workflows: unit and integration on every push and pull request to main and develop, and end-to-end with Playwright on pull requests into main.

  • A hardened production database: least-privilege application user, enforced SSL, encryption at rest and automated backups.

What I learned

  • With JWT sessions, deleting an account or changing a role has no effect until the token is revalidated. And the middleware's Edge runtime cannot use Prisma.

  • CORS with CloudFront and S3: if the bucket echoes the exact origin and the cache key does not include Origin, the first cached response breaks every other environment. The header gets added at the edge instead.

  • Automatically linking OAuth accounts by email is risky. The guarantee has to live in a unique database index, not only in application code.

  • A signed URL only needs to cover the start of the download: a short lifetime shrinks the leak window at no cost to the user.

  • To end-to-end test an app with OAuth sign-in, per-role test sessions with Playwright fixtures work well.

  • With underage users: store only what gets used, pseudonymize the IP and work with the legal team from a real data inventory.