Skip to content

v0.1.1a (Deprecated)

Pre-release
Pre-release

Choose a tag to compare

@Hailey-Ross Hailey-Ross released this 06 Jun 16:33
5332399

Deprecated. This release is superseded by v0.1.2b and is no longer supported. Please upgrade.


Beta Warning -- hailsDotGO is in active development. This release is not recommended for production use. APIs, database schema, and configuration may change without notice between versions.


What's new in v0.1.1a

  • Page maintenance toggles -- admins can enable/disable individual pages (Raids, DPS, PvP, Events, Trainers, Trainer Directory, Raid Finder, Shinies) from the admin panel; disabled pages show a maintenance screen instead of their content
  • Trainer Directory overhaul -- all registered, non-hidden, non-disabled users now appear in the directory; profile_public gates rich profile details (trainer code, pronouns, location, favourite Pokemon) rather than directory visibility; sorted by online status, staff rank, super-donator status, raid XP, then alphabetically
  • Tester role -- new tester role shows "PKMN Scientist" rank label in the Raid Finder and sorts above regular users in the Trainer Directory
  • Tag management improvements -- superadmins can now edit existing tags (name and color); tag listing and assignment/removal lowered to moderator level; tags can be assigned to any user

Prerequisites

Requirement Version
Go 1.25+
Node.js + npm 18+
MySQL 8+
Caddy (or other reverse proxy) 2+

Setup

1. Clone the repo

git clone https://github.com/Hailey-Ross/hailsDotGO.git
cd hailsDotGO
git checkout v0.1.1a

2. Install frontend dependencies

npm install

3. Configure environment

cp .env.example .env

Edit .env with your values:

Variable Required Description
DB_HOST Yes MySQL host and port -- e.g. localhost:3306
DB_USER Yes MySQL username
DB_PASS Yes MySQL password
DB_NAME Yes MySQL database name (e.g. hailsdotgo)
SUPERADMIN_USER Yes Username that always has full admin privileges
CSRF_KEY Recommended 64-char hex string -- generate with openssl rand -hex 32
PORT No HTTP listen port, default 8080
PAYPAL_CLIENT_ID Store only PayPal REST API client ID
PAYPAL_CLIENT_SECRET Store only PayPal REST API client secret
PAYPAL_MODE Store only sandbox or live
PAYPAL_WEBHOOK_ID Store only PayPal webhook ID for payment confirmation

CSRF_KEY is optional but strongly recommended. Without it, CSRF tokens regenerate on every restart and invalidate all active login sessions.

4. Set up the database

mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS hailsdotgo CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -p hailsdotgo < schema.sql

schema.sql creates all tables and seeds the required site_settings rows (all pages default to enabled, registration defaults to closed).

Upgrading from a previous install? Do not re-run the full schema. Instead, uncomment and execute only the migration blocks at the bottom of schema.sql that you have not applied yet.

5. First admin account

Registration is closed on a fresh install. To create your first account:

Option A -- open registration temporarily:

UPDATE site_settings SET setting_value = '1' WHERE setting_key = 'registration_open';

Set SUPERADMIN_USER=yourusername in .env, start the server, register at /register, then close registration from the admin panel.

Option B -- promote via SQL after registering:

UPDATE users SET role = 'admin' WHERE username = 'yourusername';

6. Build

# TypeScript (outputs to static/js/)
npm run build

# Go binary
go build -o hailsDotGO .

Or: make build (runs both).

Cross-compile for Linux from Windows:

$env:GOOS = "linux"; $env:GOARCH = "amd64"; $env:CGO_ENABLED = "0"
go build -ldflags="-s -w" -o hailsDotGO-linux .

7. Run locally

# Terminal 1 -- recompile TypeScript on save
npm run watch

# Terminal 2 -- Go server
go run .

Visit http://localhost:8080


Server Deployment (Linux / systemd)

Create service user and directory

sudo useradd --system --no-create-home --shell /usr/sbin/nologin hailsdotgo
sudo mkdir -p /opt/hailsdotgo
sudo chown hailsdotgo:hailsdotgo /opt/hailsdotgo

Copy files to the server

/opt/hailsdotgo/hailsDotGO     <- compiled Linux/amd64 binary
/opt/hailsdotgo/app.env        <- your .env (chmod 600, owned by hailsdotgo)
/opt/hailsdotgo/templates/     <- all .html files from templates/
/opt/hailsdotgo/static/        <- static/ directory (css, js, sprites)

Install and start the service

A ready-made unit file is included at deploy/hailsdotgo.service:

sudo cp deploy/hailsdotgo.service /etc/systemd/system/hailsdotgo.service
sudo systemctl daemon-reload
sudo systemctl enable hailsdotgo
sudo systemctl start hailsdotgo

The service runs as the hailsdotgo user, loads environment from /opt/hailsdotgo/app.env, and restarts automatically on failure.


Reverse Proxy (Caddy)

A sample Caddyfile is included at deploy/Caddyfile. The relevant block:

yourdomain.com {
    encode gzip zstd
    reverse_proxy localhost:8080
}

Replace yourdomain.com with your actual domain. Caddy provisions HTTPS automatically via Let's Encrypt.

sudo systemctl reload caddy

Optional: Supporter Store

The store is disabled by default. To enable it:

  1. Set the four PAYPAL_* variables in app.env.
  2. Enable from the admin panel, or directly:
    UPDATE site_settings SET setting_value = '1' WHERE setting_key = 'store_enabled';
  3. Run the store migration block in schema.sql (seeds store_items and purchases tables with two default items).

Data Sources

Source What it provides
PoGoAPI Pokemon stats, moves, shinies, type effectiveness, CP multipliers
ScrapedDuck Live raid boss data (sourced from LeekDuck)
PokeAPI Pokemon sprites, Pokedex text, genus, legendary flags, cries
Open-Meteo Weather data for GO weather boost detection (no API key required)
Pokemon Showdown Trainer class sprites for profile avatars
Dreamstone Mysteries GBA-style trainer sprites (bundled as local static files)