Setup
Prerequisites
Before you begin, ensure you have the following installed on your system:
- Node.js (v16 or higher)
- npm (v8.3.0 or higher)
- Docker (v4.39.0 or higher), used to run the supporting services
Developer Setup
Stage is the front-end scaffolding for an Overture portal. Its explorer page is assembled from Arranger's UI components, so the data table, facets, and query bar have nothing to render until an Arranger search API is behind them, and Arranger in turn needs a search engine to query. Those are the complementary services this guide starts: they are what feeds the Arranger component UI inside Stage. The repository ships them under dev-services/, so no other repository is required.
Setting up complementary services
-
Clone Stage and move into its directory:
git clone https://github.com/overture-stack/stage.gitcd stage -
Start the complementary services:
cd dev-servicesmake upClick here for a detailed breakdown
make upstarts the two services Stage queries and loads mock ARGO clinical data into them, waiting until Arranger is actually serving the catalogue before it returns:Service Port Description Purpose in Stage Development OpenSearch 9200Search engine Holds donor-index, the data Arranger readsArranger 5050GraphQL API for data querying The search API your development server will talk to A one-shot
setupcontainer applies the index template, createsdonor-indexwith itsdonor_centricalias, and bulk-loadsdata/donor.ndjson. It is idempotent, so it skips work already done on subsequent starts.- Both services are bound to
127.0.0.1, so they are reachable from your host but not from your network. - OpenSearch runs with its security plugin disabled, so no credentials are needed. Never disable security on anything network-exposed.
- Stage itself is not containerized here. The copy you edit is the one you run in the next section.
- The sample data is 373 mock ARGO clinical donor records, each carrying nested specimen, diagnosis, treatment, follow-up, and biomarker entities. The records and the Arranger catalogue configuration are taken from the Prelude
docs-demo/ai-assisted-data-discoverydemo, so a portal built here lines up with that one. - Arranger serves one catalogue per directory under
dev-services/configs/arranger. With a single catalogue registered it mounts that catalogue at the root,http://localhost:5050/graphql, and only switches to/<catalogue>/graphqlonce more than one is registered. Stage reads a single catalogue, so this stack ships one, nameddonor, andNEXT_PUBLIC_ARRANGER_API_URLneeds no catalogue path. If you add a second catalogue, that URL has to becomehttp://localhost:5050/donor. make downstops the services while keeping the loaded data,make statusshows what is running, andmake logsfollows the Arranger and OpenSearch logs.make resetdeletes the search engine volume, so the nextmake upreloads the data from scratch.makeon its own lists every target.
- Both services are bound to
-
Confirm Arranger is serving the catalogue before moving on:
curl -s -X POST -H 'Content-Type: application/json' \-d '{"query":"{ records { hits { total } } }"}' \http://localhost:5050/graphqlExpected result:
{"data":{"records":{"hits":{"total":373}}}}.
Running the Development Server
-
Return to the repository root:
cd .. -
Configure environment variables:
cp .env.schema .envinfoCopy the
.env.schematemplate to.envand populate it for your environment. A configuration that points Stage at the services started above looks like this:# Stage VariablesNEXTAUTH_URL=http://localhost:3001/api/authNEXT_PUBLIC_LAB_NAME=Stage Development EnvironmentNEXT_PUBLIC_ADMIN_EMAIL=contact@overture.bioNEXT_PUBLIC_DEBUG=true# Auth: left unset because this stack ships no identity providerNEXT_PUBLIC_AUTH_PROVIDER=ACCESSTOKEN_ENCRYPTION_SECRET=super_secretSESSION_ENCRYPTION_SECRET=this_is_a_super_secret_secret# Arranger VariablesNEXT_PUBLIC_ARRANGER_API_URL=http://localhost:5050NEXT_PUBLIC_ARRANGER_DOCUMENT_TYPE=recordsNEXT_PUBLIC_ARRANGER_INDEX=donor-indexNEXT_PUBLIC_ARRANGER_MANIFEST_COLUMNS=Click here for a detailed explanation of the Stage environment variables
-
Stage Variables
NEXTAUTH_URL: Specifies the base URL for NextAuth.js, which handles authentication in Next.js applications. This setting is used to configure the authentication flow, including where to redirect users after successful authentication. It must match the port your development server runs on.NEXT_PUBLIC_LAB_NAME: The name displayed in the top left of the portal interface. Feel free to customize this.NEXT_PUBLIC_ADMIN_EMAIL: The email address of the administrator or support contact. This setting updates the help link found by default in the footer navigation of the portal interface.NEXT_PUBLIC_DEBUG: Enables verbose client-side logging.
-
Auth Variables
NEXT_PUBLIC_AUTH_PROVIDER: Selects the identity provider, eitherkeycloakorego. Left empty here: this stack ships no identity provider, and Stage hides its login and profile controls when this is unset. To develop against Keycloak, set this tokeycloak, populate theNEXT_PUBLIC_KEYCLOAK_*variables andKEYCLOAK_CLIENT_SECRETfrom the template, and supply a Keycloak instance yourself.ACCESSTOKEN_ENCRYPTION_SECRET: Defines the secret used to encrypt access tokens, enhancing security by preventing easy decoding of intercepted tokens.SESSION_ENCRYPTION_SECRET: Specifies the secret used to encrypt session cookies, protecting sensitive information stored in the cookie from unauthorized access.
-
Arranger Variables
NEXT_PUBLIC_ARRANGER_API_URL: The URL of the Arranger GraphQL API. Thedev-servicesstack publishes Arranger on port5050.NEXT_PUBLIC_ARRANGER_DOCUMENT_TYPE: The GraphQL type name for the catalogue's documents, set bydev-services/configs/arranger/donor/base.jsontorecords.NEXT_PUBLIC_ARRANGER_INDEX: The index Arranger queries, set bydev-services/configs/arranger/donor/base.jsontodonor-index.NEXT_PUBLIC_ARRANGER_MANIFEST_COLUMNS: Lists the columns to be included in the manifest generated for download with Score. Thedev-servicesstack includes no Score service, so this can be left empty.
-
-
Install the required npm packages:
npm citipEnsure you are running Node.js v16 or higher. To check, you can run
node --version. You should see something similar to the following:v16.14.0 -
Start the Stage development server. Port
3001is used here to leave3000free, since a local docs site or another portal commonly occupies it:npm run dev -- -p 3001
Verification
After installation and configuration, verify that Stage is functioning correctly:
-
Check the Stage UI
- Navigate to
http://localhost:3001in a web browser. - Expected result: You should see the Stage front-end UI, served by your development server.
- Troubleshooting:
- Check your browser's console for error messages.
- Verify that you're using the correct URL and port.
- Navigate to
-
Check the connection to Arranger
- Navigate to the portal's explorer page.
- Expected result: The data table and facets populate with the mock ARGO donor records.
- Troubleshooting:
- Confirm Arranger is serving the catalogue, using the same query as step 3 above.
/pingis not enough on its own: it answers even when the catalogue failed to mount. - Verify
NEXT_PUBLIC_ARRANGER_API_URL,NEXT_PUBLIC_ARRANGER_DOCUMENT_TYPE, andNEXT_PUBLIC_ARRANGER_INDEXmatchdev-services/configs/arranger/donor/base.json. - Restart the development server after changing
.env; Next.js reads these values at start-up.
- Confirm Arranger is serving the catalogue, using the same query as step 3 above.
-
Check your theming changes apply
- Edit a value under
components/theme/and save. - Expected result: The running server rebuilds and the change appears in the browser.
- Edit a value under
Login, the user profile page, and API key generation all require an identity provider, which the dev-services stack does not include. To exercise those flows, point NEXT_PUBLIC_AUTH_PROVIDER at a Keycloak instance you supply and complete the NEXT_PUBLIC_KEYCLOAK_* variables in .env.schema.
If you encounter any issues or have questions about our API, please don't hesitate to reach out through our support page or our discussion forum.
This guide is meant to demonstrate the configuration and usage of Stage for development purposes and is not intended for production. If you ignore this warning and use this in any public or production environment, please remember to use appropriate security measures and configure your environment variables accordingly.