Files
bsi-ni.brain.riken.jp/README.md
T
Yoshihiro OKUMURA 4ee6597410 docs: drop the public/ symlink setup step
The dev and preview servers mount static-contents/ themselves since
the switch to sirv, so the symlinks the setup section asked for no
longer exist.
2026-09-11 18:28:55 +09:00

2.7 KiB

BSI-Neuroinformatics

RIKEN BSI Research Database Portal — a Vite + React + TypeScript single page application.

Requirements

  • Node.js 22.22.2+ / 24.15+ / 26+ (developed on Node 24)
  • npm

Setup

npm install

The converted XOOPS data (modules/, uploads/) is not tracked in git and is not part of the build. It lives in static-contents/, which sits next to the repository rather than inside it:

bsi-ni.brain.riken.jp/
├── bsi-ni.brain.riken.jp/   this repository
└── static-contents/         modules/ and uploads/

The dev and preview servers mount that directory at the site root, so nothing needs to be linked into public/. It is deliberately kept out of dist/: it runs to gigabytes, and the web server maps it in directly.

That data is produced by xoops-static-exporter (sites/bsi-ni.brain.riken.jp/).

Scripts

npm run dev

Starts the Vite dev server on http://localhost:5173 with hot module replacement.

npm run build

Type-checks the project (tsc -b) and builds the production bundle into dist/.

npm run preview

Serves the contents of dist/ locally to verify a production build.

npm run typecheck

Runs the TypeScript project references build without emitting output.

npm run lint / npm run format / npm run check

Runs Biome (biome.json): lint reports problems, format rewrites formatting, and check applies both plus import sorting.

Deployment

npm run build writes a static bundle to dist/ (a few MB). The archive data is deliberately left out of it: build.copyPublicDir is off and only the real files in public/ are emitted, so the symlinked modules/ and uploads/ are skipped.

On the server, place dist/ at the document root and symlink the archive data into it:

ln -s /path/to/archive/modules /var/www/bsi-ni/modules
ln -s /path/to/archive/uploads /var/www/bsi-ni/uploads

Apache needs Options FollowSymLinks and Require all granted on the archive directory.

Use symlinks rather than Alias. An Alias /modules ... maps the URL outside the document root, so public/.htaccess no longer applies to it and every legacy /modules/<module>/*.php URL stops reaching the SPA redirect handler. With symlinks the existing precedence still holds: real files are served directly, everything else falls through to index.html.

Because the app uses HTML5 history routing, the web server must fall back to index.html for unknown paths — see public/.htaccess.

Learn More