Skip to main content

First Run

What Happens on First Run

When ZyveraWeb starts for the first time with an empty plugins/ZyveraWeb/ directory, it automatically populates the following files:

Default Configuration

config.yml is created with sensible defaults:

host: "0.0.0.0"
port: 8080

api:
  cors-origins:

rate-limit:
  placeholder:
    requests: 180
    per: 30s
  players:
    requests: 200
    per: 20s

sites:
  - domain: ""
    dir: "site/default"

Default Static Website

The default website (site/default/) displays a welcome message and live player list:

  • index.html — HTML page with a player grid container
  • style.css — Styling for the player grid
  • script.js — JavaScript that fetches /api/players and displays online players

Example Node.js Projects

Two demonstration projects are created in site/:

site/demo/ — Simple API Backend

  • server.js — Handles /api/info, /api/echo, and /api/message routes
  • public/ — Vanilla JS frontend that calls the API
  • package.json — Empty (no npm dependencies)

site/react-demo/ — React SPA + API Backend

  • server.js — API endpoint returning JSON
  • public/ — React SPA (React loaded from CDN)
  • package.json — Empty (uses CDN React)

What You Should Do After First Run

  1. Review config.yml — Adjust the port and rate limits for your environment.
  2. Customize the website — Replace files in site/default/ with your own content.
  3. Configure a domain — If you have a domain, add it to a site entry in the sites: section and point your DNS to the server IP.
  4. Enable SSL — Either set up automatic certificates with the /zyveraweb acme command or place your own certificates in the ssl/ folder and add an ssl: block to your site.
  5. Set up virtual hosts — Add multiple sites under the sites: section in config.yml (see Virtual Hosts).

Persistent State

The following are persisted across restarts:

  • config.yml — Not overwritten after initial creation
  • site/ files — Not overwritten after initial creation
  • ssl/ certificates — Persist until replaced
  • node_modules/ directories — npm packages are preserved