This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the GenoBank.io frontend repository - a Jekyll-based static website that serves as the main interface for GenoBank’s genomic data platform. It integrates with multiple GenoBank microservices via Web3 authentication and provides user dashboards, laboratory interfaces, and biosample management.
# Install Jekyll dependencies
bundle install
# Run Jekyll development server
bundle exec jekyll serve
# For live development with hot reload (requires VS Code Live Server extension)
# Visit http://127.0.0.1:5500/
# Access test environment locally
# http://127.0.0.1:5500/test/
# Test activation flow with sample data
# http://127.0.0.1:5500/activate/?biosampleId=60&laboratoryId=2&secret=67d6516e1229eee318e5032776377b639f1c2ee2fe93531164bf5706d56fdcf1#1940837240937409237
cd test/user
npm install
npm start # Runs gulp watch with BrowserSync
gulp build # Build CSS/JS
The site uses a dynamic environment configuration system (js/env.js
):
/test/
Key environment variables:
window.API_BASE = test ? 'https://staging.genobank.app' : 'https://genobank.app'
window.MESSAGE_TO_SIGN = "I want to proceed"
window.MAGIC_API_KEY = "pk_live_5F9630468805C3A0" // Google OAuth
The site supports three authentication methods, all converging to Web3 signatures:
window.ethereum.isBioWallet === true
eohejafelpaeejocncecjofhjmgflahn
Authentication flow:
user_signature
parameterAll GenoBank microservices use consistent Web3 authentication:
// Standard API call pattern
fetch(`${window.NEW_API_BASE}/endpoint?user_signature=${localStorage.getItem('user_sign')}`)
// Common endpoints
/recover // Get wallet from signature
/get_owner_details // User profile
/get_user_files // User's biofiles
/validate_permittee // Check permissions
/consent/biofile/
)
/consent/lab_biofile/
)
/activate/
)
/activate-somos/
)/certificates/
)
genobank.io/
├── _layouts/ # Jekyll layouts (base.html, default.html)
├── _includes/ # Reusable components
├── js/ # Shared JavaScript
│ ├── env.js # Environment configuration
│ └── web3-functions.js # Web3 utilities
├── css/ # Global styles
└── [feature]/ # Feature-specific directories
├── index.html # Main page
└── [feature].js # Feature-specific JS
All external resources must include integrity hashes:
<script src="https://cdn.jsdelivr.net/..."
integrity="sha384-..."
crossorigin="anonymous"></script>
Calculate integrity hash:
wget http://domain.com/resource.js
cat resource.js | openssl dgst -sha256 -binary | openssl base64 -A
Before modifying any file, especially in login functionality:
cp file.js file.js.bkp.$(date +"%m%d%Y")
window.ethereum.isBioWallet = true
window.ethereum.isMetaMask = false
user_signature
The site is deployed via GitHub Pages with GitHub Actions:
Changes pushed to master
or dev
branches automatically deploy via the GitHub Actions workflow defined in CONTRIBUTING.md.
The test environment (/test/
path) provides:
To develop features:
/test/
directory firstGenoBank APIs typically return:
{
"success": true/false,
"data": {...},
"message": "Human readable message"
}
Always check success
field before processing data
.
Target modern browsers with ES6+ support:
Use CDN polyfills for older browser support when necessary.