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
- jawiki-YYYYMMDD-page.sql.gz
- jawiki-YYYYMMDD-pagelinks.sql.gz
- jawiki-YYYYMMDD-linktarget.sql.gz
English
- enwiki-YYYYMMDD-page.sql.gz
- enwiki-YYYYMMDD-pagelinks.sql.gz
- 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