Setting up your Development Environment
This guide explains how to set up a development environment for DiracX Web.
Prerequisites
- Node.js (version 18 or higher)
- npm or yarn package manager
- Git
Quick Start
-
Clone the repository:
-
Install dependencies:
-
Start the development server:
The development server will start on http://localhost:3000
by default.
Development Workflow
File Structure
The main directories in the project:
- packages/
- Contains all the packages (components, main web app, extensions)
- public/
- Static assets
- docs/
- Documentation
Running in Development Mode
When running in development mode: - Hot reload is enabled for instant feedback - Source maps are available for debugging - Development-specific features are enabled
Environment Configuration
Create a .env.local
file in the root directory to configure environment variables:
# DiracX API endpoint
NEXT_PUBLIC_DIRACX_URL=http://localhost:8000
# OIDC configuration
NEXT_PUBLIC_OIDC_AUTHORITY=your-oidc-authority
NEXT_PUBLIC_OIDC_CLIENT_ID=your-client-id
Building for Production
To build the application for production:
This creates an optimized production build in the .next
directory.
Testing
Run the test suite:
For continuous testing during development:
Troubleshooting
Common Issues
-
Port already in use: The default port 3000 might be occupied. Use a different port:
-
Module not found: Clear node_modules and reinstall:
For more detailed information, see the CONTRIBUTING.md file.