Deployment

Deployment

Server

Tenta's server is backed by PostgreSQL and an MQTT broker. During development and testing, these services are automatically spun up locally for you. In production, it's better to deploy them independently from the server.

You can get started with a free MQTT broker from HiveMQ (opens in a new tab). TimescaleDB's license restricts other cloud providers from offering it feature-complete as a service. You can either deploy and manage it yourself or use TimescaleDB's own TimescaleDB Cloud (opens in a new tab) (the first 30 days are free).

When you have your PostgreSQL instance and the MQTT broker ready:

  • Clone the repository and switch into the server directory
  • Specify your environment variables in a .env file (see .env.example)
  • Initialize the database via (set -a && source .env && ./scripts/initialize)
  • Make sure that you have Docker installed
  • Build the Docker image with ./scripts/build

You can run this Docker image locally with docker run -p 127.0.0.1:8421:8421 --env-file .env tenta or deploy it to your cloud provider or choice (e.g. DigitalOcean's App Platform (opens in a new tab)).

Dashboard

All of the following paths are relative to the dashboard/ directory of this repository.

The dashboard can be hosted on any web server that supports NodeJS applications. Some hosting options are fly.io (opens in a new tab), Vercel (opens in a new tab), Render (opens in a new tab) or DigitalOcean (opens in a new tab).

The file .env.template contains all available environment variables. The command npm run build creates a production build in the out/ directory. This directory can be served by running npm run start.

💡

The dashboard might be hostable as a static site in the future. See https://github.com/iterize/tenta/issues/26 (opens in a new tab). Anyone is welcome to contribute!