Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
945c2d9
Move openplanet plugin to new folder
SoWieMarkus Oct 7, 2025
feed6ce
Remove WheelGPT plugin files and related configurations
SoWieMarkus Oct 7, 2025
880cde7
Initialize database module
SoWieMarkus Oct 7, 2025
869bc79
Add initial database configuration and command structure
SoWieMarkus Oct 7, 2025
ad185f2
Add TrackmaniaMap model and associated methods with tests
SoWieMarkus Oct 7, 2025
70f5b1f
Add comment for TrackmaniaIOLink method to clarify its purpose
SoWieMarkus Oct 7, 2025
5f395a9
Refactor guess command: remove unused GuessCommand and related files
SoWieMarkus Oct 7, 2025
20e4e7d
Added .gitignore
SoWieMarkus Oct 9, 2025
5212e15
Move typescript code in legacy folder
SoWieMarkus Oct 9, 2025
2f30baf
Add postgres to docker compose
SoWieMarkus Oct 9, 2025
ac726fe
Fix formatting issues in README.md for consistency
SoWieMarkus Oct 10, 2025
39b6cc9
Add docker support
SoWieMarkus Oct 10, 2025
c6052f4
Moved website into root directory
SoWieMarkus Oct 10, 2025
79b3fa7
Moved server logic into server directory
SoWieMarkus Oct 10, 2025
d5932b4
Added workflows for server and frontend
SoWieMarkus Oct 10, 2025
4411ceb
Refactor docker-compose to specify build context for services and add…
SoWieMarkus Oct 10, 2025
1f502e3
Moved server logic into server directory
SoWieMarkus Oct 10, 2025
8908c0a
Update Go version file path in workflow configurations to 'server/go.…
SoWieMarkus Oct 10, 2025
930a4da
Update test command in workflow to target server directory
SoWieMarkus Oct 10, 2025
9a63924
Fix workflow defaults to set working directory for test job
SoWieMarkus Oct 10, 2025
4aea034
Update test command in workflow to run tests from the current directory
SoWieMarkus Oct 10, 2025
6e4bfc7
Rename workflow to 'Server Module Tests' for clarity
SoWieMarkus Oct 10, 2025
632449a
Refactor database configuration to load from environment variables an…
SoWieMarkus Oct 10, 2025
5f9eb71
Add missing branch and path filters for push events in workflow
SoWieMarkus Oct 10, 2025
7bca8a0
Add .dockerignore file to exclude node_modules, .git, and dist direct…
SoWieMarkus Oct 10, 2025
2194dec
Add NewInstance function to create WheelGPT instances
SoWieMarkus Oct 10, 2025
4403f53
Implement GET request method in Client for API interaction
SoWieMarkus Oct 10, 2025
e2e4b74
Refactor main function to load database configuration and initialize …
SoWieMarkus Oct 10, 2025
c942353
Remove comment from website service port mapping in docker-compose.yml
SoWieMarkus Oct 10, 2025
7aa53ef
Add Twitch API models and methods for streams and users
SoWieMarkus Oct 10, 2025
a2ed7ff
Add Twitch configuration loading and tests
SoWieMarkus Oct 11, 2025
93f846c
Implement Twitch bot functionality with event handling and WebSocket …
SoWieMarkus Oct 11, 2025
d0679e3
Refactor database connection and migrater to use pointers; update Twi…
SoWieMarkus Oct 11, 2025
abe5f48
Move event type to top of file
SoWieMarkus Oct 11, 2025
5330856
Refactor SubscriptionInfo struct to use 'any' type for Condition fiel…
SoWieMarkus Oct 11, 2025
a62ce11
Added OAuth workflows and tests for Twitch identity client
SoWieMarkus Oct 11, 2025
dad77a6
Refactor post method to use 'any' type for result parameter; add IsEx…
SoWieMarkus Oct 11, 2025
4f440aa
Add comment to clarify IsExpired method for AppAccessToken
SoWieMarkus Oct 11, 2025
3adeebc
Implement app token management in Client; add tests for getAppToken m…
SoWieMarkus Oct 11, 2025
aaac1ce
Translated german comments
SoWieMarkus Oct 12, 2025
8cc6b65
Refactor identity client and add tests for access token requests
SoWieMarkus Oct 13, 2025
e225bf0
Rename IdentityAPI to TwitchIdentityAPI for consistency across the co…
SoWieMarkus Oct 13, 2025
b577842
Add GetUserByAccessToken method and tests for user retrieval by acces…
SoWieMarkus Oct 13, 2025
94d3916
Refactor GetStreams method to accept user IDs and return StreamRespon…
SoWieMarkus Oct 13, 2025
1d61112
Refactor GetUsers and GetUserByAccessToken methods to return UserResp…
SoWieMarkus Oct 13, 2025
63b4b23
Implement Trackmania Exchange API client and methods; add tests for c…
SoWieMarkus Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .github/workflows/check-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check Server Module

