Help us shape the future of Go! Take the 2026 Go Developer Survey

pediaroute-go

module
v0.0.0-...-d1796cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: GPL-3.0

README

pediaroute

Source of https://pediaroute.com/ .

How to build

You need

  • Golang 1.27
  • Make
  • Node.js 24+
  • pnpm
$ cd web && pnpm install && pnpm build:dev
$ make

How to generate application data

Before generating application data, you need to download wikipedia sql files.

Japanese

  1. jawiki-YYYYMMDD-page.sql.gz
  2. jawiki-YYYYMMDD-pagelinks.sql.gz
  3. jawiki-YYYYMMDD-linktarget.sql.gz

English

  1. enwiki-YYYYMMDD-page.sql.gz
  2. enwiki-YYYYMMDD-pagelinks.sql.gz
  3. enwiki-YYYYMMDD-linktarget.sql.gz
$ ./build/gen \
-ip /path/to/jawiki-YYYYMMDD-page.sql.gz \
-il /path/to/jawiki-YYYYMMDD-pagelinks.sql.gz \
-ilt /path/to/jawiki-YYYYMMDD-linktarget.sql.gz \
-o .

You will find 4 files in current directory:

  • config.json
  • title.dat
  • page.dat
  • link.dat

For English:

$ mkdir -p en
$ ./build/gen \
-lang en \
-ip /path/to/enwiki-YYYYMMDD-page.sql.gz \
-il /path/to/enwiki-YYYYMMDD-pagelinks.sql.gz \
-ilt /path/to/enwiki-YYYYMMDD-linktarget.sql.gz \
-o en/

For Japanese:

$ mkdir -p ja
$ ./build/gen \
-lang ja \
-ip /path/to/jawiki-YYYYMMDD-page.sql.gz \
-il /path/to/jawiki-YYYYMMDD-pagelinks.sql.gz \
-ilt /path/to/jawiki-YYYYMMDD-linktarget.sql.gz \
-o ja/

How to run with Docker

Build the app image:

$ make image

Run with the generated en/ and ja/ directories mounted:

$ docker run \
-v $(pwd)/ja:/data/ja \
-v $(pwd)/en:/data/en \
-e JA=/data/ja/config.json \
-e EN=/data/en/config.json \
-p 8080:8080 \
mtgto/pediaroute:latest

The app will be available at http://localhost:8080 .

Development

Upgrading the Go version

When bumping the Go version required by this project, update all of the following:

  • go.mod: the go directive
  • .github/workflows/test.yml: go-version for actions/setup-go
  • build/package/app/Dockerfile: the golang:X.Y-trixie base image
  • build/package/data/Dockerfile: the golang:X.Y-trixie base images (there are multiple stages)
  • README.md: the "Golang" version listed under "How to build"

License

GPL v3

Directories

Path Synopsis
cmd
bench command
gen command
web command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL