Watch
1
0
Fork
You've already forked gbp
0
mirror of https://github.com/qxuken/gbp.git synced 2026-10-08 11:39:56 +03:00
Build planner for genshin https://genshinbuild.app
  • TypeScript 67.8%
  • Go 23.7%
  • JavaScript 5.7%
  • CSS 1%
  • Shell 0.6%
  • Other 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nasonov V 00977f76c4
Add CI and release workflows (#23)
* Skip the preloaded seed when it is already stored

UpdateFromPreload only compared the bundled hash against the dictionary
version and the latest dump, so a restart after the dictionary had moved
on hit the unique constraint on _dbDumps.hash and failed.

Look the hash up across every stored dump instead: a stored dump means
the seed was applied once already and whatever replaced it since was
deliberate.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Add a script fetching the seed from a deployment

The dictionary seed is not tracked in git, so builds have had to be fed a
backup/seed.db by hand. Pull it from a running instance instead: SEED_HOSTS
lists the origins to try in order, and a host only counts as good if the
payload it serves matches the sha256 it advertises.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Cross compile the image instead of emulating it

Every build stage now runs on the build platform and the go binary is
cross compiled for the target, so a multi platform build no longer runs
npm and go under qemu. Only the final COPY-only stage is per platform.

Hashing the seed needs a runnable binary, so that stage builds a host
native one; being platform independent it is built once and shared.

Add a .dockerignore so the context stops carrying node_modules, tmp and
the old seed backups.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Add CI and release workflows

CI runs on pull requests and master: gofmt, vet, build and tests for the
backend, typecheck, eslint and build for the frontend, plus a multi
platform image build so the release path is exercised before a tag.

Release runs on tag pushes only, reuses the CI workflow as its gate and
then pushes the image to Docker Hub tagged with the tag name, the commit
sha and latest. Both workflows take the seed from SEED_HOSTS.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Document the seed fetch and the CI workflows

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
2026-08-23 23:20:10 +03:00
.github Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
backup feat(seed): seed docker images 2025-07-06 20:40:26 +03:00
cmd/gbp Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
internals Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
migrations Redesign UI around element colours (#17) 2026-08-22 01:42:34 +03:00
screenshots Redesign UI around element colours (#17) 2026-08-22 01:42:34 +03:00
scripts Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
ui Keep main stat filter options from shrinking with selection (#22) 2026-08-23 21:41:40 +03:00
.air.toml Redesign UI around element colours (#17) 2026-08-22 01:42:34 +03:00
.dockerignore Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
.editorconfig chore: update packages 2026-01-03 02:01:23 +03:00
.gitignore Add v2 card 2026-08-11 21:45:14 +03:00
build.nu Redesign UI around element colours (#17) 2026-08-22 01:42:34 +03:00
CLAUDE.md Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
Dockerfile Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
go.mod Update packages (#14) 2026-08-09 01:21:18 +03:00
go.sum Update packages (#14) 2026-08-09 01:21:18 +03:00
LICENSE.md chore: add license 2025-06-01 15:13:37 +03:00
publish.nu fix(builds): hack on query cancellation error 2025-10-06 01:51:29 +03:00
README.md Add CI and release workflows (#23) 2026-08-23 23:20:10 +03:00
TODO.md chore: todo zibai and illuga 2026-01-21 17:02:26 +03:00

Genshin Build Planner

A web application for planning and managing Genshin Impact character builds, weapon builds, artifact sets, and team compositions. The application features a Go backend powered by PocketBase and a modern React/TypeScript frontend.

Light Mode Dark Mode
Light Mode Dark Mode

Self-Hosting / Deployment

Follow these steps to deploy your own instance of Genshin Build Planner. For development instructions, see the "Development Setup" section below.

Step 1: Get the Application

You have two options: use the pre-built Docker image (easiest) or build from source.

This is the simplest way to get started. All you need is Docker installed.

docker pull qxuken/gbp:latest

Option B: Building from Source

If you prefer not to use Docker, you can build the application manually.

  1. Ensure you have Go and Node.js/npm installed.
  2. Run the build command from the root of the project directory:
    cd ./ui && npm run build && cd .. && go build ./cmd/gbp
    

Step 2: Run the Application & Create Admin Account

Run the application. If using Docker, it is highly recommended to use a volume to persist your data.

# Example Docker command
docker run --name gbp -p 8080:8080 -v gbp_data:/pb_data qxuken/gbp:latest
  • -p 8080:8080 maps the container's port 8080 to your host's port 8080.
  • -v gbp_data:/pb_data creates a persistent volume named gbp_data to store your database. This ensures your data is safe even if you remove the container.

On the first launch, the application will print a URL in the console logs. Visit this URL in your browser to create your first admin account. This link is only valid for a short time.

Step 3: Configuration

Navigate to the "Settings" panel in the application to configure additional options, such as setting up an SMTP server for email features (like password resets).

If you don't want to configure SMTP, you will need to disable the authentication rule. First, go to Settings > Application, uncheck "Hide collection create and edit controls," and click Save. Then, go to Collections > Users > Edit collection > API Rules, clear the "Authentication rule," and click Save. You will then be able to log in without verification.

Step 4: (Optional) Upload Seed Data

The docker images already seeded with game data (characters, weapons, etc.).

  1. Get the dump.db file. (See the "Seed Data" section below for download links).
  2. Log in to your new instance with the admin account you just created.
  3. Navigate to the /admin/dump endpoint in your browser (e.g., http://localhost:8080/admin/dump).
  4. Upload the dump.db file.

Step 5: Done!

Your personal instance of Genshin Build Planner is now ready to use.


Seed Data

The dump.db file contains all the necessary game data (characters, artifacts, weapons) required for the application to work. You only need to upload this once during the initial setup.

You can download the latest version from one of two places:

  • From the Website: Go to genshinbuild.app and click the "Download Seed" button.
  • From GitHub: Download the dump.db file from the latest GitHub Release.

Tech Stack

  • Backend: Go with PocketBase framework
  • Frontend: TypeScript, React, Vite
  • Database: SQLite (via PocketBase)
  • Containerization: Docker
  • Scripting: Nushell

Development Setup

This section is for developers who want to contribute to the project or modify the source code.

Prerequisites

  • Go 1.x
  • Node.js & npm
  • Air for live-reloading the Go backend
    go install github.com/air-verse/air@latest
    

Running in Development Mode

  1. Backend First, ensure the frontend has been built at least once. Then, start the live-reload server.

    nu build.nu ui  # Run this the first time
    air
    
  2. Frontend Navigate to the UI directory, install dependencies, and start the Vite dev server.

    cd ui
    npm install
    npm run dev
    

Building & Publishing

The project includes Nushell scripts for building and publishing.

  • build.nu: Builds the application.
  • publish.nu: Builds and publishes multi-arch Docker images (arm64 & amd64). This is primarily for project maintainers.

The image is baked with a dictionary seed, which is not tracked in git. Fetch it from a running deployment before building:

scripts/fetch_seed.sh

It writes backup/seed.db and backup/seed.note, trying each origin in SEED_HOSTS (whitespace separated, https://gbp.qxuken.dev https://genshinbuild.app by default) until one serves a dump matching the sha256 it advertises.

# Example: Build and publish a new version
nu publish.nu

CI

  • .github/workflows/ci.yml runs on pull requests and pushes to master: gofmt, go vet, go build and go test for the backend, npm run typecheck, npm run check and npm run build for the frontend, and a multi-platform image build.
  • .github/workflows/release.yml runs on tag pushes only. It reuses the CI workflow as a gate and then pushes qxuken/gbp as a single multi-arch manifest tagged with the git tag name, the commit sha and latest.

Publishing needs two repository secrets, DOCKERHUB_USERNAME and DOCKERHUB_TOKEN. A SEED_HOSTS repository variable overrides the seed origins for both workflows.

TODO

Refer to TODO.md for a list of pending tasks and future improvements.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.