on:
push:
branches:
- main
paths:
- 'server/**'
pull_request:
branches:
- '*'
paths:
- 'server/**'

jobs:
check-server:
name: Check Server
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
check-latest: true
go-version-file: 'server/go.mod'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
33 changes: 33 additions & 0 deletions .github/workflows/check-website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check Website Module

on:
push:
branches:
- "main"
paths:
- 'website/**'
pull_request:
branches:
- "*"
paths:
- 'website/**'

jobs:
check-website:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./website

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install dependencies
run: npm install

- name: Build the project
run: npm run build

- name: Run Biome CI check
run: npx @biomejs/biome ci
53 changes: 53 additions & 0 deletions .github/workflows/docker-build-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker Test

on:
pull_request:
branches:
- "*"
paths:
- 'server/**'

jobs:
docker-build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: ./server
file: ./server/Dockerfile
push: false
tags: wheelgpt:test
platforms: linux/amd64,linux/arm64

- name: Test migrations binary
run: |
echo "Testing migrations binary..."
docker run --rm wheelgpt:test ./migrations --help || echo "migrations binary exists and runs"

- name: Test api binary
run: |
echo "Testing api binary..."
timeout 5 docker run --rm wheelgpt:test ./api || echo "api binary exists and starts"

- name: Test wheelgpt binary
run: |
echo "Testing wheelgpt binary..."
timeout 5 docker run --rm wheelgpt:test ./wheelgpt || echo "wheelgpt binary exists and starts"

- name: Test all binaries exist
run: |
echo "Checking all binaries exist in container..."
docker run --rm wheelgpt:test ls -la ./migrations ./api ./wheelgpt

- name: Test image size
run: |
# Get image size and output for monitoring
docker images wheelgpt:test --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
56 changes: 56 additions & 0 deletions .github/workflows/docker-push-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and Push Server Docker Image

on:
push:
branches:
- main
paths:
- 'server/**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./server
file: ./server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
30 changes: 30 additions & 0 deletions .github/workflows/test-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Server Module Tests

on:
push:
branches:
- 'main'
paths:
- 'server/**'
pull_request:
branches:
- '*'
paths:
- 'server/**'

jobs:
test-server:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server

steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'server/go.mod'
- name: Run tests
run: go test -v ./...
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
node_modules
dist
.turbo
.env

/generated/prisma

prisma/dev.db
prisma/dev.db-journal
.env
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![WheelGPT Banner](images/header.jpg)
# ![WheelGPT Banner](images/header.jpg)

