The first five parts turned Encore from an idea into a deployable product. Now package it for your chosen cloud, put it online and check the full customer flow, from Google sign-in to a confirmed booking. The next people to use it should be customers, not just its builders.

Deploy the frontend and backend

Encore needs three managed services, not a particular cloud vendor. Choose a static host for the React files, a container service for the API and managed PostgreSQL for durable bookings. Docker Compose remains a local integration tool, not the production deployment.

LayerResponsibilityExample services
Static hostingServe frontend/dist and public configuration over HTTPS.Azure Static Web Apps, AWS Amplify Hosting or Firebase Hosting
Managed containersRun the API image with HTTPS ingress, logs and health checks.Azure Container Apps, Amazon ECS on Fargate or Google Cloud Run
Managed PostgreSQLPersist inventory, bookings and retry keys with backups.Azure Database for PostgreSQL Flexible Server, Amazon RDS for PostgreSQL or Cloud SQL for PostgreSQL

Start with one provider and a nearby region for the API and database. The application boundaries stay the same whichever services you choose.

Cloud-neutral deployment: static hosting delivers React files to the browser, the browser calls the managed container API over HTTPS, and only the API connects to managed PostgreSQL

Give this deployment plan, Part 5’s artifacts and your chosen provider to AI. Ask it to generate the provider-specific infrastructure configuration and deployment commands. The shell sketch below is pseudocode, not a ready-to-run deployment script; review the generated settings, permissions and cost before using it.

Publish the API image

Store the API image in a private container registry supported by your container service. Authenticate to the intended account, create the image repository and grant the service permission to pull it. Build for the service’s CPU architecture; this sketch uses Linux/x86-64, including when building on an Apple Silicon laptop.

# Pseudocode: replace the registry and release placeholders.
REGISTRY=registry.example.com
IMAGE="$REGISTRY/encore-api:release-id"
# Authenticate to the registry and create the repository using your provider.
docker build --platform linux/amd64 -t "$IMAGE" ./backend
docker push "$IMAGE"

Use a new immutable tag or image digest for each release so a rollback selects a known image.

Run the API and database

Deploy in this order so the API has a database, settings and a reachable HTTPS address before customers use it. Uploading an image alone does not create these resources.

  1. Create managed PostgreSQL with backups enabled and public access disabled. Permit database connections only from the API’s private network path. Use a separate, least-privilege application role rather than the database administrator.
  2. Run Part 5’s generated, versioned migration through an authorized job with database access. Do not apply the local test seed to production.
  3. Create the managed container service using the published image. Listen on 0.0.0.0 and the platform’s PORT; configure ingress to that same port. Some services inject PORT, while others require you to set it. Configure /health as the readiness check so the service does not receive customer traffic before it can reach PostgreSQL.
  4. Configure private database connectivity using the service’s network integration or connector. Allow outbound HTTPS to Google’s token and signing-key endpoints. Image pulls and secret loading also need working network paths; follow your provider’s routing requirements rather than assuming every service needs the same gateway.
  5. Give the service identity permission to pull its image and read only its required secrets. Inject the settings below at startup, not during the image build. Keep the session encryption key consistent across replicas so any instance can read a customer’s cookie.
  6. Attach api.example.com with a valid HTTPS certificate, using managed ingress or an HTTPS load balancer as the platform requires. Point DNS to that entry point and register the final Google callback before testing sign-in.
Runtime settingValue or source
NODE_ENVproduction
PORTThe platform-provided port, or the port configured for ingress
FRONTEND_ORIGINhttps://app.example.com
GOOGLE_REDIRECT_URIhttps://api.example.com/auth/google/callback
GOOGLE_CLIENT_IDYour web OAuth client ID
PGHOST, PGPORT, PGDATABASE, PGUSERManaged database endpoint, port, database and application role
GOOGLE_CLIENT_SECRET, SESSION_KEY_HEX, PGPASSWORDReferences to your provider’s secret store, injected at startup

Configure pg to use TLS and verify the database certificate with the trust chain your provider requires. Supply any required CA certificate to the runtime; never disable certificate verification to make a connection succeed. Restart or redeploy instances after rotating injected secrets, since existing process environments do not refresh automatically.

Bound the connection pool per instance and the service’s maximum instance count so scaling does not exhaust PostgreSQL’s connection limit. Leave headroom for migrations, overlapping deployments and administration. Enable logs, alerts and rollback, and budget for compute, database capacity, storage and networking even when traffic is low.

Publish the frontend

Connect the repository to your chosen static host and set the application root to frontend. Run npm ci followed by npm run build, then publish dist from that directory. A file-upload workflow can publish the same built files. Attach app.example.com and enable HTTPS.

Publish frontend/public/config.json with {"apiBaseUrl":"https://api.example.com"}. This is public configuration, not a secret. Changing it requires republishing that static file, but not recompiling the frontend JavaScript. Deploy the custom frontend and API domains together so cookie-based requests remain same-site. Unrelated default hosting domains will not work with Part 4’s SameSite=Lax session cookie.

CI checks frontend changes and backend changes independently; shared contract changes check both. Keep /v1 compatible across separate releases.

Test the complete booking flow

Run package tests before packaging, container checks before publishing and joined checks against deployed origins.

LayerCheckExpected result
Backend unit and SQL integrationUse a temporary database for validation, ownership, contention and retries. Reject wrong-browser login returns, reused codes, modified cookies and expired sessions.Correct 400/401/403/404/409 errors; no overselling or duplicate booking; no session for invalid login.
Frontend componentsMock signed-out, success, timeout and failure responses.Login starts when needed; retries reuse the key; errors never appear as confirmed bookings.
Joined browser flowSign in through Google, book, retry and read as another user. Reject a changed payload with the same key and a missing CSRF token.201 and Location; the same booking on retry; 409 for changed input; another user denied.
Container and deployed serviceRestart the API; interrupt SQL during creation, then retry after recovery.Bookings persist; database failure never returns 201; recovery creates no duplicate.

A successful deployment is only the start. Walk through the live app as a customer and fix the rough edges before inviting the first users. Keep a record of each release so feedback points to something you can reproduce and improve.

Encore is now a real application you can put in front of customers. Use it to gather feedback, test the market and learn whether the business is moving in the right direction. Its small footprint keeps overhead low and the product nimble, making it easier to change features, pivot the business or try a different direction. Once customers validate the idea, its architecture is worth scaling.

This completes Act I: Build Something Worth Scaling. Stay tuned for the next act.