Skip to content

About

ELIXIR Cloud & AAI landing page

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

19 watching

Forks

Latest commit

 

History

139 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ELIXIR On-Cloud

ELIXIR On-Cloud website

License Website Coverage Build_status Deploy

The source of the website of ELIXIR On-Cloud: standards-based products and architecture patterns for federated analytics in biomedical research, healthcare and beyond. ELIXIR On-Cloud is a Driver Project of the Global Alliance for Genomics and Health (GA4GH), governed by the ELIXIR Compute Platform; the website presents its products, services, nodes, projects, contributors and funders.

The website is built with Next.js and React. Every page is rendered statically at build time; there is no backend and no build-time secret.

Content

Content lives in JSON files under src/data/:

File Page
product.json Products
services.json Demo: core services (those in CORE_SERVICE_IDS of src/app/demo/page.tsx)
aaai.json Demo: AAAI providers, in the fields of a Node (logos in public/aaai/)
nodes.json Demo: Nodes (flags in public/flags/, logos in public/nodes/)
project.json Projects (parked: online, not in the menu or the sitemap)
contributor.json Contributors
funding.json Funding

In contributor.json, roles holds a contributor's affiliation and their roles. The affiliation is an ELIXIR Node (e.g. ELIXIR Finland, also ELIXIR Hub and EMBL-EBI), OSS Contributor or External Contributor; it is shown under the name, a Node with its flag, and sets the ELIXIR, OSS and External filters. A new Node needs its flag in public/flags/ and an entry in NODE_FLAGS in src/lib/contributors.ts, which also lists the leads (Lead filter and badge). Node names must match it exactly. All other entries, e.g. GSoC '21 Contributor, are listed as roles; those with GSoC set the GSoC filter and badge. Contributors are listed by name.

To change content, edit the relevant file and open a pull request.

In funding.json, category is the funding programme, ELIXIR or Google Summer of Code: it titles the grant's card, sets its logo and is its filter. funder is the detailed grant type, e.g. ELIXIR Strategic Implementation Study, shown under the title unless it equals the programme; it starts with the programme's name. Dates are YYYY-MM-DD; grants are listed by end date (newest first), then start date (oldest first), then name. formattedDuration is the period as shown on the card; keep it in step with the dates. A new programme needs its logo in public/ and an entry in PROGRAMMES in src/lib/funding.ts.

The listings (Products, Funding, Contributors) share one filter behaviour (src/lib/filters.ts): several filters can be selected, and an item is listed if it matches any of them. The selection is kept in the URL, so a link can open a listing with filters set, e.g. /products?filter=ga4gh-tes,ga4gh-wes. A filter's id is its label in lower case, with dashes for spaces and other characters.

In product.json, partner marks the products of others (they list no owner: their maintainers aren't ours to name), and cloudNative the ones that run natively on Kubernetes. Besides the GA4GH standards, the Products page filters by both, and by "ELIXIR On-Cloud products" (all that aren't partner products). Each stat in its header opens the listing with its filters set.

Every page sets its own title and description for search engines and link previews: in the metadata export of its page.tsx, or of the route's layout.tsx for pages that are client components ('use client'). Titles appear as <title> | ELIXIR On-Cloud (the template in src/seo/base-seo.ts), except on the home page, which sets its full title. src/app/metadata.test.ts checks that every route has a title and description of its own; add new routes to its list.

Development

With Node.js 22 and npm installed, install the dependencies and start the development server:

npm install
cp .env.example .env.local   # optional; all values have defaults
npm run dev

