Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2-5201: Update readme file #1501

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_API_DOMAIN=http://localhost:8000
REACT_APP_ENV='dev'
REACT_APP_DEVELOP_BUILD_VERSION=
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.19.0
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO: https://mindlogger.atlassian.net/browse/M2-5374 -->
97 changes: 74 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,100 @@
# Mind Logger Admin Redesigned
# Child Mind Institute - MindLogger Admin

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This repository is used for the Admin Panel of the [MindLogger](https://mindlogger.org/) application stack.

## Getting Started

ChaconC marked this conversation as resolved.
Show resolved Hide resolved
* MindLogger Admin - **This Repo**
* MindLogger Backend - [GitHub Repo](https://github.com/ChildMindInstitute/mindlogger-backend-refactor)
* MindLogger Mobile App - [GitHub Repo](https://github.com/ChildMindInstitute/mindlogger-app-refactor)
* MindLogger Web App - [GitHub Repo](https://github.com/ChildMindInstitute/mindlogger-web-refactor)

## Application Stack

Running the app:

### 1. Prerequisites

- NodeJS `18` or higher, recommend using `asdf` or `nvm` to manage local node version
- [Backend](https://github.com/ChildMindInstitute/mindlogger-backend-refactor) 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
ChaconC marked this conversation as resolved.
Show resolved Hide resolved
- Configured [environment variables](#environment-variables):\
`cp .env.example .env`

### 2. Run the app

- Install dependencies using `npm install`
- Run the project using `npm run start`. See [scripts](#available-scripts)
- Launch browser [http://localhost:3000](http://localhost:3000) to view the admin panel

## Features

See MindLogger's [Knowledge Base article](https://mindlogger.atlassian.net/servicedesk/customer/portal/3/topic/4d9a9ad4-c663-443b-b7fc-be9faf5d9383/article/337444910) to discover the MindLogger application stack's features.

## Technologies 🛠️
## Technologies

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

- [Typescript](https://www.typescriptlang.org/) - TypeScript is JavaScript with syntax for types
- [React](https://reactjs.org/) - A JavaScript library for building user interfaces
- [Redux Toolkit](https://redux-toolkit.js.org/) - Global state manager for JavaScript applications
- [Material UI](https://mui.com/) - Library of React UI components
- [Axios](https://axios-http.com/) - Promise-based HTTP Client for node.js and the browser
- [React-app-rewired](https://github.com/timarney/react-app-rewired/) - Set up create-react-app webpack config without using "eject"
- [React-app-rewired](https://github.com/timarney/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:
ChaconC marked this conversation as resolved.
Show resolved Hide resolved

### `npm start`
### Running the app

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
- `npm start`

The page will reload if you make edits.\
You will also see any lint errors in the console.
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

### `npm test`
The page will reload if you make edits.\
You will also see any lint errors in the console.

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
- `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!

### `npm run build`
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
- `npm run eject`

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
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](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run eject`
- `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

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

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.
| Key | Required | Default value | Description |
| ------------- | ------------- | ------------- | ------------- |
| REACT_APP_API_DOMAIN | yes | null | MindLogger Backend API base URL |
| 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 |

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.
## License

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.
<!-- TODO: https://mindlogger.atlassian.net/browse/M2-5374 -->
Loading