[![](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-flat.png)](https://github.com/apps/in-solidarity)
[![In Solidarity Banner](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-flat.png)](https://github.com/apps/in-solidarity)

More information on [wheelgpt.dev](https://wheelgpt.dev). Get the [OpenPlanet Plugin](https://openplanet.dev/plugin/wheelgpt-plugin).

Expand Down Expand Up @@ -32,7 +32,7 @@ With the Twitch Bot, your viewers can guess what your next best time will be wit

If the plugin is activated, whenever you set a new best time on a map, this time will be sent to our server. Afterwards all received guesses of your users will be checked and in the bot will announce in the chat which viewer was closest with the guess.

If you want to deactivate that your best times are sent to our server, you can deactivate this under `Settings` -> `WheelGPT-Plugin` -> ` Send PBs to Server`.
If you want to deactivate that your best times are sent to our server, you can deactivate this under `Settings` -> `WheelGPT-Plugin` -> `Send PBs to Server`.

WheelGPT features a leaderboard that tracks viewer performance across guessing sessions. The leaderboard is accessible at `https://wheelgpt.dev/leaderboard/{channelId}` and provides:

Expand All @@ -57,11 +57,11 @@ The leaderboard encourages friendly competition among viewers and adds a persist
With the Twitch bot, viewers can use the command `!map` to find out which map you are currently playing.
If the plugin is activated, whenever you enter a new map, this map is sent to our server. If you use the `Champion Medals` plugin, the Champion Medal time will also be sent to the server.

If you want to disable this feature, you can deactivate this under `Settings`->`WheelGPT-Plugin`->` Send Maps to Server`.
If you want to disable this feature, you can deactivate this under `Settings`->`WheelGPT-Plugin`->`Send Maps to Server`.

### Room

With the Twitch bot, viewers can use the command `!room` to get information about the current Trackmania room the streamer is playing in.
With the Twitch bot, viewers can use the command `!room` to get information about the current Trackmania room the streamer is playing in.
If the plugin is activated, whenever you join a room, the room information (such as name, host, and player count) is sent to our server. This allows viewers to always see up-to-date room details via the bot.

If you want to disable this feature, you can deactivate it under `Settings` -> `WheelGPT-Plugin` -> `Send Rooms to Server`.
Expand All @@ -81,7 +81,7 @@ If you want to disable this feature, you can deactivate it under `Settings` -> `
docker run -p 3000:<port_from_env> wheelgpt-app
```

This will start the backend server on port 3000.
This will start the backend server on port 3000.
You can adjust the port mapping as needed.

## Development
Expand Down
60 changes: 60 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
services:
postgres:
image: postgres:17
environment:
POSTGRES_DB: wheelgpt
POSTGRES_USER: wheelgpt
POSTGRES_PASSWORD: secret
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U wheelgpt" ]
interval: 10s
timeout: 5s
retries: 5

migrations:
build: ./server
command: [ "./migrations" ]
depends_on:
postgres:
condition: service_healthy
env_file:
- .env

api:
build: ./server
command: [ "./api" ]
depends_on:
migrations:
condition: service_completed_successfully
ports:
- "8080:8080"
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: wheelgpt
DB_USER: wheelgpt
DB_PASSWORD: secret

wheelgpt:
build: ./server
command: [ "./wheelgpt" ]
depends_on:
migrations:
condition: service_completed_successfully
env_file:
- .env

website:
build: ./website
ports:
- "4200:3000"
depends_on:
api:
condition: service_started

volumes:
postgres_data:
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions legacy/.github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"customManagers:biomeVersions"
],
"commitMessageAction": "Renovate: Update",
"assignees": [
"SoWieMarkus"
],
"rangeStrategy": "bump"
}
File renamed without changes.
34 changes: 34 additions & 0 deletions legacy/.github/workflows/openplanet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Release Openplanet Plugin

on:
push:
tags:
- "v*" # Triggers on tags like v1.0.0, v2.3, etc.
paths:
- "openplanet/**"

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Zip openplanet folder
run: |
cd openplanet
zip -r ../wheelgpt.zip .
cd ..

- name: Rename zip to .op
run: mv wheelgpt.zip wheelgpt.op

- name: Create Release and Upload .op
uses: softprops/action-gh-release@v2
with:
files: wheelgpt.op
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
4 changes: 4 additions & 0 deletions legacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.env
.turbo
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added legacy/prisma/dev.db
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading