Skip to content

About

A repository for the Cal-Adapt Data Explorer website (2026/2027)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

577 Commits

Folders and files

Repository files navigation

Cal-Adapt 3.0

This is a Next.js project bootstrapped with create-next-app.

Requirements

  • Node.js
  • A Node version manager like nvm or a runtime version manager like mise

Getting started

Install and switch to the Node.js version specified in .nvmrc using your version manager of choice.

Important

Since v16.13, installations of Node.js are distributed with Corepack by default for managing package managers. However, due to its experimental status, Corepack currently needs to be explicitly enabled before usage:

corepack enable

For alternative methods to install pnpm, see here.

Copy .env.example to .env.local and add your Mapbox token (NEXT_PUBLIC_MAPBOX_TOKEN). You can get one from mapbox.com or ask a team member for the shared token.

cp .env.example .env.local

Install the dependencies:

pnpm install

Start the development server:

pnpm dev

Generate an optimized production build and start the compiled application in production mode:

pnpm build
pnpm start

Testing

This project uses the Vitest test runner with React Testing Library for unit testing and Storybook for UI development and documentation.

In Storybook, each story is a small code snippet that configures a component into a key UI state. When configured with Storybook's Vitest addon, stories are transformed into component tests to be run by Vitest. Stories are tested in two ways: a smoke test to ensure it renders and, if a play function is defined, that function is run and any assertions made within it are validated. See the Storybook documentation for more information.

Run Vitest in watch mode:

pnpm test

Run Vitest once:

pnpm test:run

Run Vitest with coverage report:

pnpm test:coverage

Start the Storybook development server (default: http://localhost:6006):

pnpm storybook

Compiles the Storybook instance so it can be deployed:

pnpm storybook:build

Architecture

Tool management

The tools are stored in their specific folders under components/

Tool Carousel

Located in components/home/ToolCarousel.tsx

Whenever a new metric within a tool or a tool is added, this component needs to be updated accordingly. Check for the data from where the instance of the tool is retrieving its data, and add the values accordingly.

Context management

All context code is stored under context/

Global components

HTML Tooltip

Can be used for more complex tooltips beyond MUI's default. Links, images and any HTML content can be added

LoadingSpinner

This component was written to create an optimized version of thea loading spinner

About

A repository for the Cal-Adapt Data Explorer website (2026/2027)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages