Welcome to the Serre Lab site repository! This document explains the structure of the site and how to update content like people, research, resources, and publications.
For future editors of the code:
<Title order={1}>is for main page titles<Title order={2}>is for section titles<Title order={3}>is for subsection titles<Text>is for paragraph text
- Framework: React (with Vite)
- UI Library: Mantine UI
- Routing: React Router (Hash Router)
- Styling: CSS Modules + Global CSS
- Animation: Motion for React
- Icons: React Icons (Font Awesome)
- Data Source: JSON files
- Markdown: React Markdown (for dynamic pages)
src/
βββ components/
β βββ Person/Person.tsx # Person card + modal
β βββ ResearchProject/ # Research project component
β βββ HeroBanner/HeroBanner.tsx
β βββ Header/Header.tsx # Navigation header
β βββ Footer/Footer.tsx # Site footer
β βββ MarkdownPage/ # Dynamic markdown pages
βββ data/
β βββ people.json # List of lab members
β βββ alumni.json # List of alumni
β βββ research.json # Grant descriptions and funding
β βββ resources.json # Resources and tools
β βββ scicomm.json # Media coverage
β βββ talks.json # Talks list (not filtered by media search)
β βββ publications_by_year.json # Generated from the CV central file
β βββ officialPublicationUrls.js # Publication URL mappings
βββ pages/
β βββ Home/Home.tsx # Homepage
β βββ People/People.tsx # People page
β βββ Research/Research.tsx # Research page
β βββ Resources/Resources.tsx # Resources page
β βββ Publications/Publications.jsx # Publications page
β βββ SciComm/SciComm.tsx # Media page
βββ markdown-pages/
β βββ resources/ # Dynamic markdown content
βββ styles/
βββ typography.css # Global typography
βββ index.css # Global styles
public/
βββ hmdb51.html # Standalone HMDB page (real path, not a hash route)
βββ breakfast-actions-dataset.html
βββ datasets/ # No dataset archives are committed; see public/datasets/README.md
-
File:
src/data/people.json -
Required fields:
fullName: Person's full nametitle: Job title (see valid options below)university: Either"Brown"or"ANITI"description: Bio or descriptionimagePath: Path to headshot imagewebsite: Personal website URL (optional)
-
Valid title options:
"Principal Investigator""Assistant Professor of Research""PostDoc""Grad student""Research Assistant""Undergraduate student"
-
Format:
{
"people": [
{
"fullName": "First Last",
"title": "Grad student",
"university": "Brown",
"description": "Short bio or research interests.",
"imagePath": "/people/firstlast.jpg",
"website": "https://firstlast.com"
}
]
}- Alumni: Edit
src/data/alumni.jsonfor former lab members - Layout: People are grouped by university and title, sorted alphabetically within groups
- Recommended size: 400x400 to 600x600 pixels (square)
- Aspect ratio: 1:1 (square)
- Resolution: 72β150 dpi (web)
- File size: Under 200 KB for fast loading
- Format: JPG or PNG
- Location: Save in
public/people/directory - Naming: Use lowercase with hyphens (e.g.,
first-last.jpg)
- File:
src/data/research.json - Format:
{
"researchProjects": [
{
"title": "Project Name",
"years": "2021β2024",
"fundingSource": "NSF / NIH",
"description": [
"First paragraph about the project...",
"Second paragraph with more details..."
]
}
]
}- File:
src/data/resources.json - Structure: Organized by category and subcategory
- Format:
{
"Resources": {
"Datasets": [
{
"title": "Dataset Name",
"url": "https://example.com"
}
],
"Demos and Tutorials": [
{
"title": "Demo Name",
"url": "https://demo.com"
}
],
"Tools & Software": [
{
"title": "Tool Name",
"url": "https://tool.com"
}
],
"Videos & Talks": [
{
"title": "Talk Title",
"url": "https://youtube.com/watch?v=..."
}
]
}
}- Categories: Datasets, Demos and Tutorials, Tools & Software, Videos & Talks, Cognitive Benchmark Tests
- Hash routes: in-app pages such as
/resources/the-multi-cue-boundary-detection-dataset(the site uses hash routing, so the browser URL is/#/resources/...) - Standalone HTML:
/hmdb51.htmland/breakfast-actions-dataset.htmlare real document paths, not hash routes - External links: Use full URLs for external resources
Do not edit src/data/publications_by_year.json or ~/Work/personal/cv/data/publications_structured.json by hand. publications_structured.json is generated.
- Edit only
~/Work/personal/cv/data/publications_central.json. - Follow
~/Work/personal/cv/memory/procedures/publication-style.md(sentence-case titles, author lines; never arXiv title case). - From the configured Python environment (
source ~/Work/agents/claude/scripts/activate-env.sh):
cd ~/Work/personal/cv && python scripts/sync_from_central.py
cd ~/Work/research/lab-website && python scripts/sync_from_central_publications.pyThe CV script regenerates publications_structured.json from central and also rewrites the lab JSON, copying pdf_path when central has one. The lab script then rebuilds src/data/publications_by_year.json from that generated file. It keeps a local pdfPath only when the lab file it reads still has one.
Home-page publication cards in src/pages/Home/Home.tsx are manual.
Search matches title, authors, and journal as a trimmed, case-insensitive substring. Year groups stay in the existing order: Work in progress, In press, then years descending. A usable url on the record is the public link. src/data/officialPublicationUrls.js applies only when that URL is missing, blank, a PDF, or a /papers/ path. Prefer the publisher or DOI link. Do not add an untagged local PDF as the publication link.
- Coverage:
src/data/scicomm.jsonis an array of{ "title", "link", "blurb", "image" }. - Talks:
src/data/talks.jsonis a separate array (venue,location,date, optionaltitle,link,upcoming). The media search filters coverage only; talks stay listed. - Search matches title and blurb as a trimmed, case-insensitive substring.
HMDB and Breakfast are standalone HTML files, not React routes:
public/hmdb51.htmlpublic/breakfast-actions-dataset.html
Resources links them with a normal <a href> because the URL ends in .html. Other resource write-ups are markdown files under src/markdown-pages/. src/utils/loadMarkdownFiles.ts registers every .md file there as a hash route. They are not added to the main navigation. src/markdown-pages/resources/joining-the-lab.md is reachable and is omitted from the sitemap.
The site uses hash routing. Do not add server rewrites to imitate path routing. See public/datasets/README.md for which dataset files are actually in the repo.
- Location:
src/markdown-pages/resources/ - Format: Create
.mdfiles - Routing: Loaded as hash routes by
loadMarkdownFiles. Included inpublic/sitemap.xmlon the nextnpm run build, exceptjoining-the-lab - Styling:
MarkdownPage.css
- Add a supplied headshot to
public/people/, or use an emptyimagePathfor an initials placeholder - Edit
src/data/people.jsonorsrc/data/alumni.json - Follow the JSON format above
Edit ~/Work/personal/cv/data/publications_central.json only, then run the two sync commands in Editing publications. Do not hand-edit the generated JSON and do not add an untagged local PDF as the publication link.
- Edit
src/data/resources.json - Choose appropriate category
- Use internal paths for site pages, full URLs for external
- Edit
src/data/scicomm.json - Use the image from the source article by default (extract og:image or hero image URL)
- Each entry:
title,link,blurb,image
β οΈ Important: Always validate your JSON syntax (check for commas, braces, quotes)
npm install
npm run dev # http://localhost:5173
npm run lint
npm test # Playwright. Builds the site, then previews it on port 4173
npm run build # Regenerates public/sitemap.xml, then typechecks and builds
npm run deploy # predeploy runs the build; publishes dist/ with gh-pagesBefore each deploy, run a Lighthouse accessibility audit and check keyboard navigation (Tab, Shift+Tab, Enter, Escape).
src/App.tsx uses createHashRouter. App pages are fragments such as https://serre.lab.brown.edu/#/publications. scripts/generate-sitemap.cjs writes those hash URLs plus the two standalone dataset HTML files. It omits lastmod and leaves joining-the-lab unlisted. Many crawlers do not index fragments. The sitemap documents the routes that exist; it does not create server paths for them.
- Images:
public/ - Page content: JSON under
src/data/, except publications (see above) - Styling: CSS next to each page
- Consistent spacing: Use standardized margins and padding
- Typography: Follow the typography hierarchy (Title order 1-3, Text)
- Colors: Use CSS variables defined in
src/index.css - Responsive: All pages should work on mobile and desktop
- Accessibility: Use semantic HTML and proper contrast ratios
- CMS Integration: Consider using a headless CMS for non-technical editing
- Image Upload: Add drag-and-drop image upload functionality
- Publication Sync: Automate publication syncing from BibTeX or ORCID
- Search Enhancement: Add full-text search across all content
- Analytics: Add usage analytics and publication metrics
For questions about editing the website:
- Check this README first
- Look at existing examples in the JSON files
- Contact the development team
Contact the development team for questions.