Skip to content

Installation from Source

Prerequisites

Notification Service

You will need at least one bot token:

Database Setup

Create a database and user for Dexter. Use a strong password.

For local connections:

CREATE DATABASE dexter;
CREATE USER 'dexteruser'@'localhost' IDENTIFIED BY 'yourStrongPassword';
GRANT ALL PRIVILEGES ON dexter.* TO 'dexteruser'@'localhost';

For remote connections (only if needed):

CREATE DATABASE dexter;
CREATE USER 'dexteruser'@'%' IDENTIFIED BY 'yourStrongPassword';
GRANT ALL PRIVILEGES ON dexter.* TO 'dexteruser'@'%';

Building Dexter

  1. Clone the repository:

    git clone https://github.com/yourorg/dexter.git
    cd dexter
    
  2. Build the binary:

    go build -o dexter ./cmd/dexter
    
  3. On first start, Dexter creates config/local.json from sensible defaults. Edit it to add your database credentials and bot tokens:

    ./dexter
    # Edit config/local.json, then restart
    

Game data

Dexter automatically downloads game data files (monsters, moves, items, grunts, quests, types, translations) on first startup and refreshes them every 6 hours. You can also regenerate manually with go run ./cmd/dexter-generate.

Updating

git pull
go build -o dexter ./cmd/dexter
# Restart Dexter

Running as a Service

PM2 is the preferred process manager for the Golbat/Dragonite stack. If you don't already have it:

npm install -g pm2

Start Dexter with PM2:

pm2 start ./dexter --name dexter

Save the process list so it survives reboots:

pm2 save
pm2 startup   # follow the printed command to enable boot persistence

Useful PM2 commands

pm2 status                 # Overview of all processes
pm2 logs dexter            # Follow logs
pm2 restart dexter         # Restart
pm2 stop dexter            # Stop
pm2 delete dexter          # Remove from PM2

Using systemd

If you prefer systemd, create /etc/systemd/system/dexter.service:

[Unit]
Description=Dexter Pokemon GO Alert System
After=network.target mysql.service

[Service]
Type=simple
User=dexter
WorkingDirectory=/opt/dexter
ExecStart=/opt/dexter/dexter
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl daemon-reload
sudo systemctl enable dexter
sudo systemctl start dexter

Useful systemd commands

sudo systemctl status dexter    # Check status
sudo systemctl restart dexter   # Restart
sudo journalctl -u dexter -f    # Follow logs

Next: Basic Configuration