π€ AI Agent Quick-Start If you are creating a new route that previously existed in the AngularJS app, you must ensure the final URL structure matches perfectly. Use Next.js Route Groups
(group-name)to organize code without affecting the URL.
This document defines the URL Management Strategy for ModelSEED-UI.
In the legacy ModelSEED UI, biological data objects like Models, FBA results, and Genomes were located at paths exactly matching their KBase Workspace location. These paths could be highly dynamic and deeply nested:
- Legacy URL example:
modelseed.org/model/user/my_models/folder_A/the_model_name
We use the Next.js 16 Catch-all Routing pattern ([...path]) to capture these dynamic segments and pass them as an array to a single page component.
| Legacy URL Pattern | New Next.js Page Location | Current Status |
|---|---|---|
/model/* |
app/model/[...path]/page.tsx |
β Functional |
/fba/* |
app/fba/[...path]/page.tsx |
β Functional |
/gapfill/* |
app/gapfill/[...path]/page.tsx |
β Functional |
/genome/* |
app/genome/[...path]/page.tsx |
β Functional |
/feature/* |
app/feature/[...path]/page.tsx |
β Functional |
/biochem/reactions/:id |
app/(reference-data)/biochem/reactions/[id]/page.tsx |
β Functional |
/data/* |
app/data/[...path]/page.tsx |
|
/compare |
app/compare/page.tsx (Unbuilt) |
β Missing (Phase 30) |
/run/fba |
app/run/fba/page.tsx (Unbuilt) |
β Missing |
When adding to or modifying catch-all routes:
- Folder Naming: The dynamic folder MUST be named
[...path]. Do not use[slug]or[id]. - Accessing Parameters: The
paramsprop MUST be accessed via the standard Next.js 15+ asyncuse(params)pattern:
'use client';
import { use } from 'react';
export default function WorkspaceObjectPage({ params }: { params: Promise<{ path: string[] }> }) {
const resolvedParams = use(params);
const fullWorkspacePath = '/' + resolvedParams.path.join('/');
// Pass `fullWorkspacePath` to your useQuery hook
}Caution
Workspace Paths start with /. The join('/') method above does not prepend a slash. Always prepend the / before passing the path to the workspace API.
- Route Groups: If you need a shared layout (like the User Data sidebar), wrap the folder in parentheses. Example:
app/(user-data)/my-models/page.tsx. This keeps the URL as/my-models.