Skip to content

ChildMindInstitute/mindlogger-admin

Repository files navigation

Child Mind Institute - MindLogger Admin

This repository is used for the Admin Panel of the MindLogger application stack.

Getting Started

Application Stack

Running the app:

1. Prerequisites

  • NodeJS 18 or higher, recommend using asdf or nvm to manage local node version
  • Backend project running locally or accessible in a test environment
    • If running locally, ensure that http://localhost:3000 has been added to the BE's CORS__ALLOW_ORIGINS environment variable
  • Configured environment variables:
    cp .env.example .env

2. Run the app

  • Install dependencies using npm install
  • Run the project using npm run start. See scripts
  • Launch browser http://localhost:3000 to view the admin panel

Features

See MindLogger's Knowledge Base article to discover the MindLogger application stack's features.

Technologies

This project was bootstrapped with Create React App.

  • Typescript - TypeScript is JavaScript with syntax for types
  • React - A JavaScript library for building user interfaces
  • Redux Toolkit - Global state manager for JavaScript applications
  • Material UI - Library of React UI components
  • Axios - Promise-based HTTP Client for node.js and the browser
  • React-app-rewired - All the benefits of create-react-app without the limitations of "no config"

Available Scripts

In the project directory, you can run:

Running the app

  • npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in the browser.

    The page will reload if you make edits.
    You will also see any lint errors in the console.

  • npm start:checkCycles

    The same as npm start, but with cycle dependency analysis logging.

  • npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

  • npm run eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Testing

See the section about running tests for more information.

  • npm run test - Launches the test runner in the interactive watch mode.
  • npm run test:coverage - Generate test coverage report
  • npm run test:junit - Generate a junit xml report
  • npm run test:related - Runs tests only for modified files
  • npm run test:nowatch - Runs test suite once with the watchAll=false flag

Environment Variables

Key Required Default value Description
REACT_APP_API_DOMAIN yes null MindLogger Backend API base URL
REACT_APP_WEB_URI yes http://localhost:5173 Base URL of the MindLogger respondent web app
REACT_APP_ENV no null Environment to run the app in (prod or staging)
REACT_APP_DEVELOP_BUILD_VERSION no null Footer app build number
REACT_APP_MIXPANEL_TOKEN no null Mixpanel token
REACT_APP_LAUNCHDARKLY_CLIENT_ID no null LaunchDarkly client key to choose target environment

License

Delayed Open Source Attribution License 1.0 (DOSA-1.0)

Refer to LICENSE.md