bioenergy.org
A site dedicated to creating FAIR datasets to share across bioenergy research centers and to the global research community.
https://github.com/bioenergy-research-centers/bioenergy.org
Category: Renewable Energy
Sub Category: Bioenergy
Keywords from Contributors
ontology
Last synced: about 18 hours ago
JSON representation
Repository metadata
- Host: GitHub
- URL: https://github.com/bioenergy-research-centers/bioenergy.org
- Owner: bioenergy-research-centers
- License: other
- Created: 2023-08-16T15:15:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-07-23T15:23:50.000Z (6 days ago)
- Last Synced: 2026-07-25T08:04:34.674Z (4 days ago)
- Language: JavaScript
- Homepage: https://bioenergy.org/
- Size: 7.97 MB
- Stars: 9
- Watchers: 6
- Forks: 2
- Open Issues: 15
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
README.md
bioenergy.org
A site dedicated to creating FAIR data products to share across bioenergy research centers (BRCs) and to the global research community.
Resources
Points of contact at each BRC
- JBEI = Hector Plahar (haplahar@lbl.gov)
- GLBRC = Dirk Norman (dirk.norman@wisc.edu)
- CABBI = Katie Bowman (krhodges@illinois.edu)
- CBI = Stanton Martin (martins@ornl.gov)
Tech contacts
- Hector Plahar
- Nick Thrower
- Clint Cecil
Development
Prerequisites:
- Docker
- Docker Compose
- Node.js (version in .nvmrc), recommend using a version manager like nvm or asdf
- Postman is useful for testing the api.
The application is a monorepo with two main components. The client is a Vue.js application and the API is an Express application.
Running a postgres container
The following command will run a postgres container with the password mysecretpassword and expose the database on port 6432.
docker run --name postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 6432:5432 postgres
Running the application
- Copy the
.env.samplefile to.envand fill in the environment variables. These can also be set as environment variables on your system. - Docker Compose:
- To run the application in production mode, run
docker-compose upin the root directory of the project. This will start the nginx server for the client, the express server for the API, and the Postgres database. - To run the application in development mode, run
docker compose -f docker-compose.dev.yml up --build --watch. This will start the client and API in development mode with hot reloading. - You can run
docker-compose downto stop the application and destroy the containers and volumes. - Running
docker-compose up --buildwill rebuild the containers and restart the application.
- To run the application in production mode, run
Testing
Tests use Vitest and run inside Docker containers. No database connection is required.
# Run API tests
docker compose -f docker-compose.dev.yml run --rm --no-deps api npx vitest run
# Run client tests
docker compose -f docker-compose.dev.yml run --rm --no-deps client npx vitest run
# Run a single test file
docker compose -f docker-compose.dev.yml run --rm --no-deps api npx vitest run tests/services/githubService.test.js
docker compose -f docker-compose.dev.yml run --rm --no-deps client npx vitest run src/__tests__/components/AuthorList.test.js
# Watch mode
docker compose -f docker-compose.dev.yml run --rm --no-deps api npx vitest
docker compose -f docker-compose.dev.yml run --rm --no-deps client npx vitest
Some stderr output (e.g. "Error during search", "Turnstile error") is expected — these are console.error calls from the application code exercised by error-path tests.
API tests
API tests use Supertest for route-level integration tests. Tests are organized under api/tests/ mirroring the source structure:
api/tests/
├── helpers/ # Shared test utilities (Express app factory)
├── models/ # Dataset model tests
├── routes/ # Route integration tests (dataset, message, schema)
├── services/ # Service unit tests (github, ICE, strategy manager)
├── utils/ # Utility unit tests (categories, markdown, turnstile)
└── setup.js # Test environment variables
Writing API tests:
-
All tests are CommonJS (matching the API codebase).
-
Vitest globals (
describe,it,expect,vi,beforeEach) are available without imports. -
vi.mock()does not reliably intercept CJSrequire()calls. To mock a dependency, mutate the shared module object instead:const myService = require("../../app/services/myService"); myService.someMethod = vi.fn();This works because
require()returns the same cached object to all consumers. For this reason, source modules should avoid destructuring at import time (usemod.fn()instead ofconst { fn } = require(mod)). -
Route tests use Supertest with a lightweight Express app from
tests/helpers/createApp.js(no Sequelize sync or Swagger setup). -
Database calls are mocked by mutating
db.datasets.scopeanddb.sequelize.queryon the sharedrequire("../models")object.
Client tests
Client tests use Vue Test Utils for component testing. Tests are organized under client/src/__tests__/:
client/src/__tests__/
├── components/ # Component unit tests (AuthorList, Footer, FacetFilters, etc.)
├── composables/ # Composable tests (useTurnstile)
├── router/ # Route definition tests
├── services/ # API service tests (Dataset, Message, Schema)
├── store/ # Pinia store tests (searchStore)
└── views/ # View tests (ContactView, versionComponentMap)
Writing client tests:
- Tests are ESM (matching the client codebase). Import vitest functions explicitly:
import { describe, it, expect, vi } from 'vitest'. vi.mock()works for ESM imports. Mock HTTP calls by mocking@/http-common.- Mount components with
@vue/test-utils. Stub child components and router as needed.
Coverage
Run tests with a coverage report:
docker compose -f docker-compose.dev.yml run --rm --no-deps api npx vitest run --coverage
docker compose -f docker-compose.dev.yml run --rm --no-deps client npx vitest run --coverage
Coverage is enforced at 80% for statements, branches, functions, and lines (configured in api/vitest.config.js and client/vitest.config.js). The CI workflow runs coverage on every pull request and will fail if thresholds are not met.
Troubleshooting: stale Docker images
If you see errors like npx: not found or unexpected behavior when running tests, you may have a stale Docker image cached from a previous build. This can happen when switching between dev and production Dockerfiles, since Docker Compose reuses an existing image if the tag already matches.
To fix this, remove the old image and rebuild:
docker image rm bioenergyorg-client # or bioenergyorg-api
docker compose -f docker-compose.dev.yml build --no-cache client
Import BRC Data Feeds
- run
docker compose run api node scripts/import_datafeeds.jsfrom the root folder of the project. - To redirect validation errors to a file, run
docker compose run api node scripts/import_datafeeds.js 2>&1 > import_datafeeds.txt - Under Windows PowerShell, use the following version of the above command to get a clean output file:
cmd /c "docker compose run api node scripts/import_datafeeds.js > import_datafeeds_after.txt 2>&1" - If you see warnings like
"VITE_*" variable is not set, add that variable to your local.envfile as an empty placeholder.
Resources Used to Build This Application
BRC Data End Points
- CABBI: https://cabbitools.igb.illinois.edu/brc/cabbi.json
- CBI: https://bioenergy-research-centers.github.io/brc_data_feeds/cbi.json
- GLBRC: https://fair-data.glbrc.org/glbrc.json
- JBEI: https://bioenergy.org/JBEI/jbei.json
Using Claude Code with the bioenergy.org MCP server.
This project repo automatically registers the MCP server in Claude Code via the .mcp.json file at the root of this repo.
Alternatively, to tell Claude where the MCP server is:
claude mcp add --transport http bioenergy-datasets --scope project https://mcp.bioenergy.org
Then, in Claude Code, run /mcp and approve the server if prompted. You can check to confirm that Claude has registered the MCP with claude mcp list.
Validating Data
A local data feed file can be validated against the schema currently supported by the API by posting the file to the validation endpoint (or http://localhost:8080/api/validate if testing against your dev environment). Alternatively, you can paste your data feed into the Swagger API documentation, which will pretty-print the validation results.
Under Unix, macOS, Git Bash, or WSL (for Windows PowerShell use curl.exe instead of curl):
curl -X POST -H "Content-Type: application/json" --data-binary "@jbei.json" https://api.bioenergy.org/api/validate > validation-results.json
The endpoint uses the schema version declared in the posted feed. A schema version can also be forced with the schema_version query parameter:
curl -X POST -H "Content-Type: application/json" --data-binary "@jbei.json" "https://api.bioenergy.org/api/validate?schema_version=0.1.13"
The response is JSON and includes:
- the schema version used for validation
- counts of valid, invalid, and duplicate records
- detailed validation errors for invalid records
- duplicate record details
Copyright Notice
InterBRC Data Products Portal Copyright (c) 2025, The Regents of the University of California, through Lawrence Berkeley National Laboratory, and UT-Battelle LLC, through Oak Ridge National Laboratory (both subject to receipt of any required approvals from the U.S. Dept. of Energy), University of Wisconsin - Madison, University of Illinois Urbana - Champaign, and Michigan State University. All rights reserved.
If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Intellectual Property Office at
IPO@lbl.gov.
NOTICE. This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights. As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit others to do so.
Owner metadata
- Name: bioenergy-research-centers
- Login: bioenergy-research-centers
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/142427124?v=4
- Repositories: 1
- Last ynced at: 2025-02-28T04:07:26.082Z
- Profile URL: https://github.com/bioenergy-research-centers
GitHub Events
Total
- Delete event: 5
- Pull request event: 49
- Fork event: 2
- Issues event: 68
- Watch event: 3
- Issue comment event: 90
- Push event: 86
- Public event: 1
- Pull request review comment event: 7
- Pull request review event: 27
- Create event: 32
Last Year
- Delete event: 2
- Pull request event: 19
- Issues event: 24
- Issue comment event: 26
- Push event: 55
- Pull request review comment event: 3
- Pull request review event: 12
- Create event: 16
Committers metadata
Last synced: 3 days ago
Total Commits: 110
Total Committers: 15
Avg Commits per committer: 7.333
Development Distribution Score (DDS): 0.773
Commits in past year: 43
Committers in past year: 8
Avg Commits per committer in past year: 5.375
Development Distribution Score (DDS) in past year: 0.465
| Name | Commits | |
|---|---|---|
| Nick Thrower | t****n@m****u | 25 |
| Valerie Autumn Skye | 1****e | 23 |
| Clint Cecil | c****l@w****u | 13 |
| Hector Plahar | h****r | 11 |
| Chuck Parker | c****r | 10 |
| Nathan Hillson | n****n@l****v | 9 |
| Harry Caufield | j****d@g****m | 5 |
| ianderthal | i****l | 3 |
| StantonMartin | 6****n | 3 |
| mkulawik | 1****k | 2 |
| Mark A. Miller | M****M@l****v | 2 |
| franflame | 8****e | 1 |
| Oliver Ruebel | o****l | 1 |
| Leslie Stoecker | l****r@i****u | 1 |
| Dirk Norman (GLBRC) | 1****c | 1 |
Committer domains:
- lbl.gov: 2
- illinois.edu: 1
- wisc.edu: 1
- msu.edu: 1
Issue and Pull Request metadata
Last synced: 4 days ago
Total issues: 123
Total pull requests: 89
Average time to close issues: about 2 months
Average time to close pull requests: 11 days
Total issue authors: 14
Total pull request authors: 10
Average comments per issue: 1.7
Average comments per pull request: 1.06
Merged pull request: 73
Bot issues: 0
Bot pull requests: 0
Past year issues: 56
Past year pull requests: 39
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 13 days
Past year issue authors: 8
Past year pull request authors: 6
Past year average comments per issue: 1.79
Past year average comments per pull request: 1.51
Past year merged pull request: 25
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- valerie-autumn-skye (28)
- caufieldjh (24)
- throwern (22)
- ct-parker (21)
- hplahar (12)
- dnorman-glbrc (3)
- ianderthal (3)
- thatRailsGuy (3)
- StantonMartin (2)
- njhillson (1)
- cmungall (1)
- mkulawik (1)
- lensor (1)
- franflame (1)
Top Pull Request Authors
- throwern (30)
- valerie-autumn-skye (21)
- hplahar (11)
- ct-parker (10)
- caufieldjh (6)
- mkulawik (3)
- ianderthal (3)
- thatRailsGuy (2)
- franflame (2)
- oruebel (1)
Top Issue Labels
- enhancement (33)
- bug (19)
- help wanted (5)
- question (3)
- good first issue (2)
- documentation (2)
- invalid (1)
Top Pull Request Labels
- enhancement (29)
- documentation (5)
- bug (4)
Dependencies
- actions/checkout v3.0.2 composite
- actions/setup-node v2 composite
- node 20 build
- nginx stable-alpine build
- node 20 build
- @faker-js/faker ^8.4.1 development
- @octokit/rest ^21.1.0
- ajv ^8.17.1
- ajv-formats ^3.0.1
- axios ^1.7.7
- body-parser ^1.20.2
- cors ^2.8.5
- dotenv ^16.4.5
- express ^4.18.2
- nodemon ^3.1.7
- pg ^8.11.3
- pg-hstore ^2.3.4
- sanitize-html ^2.14.0
- sequelize ^6.37.0
- swagger-jsdoc ^6.2.8
- swagger-ui-express ^5.0.0
- sync-fetch ^0.5.2
- @rushstack/eslint-patch ^1.3.3 development
- @vitejs/plugin-vue ^5.0.3 development
- @vue/eslint-config-prettier ^8.0.0 development
- @vue/test-utils ^2.4.4 development
- cypress ^13.6.3 development
- eslint ^8.49.0 development
- eslint-plugin-cypress ^2.15.1 development
- eslint-plugin-vue ^9.17.0 development
- jsdom ^24.0.0 development
- prettier ^3.0.3 development
- start-server-and-test ^2.0.3 development
- vite ^5.0.11 development
- vitest ^1.2.2 development
- @popperjs/core ^2.11.8
- axios ^1.6.7
- bootstrap ^5.3.2
- bootstrap-icons ^1.11.3
- dotenv ^16.4.5
- jquery ^3.7.1
- pinia ^2.2.4
- pinia-plugin-persistedstate ^4.1.2
- vue ^3.4.15
- vue-router ^4.2.5
- mvp file:api
Score: 5.886104031450156