Skip to Content
Deployment

Deployment and Servers

This page explains how we put PlugZero Analytics live on the internet and how our server stack is set up.


Where the code runs

We use a standard Linux stack to host the platform.

The Backend Stack

  • Operating System: Ubuntu 24.04 LTS
  • Web Server: Nginx (handles SSL and routing)
  • App Server: Gunicorn (runs the Django code)
  • Database: PostgreSQL (stored on a separate secure volume)
  • Task Queue: Redis and Celery (handles the background math)

The Frontend Stack

  • Platform: Vercel (preferred) or a standalone Node.js server.
  • Framework: Next.js 14 using the App Router.

How we push updates

We use GitHub Actions to automate our deployment.

Pushing code

When you merge code into the main branch, the deployment starts automatically.

Running tests

The system runs all the backend and frontend tests. If any test fails, the deployment stops immediately.

Building assets

The frontend compiles the React code into fast, static files.

Rolling restart

The backend server (Gunicorn) restarts its workers one by one. This means the site stays live during the update (Zero-downtime).

Server configuration

Environment Variables

We store all secrets in a .env file on the server. Never hardcode these in the project.

  • DATABASE_URL: Connection string for PostgreSQL.
  • SECRET_KEY: Django’s unique security key.
  • GEMINI_API_KEY: Used for the AI analysis engine.

Database Migrations

When you change a database table, you must run our migration command during deployment:

python manage.py migrate

Backup Rule: We take a full database snapshot every 6 hours. If anything goes wrong during a deployment, we can roll back to the last safe state in minutes.

Last updated on