Files
www.neuroinf.jp/README.md
T
orrisroot 3f63587756 feat: migrate from Create React App to Vite
Rebuild the site on the stack the other converted sites share: Vite 8,
React 19, TypeScript 7, react-router 8, Biome and sanitize.css, with the
site data served from static-contents/ instead of the bundle.

- base the XooNIps pages on the other converted sites, keeping the
  XooNIps 4 item types and the original module addresses
- port the pico, bulletin and credits modules to react-router 8 and ky
- read the RSS feeds with DOMParser instead of rss-parser
- load the index tree from modules/xoonips/ at start up
- fix the download.php redirect target
- restore the theme's list, table and image layout over sanitize.css
  and keep form controls on white
- track page views with GA4
2026-09-14 18:17:05 +09:00

4.2 KiB

INCF Japan Node

Static front-end for the archived INCF Japan Node portal, built with Vite, React and TypeScript.

Requirements

  • Node.js 20.19+ / 22.12+ (Vite 8)
  • npm

Setup

npm install

Site data

The pages are rendered from JSON dumped out of the original XOOPS installation by xoops-static-exporter (sites/www.neuroinf.jp/). All of it lives in static-contents/, which sits next to the repository rather than inside it:

www.neuroinf.jp/
├── www.neuroinf.jp/        this repository
└── static-contents/
    ├── modules/            one directory per source XOOPS module
    │   ├── aboutus/ ...    pico: index.json, <content id>.json (ten modules)
    │   ├── credits/        index.json, <page id>.json
    │   ├── fmanager/       xelFinder files: index.php/view/<id>/, cache/
    │   ├── news/           bulletin: index.json
    │   └── xoonips/        tree.json, items.json, file/<id>/
    ├── flags/              static files, served as they are
    ├── report/
    ├── schema/
    └── workshop/

The RewriteBase in every modules/xoonips/file/<id>/.htaccess and modules/fmanager/index.php/*/<id>/.htaccess carries the absolute path of that directory and has to move with the layout.

The dev and preview servers mount that directory at the site root. It is kept out of dist/, and it is not tracked in git.

The XooNIps pages use the XooNIps 4 item types of this site (journal, article and general data) and keep the addresses of the original module (/modules/xoonips/detail.php?item_id=N, list.php?index_id=N, search.php?op=...). The pico pages are served under their module directory (/aboutus/incf.html), and the AINI, NBNI and hackathon pages also under their event paths (/aini2018/, /hackathon2018/...).

The top page and the platform page show the news of INCF and the other platforms, read from their RSS feeds in the browser through https://archive.ni.brain.riken.jp/cors/.

Scripts

Command Description
npm run dev Start the dev server on http://localhost:5173
npm run build Type-check and build into dist/
npm run preview Serve the production build on http://localhost:4173
npm run lint Lint with Biome
npm run format Format with Biome
npm run check Lint, format and organize imports, applying the safe fixes

@types/node is pinned to the major that matches the Node runtime in use (24); .ncurc.js keeps npm-check-updates from bumping it past that.

There is currently no test suite.

Styles

The base stylesheet is sanitize.css with its forms and typography sheets, with its box-sizing: border-box kept. The site theme is src/custom/assets/style.css. Where a sanitize.css default does not suit the design, the rule for that place sets its own value rather than overriding the element everywhere.

Deployment

Build locally and copy the result up; the server does not need a toolchain.

npm ci
npm run check
npm run build
../deploy.sh

deploy.sh, next to static-contents/, sends the data to archive:/data/www/www.neuroinf.jp/static-contents/, then dist/ to .../html/, and finally links every top-level entry of static-contents/ into the document root over ssh (ln -sfn ../static-contents/* .). The data has to go first: the document root's rsync --delete removes those links, and they are only put back at the end.

Apache needs Options FollowSymLinks and AllowOverride All on both directories. Use symlinks rather than Alias: an Alias maps the URL outside the document root, so .htaccess no longer applies and the SPA fallback and the redirects stop working.

Redirects

.htaccess redirects /modules/xoonips/download.php?file_id=N to /modules/xoonips/file/N with a 301.

XOOPS-style addresses (/modules/<pico module>/..., /modules/news/..., /index.php) are redirected inside the app.

Google Analytics

GOOGLE_ANALYTICS_TRACKING_ID in src/config.ts carries the GA4 measurement ID. Emptying it disables tracking. Only production builds send page views.