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)

  1. Navigate to the API directory: cd api
  2. Install dependencies: npm install
  3. Start the development server: npm run start (or node 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)

  1. Navigate to the UI directory: cd ui
  2. Install dependencies with legacy peer dependency resolution: npm install --legacy-peer-deps
  3. Start the development server: npm start

The React application implements hot reload functionality, enabling rapid iteration during development.

Database (MongoDB)

  1. Install MongoDB on your local system
  2. Restore the development database: mongorestore -u username -p password docker/octavius-db
  3. 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:

  1. Start the API in one terminal with logging enabled
  2. Start the UI in a separate terminal
  3. Use browser developer tools to inspect network requests
  4. Monitor API logs for resolver execution and database queries
  5. Use React DevTools for component state inspection within the browser

This site uses Just the Docs, a documentation theme for Jekyll.