Updated README

This commit is contained in:
scarlett kadan 2024-02-03 11:40:58 -05:00
parent b59aa6cb6c
commit 579f6f822d

302
README.md
View File

@ -1,70 +1,264 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
<img src="https://cdn.worldvectorlogo.com/logos/belden-4.svg">
## Available Scripts
---
# Belden Jukebox Front/Back Specifications
## This document outlines how data will be transmitted between the frontend and the backend.
In the project directory, you can run:
---
### Standard Object
- All objects sent between the frontend and backend will follow this format.
### `npm start`
```json
{
    type: "name_of_request"
    call: "send, request"
    data: {
    }
}
```
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
---
### CABLE_MAP Object
The page will reload when you make changes.\
You may also see any lint errors in the console.
#### Front:
> Front -> Back
```json
{
    type: "cable_map"
    call: "request"
    data: {
    }
}
```
### `npm test`
#### Back:
> Back -> Front
```json
{
    type: "cable_map"
    call: "send"
    data: {
        map: [
            item {
                part_number: 12345
                position: 0-53
                name: "Fancy Displayable Name"
                brand: "Belden"
                description: "This is a good cable!"
                short_description: "Good cable!"
            }
            ... many more items
        ]
    }
}
```
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.
---
### CABLE_DETAILS Object
#### Front:
> Front -> Back
```json
{
    type: "cable_details"
    call: "request"
    data: {
        part_number: [
            12345,
            67890,
            ...
        ]
        position: [
            0,
            1,
            2,
            ... 53
        ]
    }
}
```
### `npm run build`
#### Back:
> Back -> Front
```json
{
    type: "cable_details"
    call: "send"
    data: {
        cables: [
            {
                part_number: 12345
                position: 0-53
                part_image_url: "https://belden.com"
                brand_image_url: "https://belden.com"
                extracted_object: {
                    ....... #brand will be in here
                }
            },
            .....
        ]
    }
}
```
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
---
### CABLE_SEARCH Object
#### Front:
> Front -> Back
```json
{
    type: "cable_search"
    call: "request"
    data: {
        string: "name/part_number/type/category/etc"
    }
}
```
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
#### Back:
> Back -> Front
```json
{
    type: "cable_search"
    call: "send"
    data: {
        cables: [
            {
                part_number: 12345
                position: 0-53
                part_image_url: "https://belden.com"
                brand_image_url: "https://belden.com"
                extracted_object: {
                    ....... #brand will be in here
                }
            },
            ....
        ]
    }
}
```
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
---
### KEYBOARD Object
#### Front:
> Front -> Back
```json
{
    type: "keyboard"
    call: "request"
    data: {
        enabled: True / False
    }
}
```
### `npm run eject`
---
### MACHINE_SETTINGS Object
#### Front:
> Front -> Back
```json
{
    type: "machine_settings"
    call: "request"
    data: {
    }
}
```
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
#### Back:
> Back -> Front
```json
{
    type: "machine_settings"
    call: "send"
    data: {
    settings: [
    {
    setting_name: "text field"
    type: "text"
    current_value: "current value of seting"
    },
    {
    setting_name: "radio button"
    type: "radio"
    current_value: "option 1"
    radio_values: [
    "option 1",
    "option 2",
    "option 3"
    ]
    },
    {
    setting_name: "check box"
    type: "check"
    current_value: ["option 1", "option 2"]
    radio_values: [
    "option 1",
    "option 2",
    "option 3"
    ]
    },
    {
    setting_name: "enabled or disabled"
    type: "boolean"
    current_value: True
    },
    {
    setting_name: "slider bar"
    type: "slider"
    current_value: 50.0 #Float
    min: -100.0 #Float
    max: 100.0 #Float
    }
    ]
    }
}
```
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.
#### Front:
> Front -> Back
```json
{
    type: "machine_settings"
    call: "send"
    data: {
    settings: [
    {
    setting_name: "text field"
    type: "text"
    new_value: "current value of seting"
    },
    {
    setting_name: "radio button"
    type: "radio"
    new_value: [
    "option 1",
    "option 2",
    "option 3"
    ]
    },
    {
    setting_name: "check box"
    type: "check"
    new_value: [
    "option 1",
    "option 2",
    "option 3"
    ]
    },
    {
    setting_name: "enabled or disabled"
    type: "boolean"
    new_value: False
    },
    {
    setting_name: "slider bar"
    type: "slider"
    new_value: 100.0 #Float
    }
    ]
    }
}
```
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.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
---