Deployment Guide
Relevant source files
The following files were used as context for generating this wiki page:
This guide provides technical instructions for deploying the DXKB (Disease X Knowledge Base) platform, a Next.js application designed for disease surveillance and bio-informatics research. The application leverages a modern web stack to provide data analysis, visualization tools, and workspace management capabilities.
The deployment process encompasses environment configuration, dependency management, and build orchestration to ensure the platform can connect to critical backend services such as the Data API and Shock storage endpoints.
Environment Configuration
The application requires several environment variables to be configured for successful operation in production. These variables control API connectivity and security constraints for file uploads.
Required Environment Variables
| Variable | Description | Source |
|---|---|---|
NEXT_PUBLIC_DATA_API | The base URL for the DXKB/BV-BRC Data API used for resource fetching. | src/components/services/ListData.tsx:55 |
SHOCK_ORIGINS | A comma-separated list of allowed origins for Shock storage endpoints during file uploads. | src/app/api/services/workspace/upload/tests/route.test.ts:8 |
External Service Integration
The platform integrates with the BV-BRC (Bacterial and Viral Bioinformatics Resource Center) architecture for authentication and data storage. Users must be aware that DXKB and BV-BRC share account systems and backend service logic.
Sources: src/app/(footer)/faq/page.tsx:32, src/app/(footer)/privacy-policy/data/privacy-policy-sections.ts:54
Build and Runtime Orchestration
The application is built using Next.js and managed via pnpm. The deployment lifecycle involves installing dependencies, generating a production build, and starting the optimized server.
Lifecycle Scripts
The following scripts defined in the project configuration manage the transition from development to production:
"scripts": {
"dev": "next dev --turbopack -p 3019",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"test": "vitest run"
}
Sources: package.json:6-12
Deployment Workflow Diagram
The following diagram illustrates the high-level flow from source code to a running production environment.
This diagram represents the standard build and execution pipeline for the Next.js application.
Sources: README.md:10-20, package.json:6-10
Infrastructure Requirements
Dependency Management
The project uses pnpm as its primary package manager. Ensure pnpm@10.32.1 or compatible is installed in the deployment environment.
Sources: package.json:107
Server Specifications
The application utilizes Next.js features such as Server Components and metadata optimization.
- Runtime: Node.js environment compatible with Next.js v16.1.7.
- Default Port: The development environment defaults to
3019, which should be considered when configuring reverse proxies or load balancers.
Sources: package.json:6, package.json:34
Security and Authentication
The deployment must account for the platform's authentication state, which is persisted via cookies.
Authentication State Flow
The application initializes the user session by parsing cookies during the root layout render.
This diagram shows how user identity is established at the server level before reaching the client.
Sources: src/app/layout.tsx:50-70
Upload Security
During deployment, the SHOCK_ORIGINS variable acts as a security filter. The API route for workspace uploads validates that the destination URL matches the allowed origins before prepending the OAuth token for upstream requests.
Sources: src/app/api/services/workspace/upload/tests/route.test.ts:110-140
Conclusion
Successful deployment of DXKB requires a properly configured environment that points to the NEXT_PUBLIC_DATA_API and defines secure SHOCK_ORIGINS. By following the pnpm build and pnpm start lifecycle, the application provides a performant, server-rendered experience for bio-informatics research.