Shipping a Full-Stack App with Postgres to the Cloud
Gushwork names a deployed full-stack app as the minimum portfolio artefact. Handshake expects fluency with Postgres, APIs and the cloud. This section takes the app you have been building, a FastAPI or TypeScript API with Postgres and a small React frontend, and ships it to a public URL with CI, migrations and a health check. Every later chapter adds AI features to this exact codebase, so the time you spend getting the foundation right pays off repeatedly.
1. The target architecture
Recommended path: a container-friendly PaaS such as Render, Railway or Fly.io for the API, the platform's managed Postgres (or Neon or Supabase), and a static host such as Vercel, Netlify or Cloudflare Pages for the frontend. You get HTTPS, logs and automatic deploys with almost no ops work, and the same Docker image you built earlier runs unchanged.
Alternative: a single VM running your compose.yaml behind nginx. You learn more ops this way, since everything from the Linux section applies directly. In exchange, TLS, backups, OS updates and restarts become your job. Either choice is acceptable for the portfolio. Pick one and finish it.
Free tiers change often, and some of them sleep or expire. Check the current terms before you commit to a platform.
2. Make the app cloud-ready
Configuration from the environment
Nothing environment-specific belongs in the code. Read it from environment variables:
Locally these values come from .env through Compose. In the cloud you set them in the platform's dashboard. .env stays out of Git and out of the image.
Respect the platform's port
Most PaaS platforms tell your container which port to listen on through a PORT variable. Set a default in the Dockerfile and use it in a shell-form CMD so the variable expands:
Postgres connection strings
Two gotchas cause most first-deploy failures:
- Many providers hand out URLs that begin with
postgres://. SQLAlchemy 1.4 and later rejects that scheme. Use (or with the default driver) and normalise the scheme in your settings if needed.
Fix a real ticket in a small codebase you didn't write: read the code, change only the functions you're given, pass the tests, then submit for hidden checks and a score.
Open the lab →