Development Workflow
This document describes the local development procedures for the OCTAVIUS system, covering both containerized and non-containerized approaches.
Environment Setup Requirements
API (Node.js/Express Server)
- Navigate to the API directory:
cd api - Install dependencies:
npm install - Start the development server:
npm run start(ornode server.js)
The API expects environment variables for database connectivity; default values are defined in api/startup/mongoose.js and api/server.js. Contact the project administrator for production secrets and credentials.
User Interface (React Single-Page Application)
- Navigate to the UI directory:
cd ui - Install dependencies with legacy peer dependency resolution:
npm install --legacy-peer-deps - Start the development server:
npm start
The React application implements hot reload functionality, enabling rapid iteration during development.
Database (MongoDB)
- Install MongoDB on your local system
- Restore the development database:
mongorestore -u username -p password docker/octavius-db - Update the connection URI to
localhost:27017
Development Architecture
Running components independently facilitates isolated debugging and hot reload functionality:
- Frontend Hot Reload: The React development server automatically reloads the UI when source files change
- Backend Debugging: The Node.js server can be debugged independently when separated from the UI
- Database Isolation: MongoDB on localhost enables deterministic testing and rapid schema iteration
Testing Procedures
API Testing
The API includes a comprehensive test suite. Execute tests manually:
cd api
node test.js
Alternatively, add the test command to package.json and execute npm test.
UI Testing
Run React tests using the built-in test runner:
cd ui
npm test
Environment Configuration
The API layer accommodates environment variable configuration for:
- MongoDB connection strings
- Authentication tokens
- Service endpoints
- Logging levels
Default values are provided for upon request for development; production deployments require explicit configuration.
Debugging Workflow
When debugging frontend and API interactions:
- Start the API in one terminal with logging enabled
- Start the UI in a separate terminal
- Use browser developer tools to inspect network requests
- Monitor API logs for resolver execution and database queries
- Use React DevTools for component state inspection within the browser