Skip to content

precision-sustainable-ag/dst-seedcalc

Repository files navigation

PSA

DST Seeding Rate Calculator

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

Table of Contents

Contributing

Technologies

The technologies we are currently using in this repo:

  • React: Front-end Reat app
  • Redux: State management
  • Material UI: UI Library

First time setup

  1. The first step is downloading the code by cloning the repository:

    git clone https://github.com/precision-sustainable-ag/dst-seedcalc.git
  2. Then run npm config set @psa:registry https://node.bit.cloud

  3. 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 delete package-lock.json prior to running the below command.

  4. 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>
    
  5. After the dependencies have been installed and the .env file has been created, run npm start to run the code locally.

Folder structure

src/
├── components        # Re-usable components
├── features          # Redux slice logic
├── pages             # Core pages
├── shared            # Constant data, theme and utility functions

File structure

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
//////////////////////////////////////////////////////////

Runbook

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:

  1. Install the react-scripts package using npm install react-scripts --save
  2. Run npm start

Line Spacing Set Line spacing (CRLF -> LF)

git config core.autocrlf false
git rm --cached -r .
git reset --hard

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages