R-universe express front-end stack. This runs the website and cranlike repositories from https://r-universe.dev
We need NodeJS and MongoDB. On homebrew you would do:
brew install node mongodb/brew/mongodb-communityOn Ubuntu, nodejs can be installed from apt but you need instructions from the mongodb website to install mongodb-org.
apt-get update
apt-get install nodejs mongodb-orgClone this repo and run npm install . once to download dependencies.
# Only need to do this once
git clone https://github.com/r-universe-org/frontend
cd frontend
npm install .To run a local test server that mimics a given universe e.g. ropensci you can use:
./run-local.sh ropensciNow you can open http://localhost:3000/ in your browser which should look a lot like https://ropensci.r-universe.dev.
The first time you run this script, it will automatically download some dummy data into the local directory dummydata-{universe} so we have something to test with. This data will persist if you restart the script, so the second time you run this script this will be skipped. If you want to refresh your dummy data, just delete the dummydata-{universe} folder and restart the ./run-local.sh script.
The global (meta) r-universe pages are under /_global/ for example:
http://localhost:3000/_global/search-> https://r-universe.dev/searchhttp://localhost:3000/_global/organizations-> https://r-universe.dev/organizations
This is not perfect because some of the links assume the root domain, but good enough to hack on the pages.
This project uses ESLint for code quality and consistency. To run the linter:
# Check for linting issues
npm run lint
# Automatically fix issues where possible
npm run lint:fixThe linter is configured in eslint.config.js with separate rules for:
- Node.js server files (routes, app.js, src/)
- Browser-side files (static/, views/)
Currently served URLs:
/builds
/packages
/contributors
/apis
/articles
/articles/:pkg/:filename
/:pkg