ZOYKU火線榜

wuhan005/nekobox技術文件

基于 Go + Vue 开发的轻量匿名提问箱,极简界面,开箱即用 / Lightweight anonymous question box built with Go & Vue, minimal UI, ready to use out of the box.

多語言回退提示:當前倉庫原作者暫未發布在地化文件,已為您無縫切換至官方英文原版(English),排版及程式碼實例完整保真。
極速安裝
go get github.com/wuhan005/nekobox

NekoBox

匿名提问箱 / Anonymous Question Box

Go Docker codecov Go Reference DeepSource

简体中文 | English

Architecture

NekoBox architecture showing the frontend on Cloudflare Pages and the Kubernetes API behind Cloudflare CDN

Deployment

Deploy with an Agent

Copy this prompt into an Agent with terminal access to your deployment host.

Read the deployment guide at https://github.com/wuhan005/NekoBox/blob/master/README.md
and deploy NekoBox on the target server. Build and start the Go API, then build and serve the Vue frontend separately.
Ask me for any missing deployment settings.
Verify that the frontend loads and GET /api/captcha/config returns HTTP 200 with JSON,
then report the site URL.

Build from Source

Component Build directory Toolchain Output
Go API Repository root Go 1.27+ NekoBox
Vue frontend web/ Node.js 22.12+ and pnpm 9 web/dist/

Backend

git clone https://github.com/wuhan005/NekoBox.git
cd NekoBox
go build -o NekoBox ./cmd
cp conf/app.sample.ini conf/app.ini

For Linux AMD64, prefix the build command with GOOS=linux GOARCH=amd64.

Edit conf/app.ini before starting the API. See the configuration template for other settings.

  • [app] external_url is the public frontend URL.
  • Set [server] port to 8080 for the Docker example below.
  • Set type (postgres or mysql), host, port, user, password, and name under [database]. Set addr under [redis].
./NekoBox web

Frontend

Create web/.env.production.local with your site's URL and API path.

VITE_EXTERNAL_URL=https://box.example.com
VITE_BASE_URL=/api

For reCAPTCHA, set VITE_RECAPTCHA_SITE_KEY and the matching backend secret in [recaptcha] server_key.

cd web
pnpm install --frozen-lockfile
pnpm build

Frontend Hosting

Serve web/dist/ with an index.html fallback for frontend routes.

  • Same origin. Use VITE_BASE_URL=/api and proxy /api/ and /service/ to the backend with their paths intact.
  • Separate origins. Set VITE_BASE_URL to the full API URL (e.g. https://api.example.com/api) and add the frontend host (e.g. box.example.com) to [app] cors_allow_domains.

Docker Deployment

Images are published for each Git tag.

  • API — ghcr.io/wuhan005/nekobox:<tag>
  • Frontend — ghcr.io/wuhan005/nekobox-web:<tag> (built with web/.env.production)

Self-Hosting

Build the backend image from the root of a fresh checkout.

docker build -t nekobox-api .

Prepare conf/app.ini and web/.env.production.local as above. Use database and Redis addresses reachable from the backend container. Then run from the repository root.

docker build -t nekobox-web ./web

docker run -d --name nekobox-api -p 127.0.0.1:8080:8080 \
  -v "$PWD/conf/app.ini:/home/app/conf/app.ini:ro" nekobox-api
docker run -d --name nekobox-web -p 127.0.0.1:8081:80 nekobox-web

For same-origin hosting, route /api/ and /service/ to 127.0.0.1:8080 and frontend traffic to 127.0.0.1:8081.

License

MIT License

文件鏡像歸檔自 GitHub 官方源路徑 · 造訪原專案 GitHub
最後同步快照:2026-11-09