Skip to content

Commit b861165

Browse files
Merge pull request #220 from strudel-science/feature/storybook
Reorganize repo and add component library with storybook
2 parents 6c91b5a + 1f16859 commit b861165

767 files changed

Lines changed: 151301 additions & 2003 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ on:
66
types: [opened, reopened]
77

88
jobs:
9-
lint:
9+
frontend-lint:
1010
runs-on: ubuntu-22.04
11+
defaults:
12+
run:
13+
working-directory: templates/base-app/frontend
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v4
@@ -23,6 +26,9 @@ jobs:
2326
run: npm run prettier:fix
2427
cypress-tests:
2528
runs-on: ubuntu-22.04
29+
defaults:
30+
run:
31+
working-directory: templates/base-app/frontend
2632
steps:
2733
- name: Checkout
2834
uses: actions/checkout@v4
@@ -31,5 +37,6 @@ jobs:
3137
- name: Cypress run
3238
uses: cypress-io/github-action@v6
3339
with:
40+
working-directory: templates/base-app/frontend
3441
browser: chrome
3542
start: npm start

.github/workflows/publish

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: packages/react-components
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
registry-url: 'https://registry.npmjs.org'
19+
20+
- run: npm ci
21+
- run: npm run build
22+
- run: npm publish
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
node_modules/
4+
node_modules
55
/.pnp
66
.pnp.js
77

@@ -56,4 +56,8 @@ _*.config.ts
5656
**/cypress/screenshots/
5757

5858
# Cache
59-
.eslintcache
59+
.eslintcache
60+
61+
.venv
62+
63+
*.db

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

.lintstagedrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
License Agreement
22
=================
33

4-
Scientific sofTware Research for User experience, Design, Engagement, and Learning (STRUDEL) Copyright (c) 2024, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
4+
Scientific sofTware Research for User experience, Design, Engagement, and Learning (STRUDEL) Copyright (c) 2026, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without
77
modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,63 @@
11
# STRUDEL Kit
22

3-
STRUDEL Kit is a React and TypeScript-based starter kit for building scientific UIs based on the STRUDEL Design System and Task Flows. Visit [strudel.science](https://strudel.science) for more information about the STRUDEL project.
4-
5-
This library provides a suite of templates to implement UIs for various different task flows common to the scientific domain. The app is intended to be used as a starting point for building out a modern single-page web app for scientific-type UIs.
3+
STRUDEL Kit is a set of modern fullstack templates and components for building scientific apps based on the STRUDEL Design System and Task Flows. Visit [strudel.science](https://strudel.science) for more information about the STRUDEL project.
64

75
[Browse the full docs](https://strudel.science/strudel-kit/docs/)
86

9-
## What's included?
10-
- [**React**](https://react.dev/): A component-based JavaScript library for building UIs.
7+
## Technology Stack
8+
**Backend**
9+
- [**Python**](https://www.python.org/) Programming language popular for scientific and data analysis
10+
- [**FastApi**](https://fastapi.tiangolo.com/) Backend framework for building REST APIs
11+
- [**SQLAlchemy**](https://www.sqlalchemy.org/) SQL toolkit and ORM
12+
- [**Alembic**](https://alembic.sqlalchemy.org/en/latest/) Database migration tool
13+
- [**uv**](https://docs.astral.sh/uv/) Python package and project manager
14+
15+
**Frontend**
1116
- [**TypeScript**](https://www.typescriptlang.org/): A typed superset of JavaScript that compiles to plain JavaScript.
17+
- [**React**](https://react.dev/): A component-based JavaScript library for building UIs.
1218
- [**Vite**](https://vite.dev/): A fast, opinionated frontend build tool.
1319
- [**Material UI**](https://mui.com/material-ui/getting-started/): Open-source React component library based on Google's Material Design.
1420
- [**TanStack Router**](https://tanstack.com/router/latest): A fully type-safe router with built-in data fetching, first-class search-param APIs, and more.
1521
- [**ESLint**](https://eslint.org/): The pluggable linting utility for JavaScript and JSX.
1622
- [**Prettier**](https://prettier.io/): An opinionated code formatter.
17-
- [**Husky**](https://typicode.github.io/husky/): Runs a pre-commit hook to lint and style staged code.
1823
- [**Cypress**](https://www.cypress.io/): End-to-end tests for built-in templates.
19-
- [**Task Flow Templates**](https://strudel.science/design-system/task-flows/overview/): Six template flows based on common patterns.
20-
21-
![Home page](images/home.png)
2224

2325
![Run Computation results page](images/run-computation-results.png)
2426

25-
## Getting Started
27+
## Getting started with a template
2628

27-
### Option 1: Use this template
29+
This library provides a suite of templates to implement UIs for various different task flows common to the scientific domain. Each template lives in the `templates` directory and is built on top of the main `base-app` template.
2830

29-
Click the green "Use this template" button on the [strudel-kit GitHub page](https://github.com/strudel-science/strudel-kit). Create your own repository from the strudel-kit code and give it a name.
31+
### Requirements
32+
- [Node](https://nodejs.org/en/download)
33+
- [degit](https://github.com/Rich-Harris/degit)
34+
- [Docker](https://www.docker.com/get-started/)
3035

31-
Clone the strudel-kit repository from your new repo.
36+
### Copy a template
3237

33-
### Option 2: degit
38+
Open a terminal and navigate to the directory where you want your app to live.
39+
40+
Copy your template of choice (e.g. `explore-data`):
3441

35-
Generate a new project from strudel-kit using [degit](https://github.com/Rich-Harris/degit):
3642
```
37-
npx degit strudel-science/strudel-kit my-app
43+
degit strudel-science/strudel-kit/templates/explore-data my-app
3844
```
3945

40-
### Option 3: Fork this repo
41-
42-
Especially if you want to contribute back, you can click the Fork button to create a fork of this repo from the [strudel-kit GitHub page](https://github.com/strudel-science/strudel-kit).
43-
44-
Clone the strudel-kit repository from your new fork.
45-
46-
### Install and Start
47-
48-
Install the dependencies:
46+
You can also copy sections of a fullstack template if you don't need the whole backend and frontend:
4947

5048
```
51-
npm install
49+
degit strudel-science/strudel-kit/templates/explore-data/frontend my-frontend-app
5250
```
5351

54-
Start up the app:
52+
You may even want to combine or add a specific task flow to an existing frontend:
5553

5654
```
57-
npm start
55+
degit strudel-science/strudel-kit/templates/explore-data/frontend/src/pages/compare-data my-compare-data-page
5856
```
5957

60-
Open [http://localhost:5175](http://localhost:5175) to view the app in the browser.
58+
## Getting started with the React components
6159

62-
Begin modifying the templates in `src/pages`.
60+
[./packages/react-components/README.md](./packages/react-components/README.md)
6361

6462
## Contributions
6563

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
*storybook.log
27+
storybook-static
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
'stories': [
5+
'../src/**/*.mdx',
6+
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'
7+
],
8+
'addons': [
9+
'@chromatic-com/storybook',
10+
'@storybook/addon-vitest',
11+
'@storybook/addon-a11y',
12+
'@storybook/addon-docs'
13+
],
14+
'framework': '@storybook/react-vite',
15+
'staticDirs': ['../public'],
16+
};
17+
export default config;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from 'storybook/manager-api';
2+
import customTheme from './theme';
3+
4+
addons.setConfig({
5+
theme: customTheme,
6+
});

0 commit comments

Comments
 (0)