Skip to main content
Archery runs as a native Dart process. A production deployment normally consists of a compiled application, a process supervisor, and an HTTPS reverse proxy.
Archery 1.5.0 is a stable-alpha, early-production release. Load-test your application, review framework changes before upgrading, and keep a rollback artifact for every deployment.

Production topology

The reverse proxy owns public TLS, request-size limits, and forwarded headers. Archery listens on a private loopback port and handles application requests.

Compile the application

From the project root:
Copy the compiled executable together with the configuration, templates, and public assets required at runtime. Keep releases in versioned directories so you can switch back to a previous artifact.
Compiling the executable does not embed application files that your code reads from disk. Deploy lib/src/config, lib/src/http/views, and lib/src/http/public when your application uses them.

Bind to a private address

When NGINX or Caddy runs on the same host, bind Archery to loopback:
Do not bind the application directly to a public interface unless the surrounding network policy is intentionally designed for it.

Inject secrets

Committed JSON files should contain non-sensitive defaults. Read production secrets from the process environment and apply them before providers that depend on them boot:
Use your hosting platform, secret manager, or process supervisor to supply values such as database passwords and AWS credentials. Do not print secrets in startup logs.

Run under systemd

A service unit keeps the application running and restarts it after recoverable failures:
After installing or changing the unit:
Keep the environment file readable only by the service account and administrators.

Proxy through NGINX

The following server block terminates public traffic and forwards requests to Archery:
Add TLS through your normal certificate workflow before enabling authentication or transmitting sensitive data.

Set application response headers

Apply explicit security headers and configure CORS for the origins that should access the application:
The bundled example uses Access-Control-Allow-Origin: * for development convenience. Do not combine a wildcard origin with authenticated browser traffic. Configure a trusted allowlist instead.

Shut down cleanly

Closing the listener stops new requests. Dispose the container to run registered cleanup callbacks, then shut down the application lifecycle:
Your database clients, file handles, and other external resources should register disposal callbacks or be closed explicitly.

Verify the release

Before directing public traffic to a new release:
  • Confirm the service starts without provider or migration errors.
  • Request a dedicated health endpoint.
  • Verify that templates and static assets are present.
  • Confirm the application can reach its Postgres connection.
  • Test authentication cookies over HTTPS.
  • Submit a state-changing form and verify CSRF protection.
  • Confirm CORS rejects untrusted origins.
  • Inspect service and reverse-proxy logs.
  • Exercise shutdown and restart behavior.
  • Preserve the previous executable and runtime files for rollback.

Architecture

Review application boot and shutdown responsibilities.

Configuration

Learn how configuration is loaded and overridden.