Next.js Super Boilerplate 0.3.1: What Changed and How to Verify Your Upgrade

ByFedor Rychkov

November 16, 2026 02:48 PM

CI passed, the Docker image built, and the API started. The site still wouldn’t open over HTTPS. That was our first attempt to deploy Next.js Super Boilerplate 0.3.1.

This release adds scheduled publishing, runtime platform settings, and optional off-site MongoDB backups. But the deployment is the best place to start: it shows why green CI and a running container don’t prove users can reach your site.

Why the first deployment failed after CI passed

Previously, certbot could talk to Docker to trigger an nginx reload. In 0.3.1, we removed certbot’s access to the Docker socket. After renewing a certificate, certbot now drops a marker file into a shared volume. A watcher picks up the signal and tells nginx to reload gracefully. The certificate container no longer needs access to the host’s Docker controls.

The nginx startup command gained a background loop to watch for that file. We put & in the wrong place: it put the preceding setup chain in the background as well as the watcher. Nginx could start before its HTTPS configuration had been generated and validated. Running nginx -t afterward showed that the file on disk was valid, but it didn’t prove the running process had loaded that file.

During the first production deployment, the nginx container never became healthy, and a direct request to the demo failed its TLS handshake. The external smoke check never ran because the server-side deployment step had already failed.

The log also exposed a second bug. The deployment script expected the migration function to return a number: how many migrations to roll back. Instead of 0, it captured a message saying migrations were disabled and the number. Bash then failed to compare it as an integer. That didn’t cause the nginx failure, but it made the failure harder to read.

The hotfix fixed both issues. Config generation and validation finish before nginx starts; only the certificate watcher runs in the background. The migration function writes the count to stdout and diagnostics to stderr. Locally, we checked that nginx served requests with a valid configuration and refused to start with an invalid one. The next production deployment passed the external smoke check: the homepage returned 200, and the health endpoint reported db: ok. Only then did we publish GitHub Release v0.3.1.

What changes for developers and editors

Scheduled publishing runs in a worker, not a browser tab. An editor chooses a publication time, and the BullMQ worker picks up the due work. Before publishing, the code checks that the article is still in the expected state and that the revision hasn’t changed. That matters when an editor clicks Publish around the same time or two worker attempts overlap. The worker is still optional: manual publishing works without it. A scheduled article won’t go live automatically if the worker isn’t running.

The admin overview points out what needs attention. /admin can flag scheduled articles with no live worker, for example. Selected platform settings also move into the admin UI so they can be changed without rebuilding the app. This doesn’t replace environment configuration: values the process needs to start still belong outside the application.

Session changes account for rollback. The new version reads both legacy refresh tokens and hashed records, but it still writes the legacy format. It doesn’t rewrite the collection at startup, so rolling back to the previous image won’t leave that image trying to read records in a new format. The release also aligns the refresh token, database record, and cookie lifetimes: seven days at most, or less if configured. That’s a behavior change worth checking even though the upgrade doesn’t require new environment variables.

Off-site backups are optional. A local MongoDB dump can also be copied to S3-compatible storage or an SFTP destination. Remote deletion is off by default. And a successful upload is not the same as a successful restore: test recovery against a separate database.

Upgrade checklist

There are no new required environment variables for a standard upgrade. If your fork customizes Compose, nginx templates, or session policy, compare those pieces with the release before deploying.

  1. Before deployment: record the last known-good commit or image tag and confirm you can retrieve it. Check that you have a recent backup. Don’t combine the app upgrade with moving MongoDB or Redis volumes.

  2. Check your configuration: run pnpm doctor against the target configuration. Review warnings and check whether your product relies on refresh sessions longer than seven days. Enable the worker or off-site copies only where you need them.

  3. Verify from outside the server: load the homepage over HTTPS and request /api/v1/healthcheck. Check the body as well as the status: if MongoDB is expected, look for db: ok. In non-strict mode, a database problem doesn’t necessarily produce a non-200 response.

  4. Exercise real flows: test a fresh sign-in and make sure a session created before the upgrade can still refresh. If you use the worker, schedule a test article and check that it goes live once, at the expected time. If the worker is intentionally off, worker: never on its own doesn’t mean the site is down.

  5. If you enable off-site backups: check that a fresh copy arrived at the expected destination and restore it into an isolated database. Don’t use production MongoDB for a recovery drill.

The lesson from 0.3.1: verify the upgrade where its effects actually show up. For deployment, that’s public HTTPS. For sessions, it’s refreshing an existing session. For backups, it’s getting the data back.