- Operating
- Self-hosting
From source
This guide runs HappyView directly with cargo run, from a clone of its alpha branch. If you’d rather run the whole stack in containers, see Running the development stack in HappyView’s CONTRIBUTING.md. To deploy from prebuilt images, see Docker.
Prerequisites
Section titled “Prerequisites”- rustup. The repository’s
rust-toolchain.tomlpins the Rust version, and rustup installs it on the first build. - Node.js and npm, to build the dashboard.
- (Optional) PostgreSQL if you prefer Postgres over the default SQLite. The repository’s Compose files and tests use version 17.
1. Clone and configure
Section titled “1. Clone and configure”git clone --branch alpha https://github.com/gamesgamesgamesgamesgames/happyviewcd happyviewcp .env.example .envThe default branch holds v2, so name alpha. Edit .env to point at your running services:
# SQLite (the default): no setup needed, the file is created automaticallyDATABASE_URL=sqlite://data/happyview.db?mode=rwcPUBLIC_URL=http://127.0.0.1:3000# Generate with: openssl rand -base64 48SESSION_SECRET=Or if you prefer Postgres:
DATABASE_URL=postgres://happyview:happyview@localhost/happyviewSee Configuring an instance for what to set first, the Configuration reference for every variable, and the database setup guide for details on both backends.
2. Create the database (Postgres only)
Section titled “2. Create the database (Postgres only)”If using SQLite, skip this step: HappyView creates the database file automatically.
If using Postgres:
createdb happyviewOr if using a Postgres user with a password:
psql -c "CREATE DATABASE happyview;" -U postgresHappyView runs migrations automatically on startup, so no manual migration step is needed.
3. Build the dashboard
Section titled “3. Build the dashboard”A plain cargo run carries no dashboard of its own and serves ./web/out, so export it once:
cd webnpm cinpm run buildcd ..Skip this if you need only the API. Run it again after pulling changes to web/.
4. Start HappyView
Section titled “4. Start HappyView”cargo runHappyView starts on port 3000 (configurable via the PORT environment variable). curl http://127.0.0.1:3000/health answers ok once it’s listening.
Next steps
Section titled “Next steps”Your HappyView instance is running. Install an interpreter before saving any script: a self-hosted instance ships with none (Languages). Then deploy a project to it.
© HappyProto

