This is the Seeding Rate Calculator codebase for PSA. Helping MCCC/NECCC/SCCC farmers calculate their seeding rate.
To access the live tool, visit here.
To see the documents for this tool, visit the wiki pages.
Date Created: 02/16/22
Date Last Modified: 09/10/24
The technologies we are currently using in this repo:
- React: Front-end Reat app
- Redux: State management
- Material UI: UI Library
-
The first step is downloading the code by cloning the repository:
git clone https://github.com/precision-sustainable-ag/dst-seedcalc.git
-
Then run
npm config set @psa:registry https://node.bit.cloud
-
Run
npm install
to install project dependencies. A full list of the dependencies can be found in package.json. If you are running on a windows machine deletepackage-lock.json
prior to running the below command. -
Create a
.env
file in the root directory. The file will contain following keys, ask @mikahpinegar for the values of the keys.VITE_API_AUTH0_DOMAIN=<auth0 domain> VITE_API_AUTH0_CLIENT_ID=<auth0 client id> VITE_API_AUTH0_AUDIENCE=<auth0 audience> VITE_API_USER_HISTORY_API_URL=<user history url> VITE_API_USER_HISTORY_SCHEMA=<schema> VITE_API_RELEASE_NOTES_URL=<release notes url> VITE_API_MAPBOX_TOKEN=<mapbox token>
-
After the dependencies have been installed and the .env file has been created, run
npm start
to run the code locally.
src/
├── components # Re-usable components
├── features # Redux slice logic
├── pages # Core pages
├── shared # Constant data, theme and utility functions
Generally for the core pages, we have comments that specify the section of the page as such:
//////////////////////////////////////////////////////////
// Imports // # Imports
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// Redux // # Redux logic
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// State Logic // # Core logic
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// useEffect // # useEffect
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// Render // # Render
//////////////////////////////////////////////////////////
Symptom:
After running npm install
you might run into an Error E404 - Not Found - GET https://registry.npmjs.org/@psa%2fdst.ui.map - Not found
Solution: Follow these steps:
- Install the
react-scripts
package usingnpm install react-scripts --save
- Run
npm start
Line Spacing Set Line spacing (CRLF -> LF)
git config core.autocrlf false
git rm --cached -r .
git reset --hard