Useful commands:

  • npm run build: production build (also generates the sitemap)
  • npx tsc --noEmit: type-check
  • npm run lint: lint the JavaScript and TypeScript sources with ESLint (Next.js's recommended config with typescript-eslint, see eslint.config.js); fails on warnings too. npm run lint-fix fixes what can be fixed automatically. Images use Image from next/image, which sizes and optimizes them; the lint rejects plain <img> tags. Images from other hosts need an entry in images.remotePatterns in next.config.js
  • npm test: run the tests (Vitest with Testing Library); npm run test:watch reruns them on changes
  • npm run test:coverage: run the tests and write coverage to coverage/lcov.info (for Codecov)
  • npm run check-links: check the outbound links in src/ (test files, *.test.json/*.spec.json fixtures and src/test/ excluded; sites that block automated requests, such as LinkedIn, are listed as "skip" for a manual check). A link is dead on 404/410, a TLS error, a DNS error that persists after one retry, a malformed URL, or an address outside the public internet (loopback, private, link-local, cloud metadata, IPv6 translation and 6to4, and other reserved ranges). The check follows redirects itself and checks every target the same way before requesting it. This is a pre-check: the request resolves the name again, so a host whose DNS answer changes in between isn't caught. Results need public DNS: resolvers that answer with private or synthetic addresses (some proxies, split-horizon DNS) make links look dead. Server errors (5xx) and other network errors are retried once after a short delay and, if they persist, reported as unverified, like other 4xx responses, redirects to other schemes and chains of more than 10 redirects. The command exits with 2 on dead links, with 0 otherwise. The Link check workflow runs it every Monday (one run at a time), shows the summary (with unverified links) in the run's job summary, or a failure note if the check broke, and opens or updates an issue for dead links.

Tests live next to the code they test (*.test.ts(x)). The data tests in src/data/data.test.ts check the JSON files: unique ids, references between services, products and Nodes, and that every referenced image exists.

Checks

CI runs these jobs on every pull request and push:

  • PR title: the title follows Conventional Commits and has at most 50 characters (see Contributing).
  • Lint: lints all JavaScript and TypeScript sources with ESLint (npm run lint); errors and warnings fail it.
  • Test: runs the tests with coverage and reports it to Codecov. codecov.yml states the target of this repo (70%, working up from about 38%); the status only reports for now, it doesn't fail. The upload uses the organization's secret CODECOV_TOKEN. Its errors fail the job only on pushes to this repository, as forks and Dependabot get no access to the token.
  • Build: checks the formatting and types of src/, then builds the site.
  • Audit: fails on high and critical advisories in the production dependencies. To run it locally: npm audit --omit=dev --audit-level=high. Development tools are not audited, as they don't reach the site; this includes tools that only run during the build, such as next-sitemap, so they belong in devDependencies (a test checks this). The job checks npm's advisory database as it is when the job runs, so a newly published advisory fails every new run, without a change to the code, and also holds back deployments of commits without a green run. Fix it by updating the package (npm update <package> within its version range, otherwise npm install <package>@<fixed version>, or the dependency that pulls it in). There is no list of accepted advisories: if no fix exists yet, a maintainer decides, in a pull request, whether to change the job for the time being.
  • Build image: builds the production image from the Dockerfile.
  • Scan build: scans that image with Trivy, uploads the findings that have a fix to code scanning, and fails on critical and high ones that have a fix. Accepted findings go into .trivyignore.yaml, with a reason and an expiry date.
  • CI passed: the only check that the rules for dev require. It passes if all other jobs passed; only PR title may be skipped.

Deployment

Pull requests go to dev, the default branch. main only moves forward to versions that should go live: maintainers fast-forward it to a commit of dev that passed CI, which deploys that commit:

git fetch origin
git push origin <commit of dev that passed CI>:main

Once CI has passed for a push to main, the Deploy workflow publishes the image to the GitHub Container Registry (ghcr.io, tagged latest and with the commit SHA). A commit whose CI failed is not deployed.

  • Skipped commits: if a newer commit of main exists when CI for an older one completes, the older one is skipped, so that latest never moves back; the newer one is deployed once its CI passed. If that CI fails, fix forward, or deploy the older commit by hand (below).
  • Manual deploys (Actions, "Deploy", "Run workflow", on main): leave sha empty to deploy the latest commit of main, or give the full SHA of a commit of main, e.g., to roll back. They too require a successful CI run for a push of that commit to main and otherwise fail, saying so (re-run the workflow once CI has passed).

On the host, docker-compose.yaml runs the site together with Watchtower, which pulls new images every 5 minutes and restarts the site:

git clone https://github.com/elixir-cloud-aai/landing-page.git
cd landing-page
docker compose up -d

The site listens on port 80 (change it in docker-compose.yaml). TLS is expected to be terminated by a reverse proxy in front of it.

Vercel builds preview deployments for pull requests and dev, which has a stable preview URL: vercel.json turns off deployments of main, as the production site is served from the host above.

The site used to be a PWA. public/sw.js is written by hand and only removes the old service worker from the browsers of past visitors. Keep it until at least November 2027.

To roll back, pin the site image to a previous sha-<commit> tag and run docker compose up -d. To build locally instead of pulling, run docker compose up -d --build.

Caching

The site sets its own Cache-Control headers, in the headers of next.config.js, so they are the same in the Docker image and on Vercel:

Paths Cache-Control
/_next/static/ (JavaScript, CSS, fonts; hashed names) public, max-age=31536000, immutable (set by Next.js)
/_next/image (optimized images) source's max-age, at least 4 hours (Next.js default)
Pages public, max-age=0, must-revalidate
Other files of public/ (images, logos, flags, favicon) public, max-age=86400, stale-while-revalidate=604800
robots.txt, sitemap.xml, sitemap-<n>.xml public, max-age=3600
sw.js (removes the old PWA's worker, see above) no-cache, no-store, must-revalidate

Caches revalidate pages on every request (a cheap 304 Not Modified if a page hasn't changed), so a deploy shows at once, and no cache serves a page that points at /_next/static/ files of an older image. Files of public/ have no hash in their names, so a changed image can take up to a day to show, and a cache may serve the old one once more on a visit within the following week (stale-while-revalidate); to replace one at once, give it a new file name. 404s for unknown paths are not cached. A reverse proxy in front of the site should pass these headers on and needs no cache rules of its own. src/test/cache-policy.test.ts checks which rule applies to which path, and that every file in public/ gets the policy meant for it.

Contributing

Contributions are welcome! Report problems with the website or suggest changes in the issue tracker, or open a pull request against dev. For anything else, write to [email protected].

Pull request titles become the commit messages on dev: they follow Conventional Commits and have at most 50 characters (see the contributing guide of ELIXIR On-Cloud). CI checks the title (job PR title) and rechecks it when you edit it.

About

ELIXIR Cloud & AAI landing page

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

19 watching

Forks

Used by

Contributors

Languages