madeintandem / staffing-strategy

Small React project to make it easy to visualize possible upcoming staffing scenarios and plan for multiple possible futures at once
https://tandem-staffing.herokuapp.com/
1 stars 2 forks source link

Staffing strategy

This is a small React project to make it easy to visualize possible upcoming staffing scenarios and plan for multiple possible futures at once.

It does not have a database (maybe a future enhancement?) and uses Airtable for quick and dirty data storage. This means you'll need to make sure that your Airtable set up has the same tables and coluumns that the code expects.

Project setup

This is a monorepo with a React app in the root and a Node Express server in the server directory.

We are using a single package.json to manage package dependencies for both applications. React dependences are in devDependencies since the React app is built and served by the Express app. Regular dependencies are for buildtime and the Node server.

nvm use
yarn install

Environment variables

Please check the corresponding .env.sample to make sure you have all values defined. Examples can be found in 1Password Tandem General vault. If you need to add env vars for the React app, be sure to prefix with REACT_APP_.

Secrets

The secret keys kept in your .env variables can be any string you want. The longer you make them, the more secure they are.

Getting your Forecast variables

To test your Forecast variables, you can run the following cUrl request

curl -i \
  -H 'Forecast-Account-Id: ACCOUNT-ID'\
  -H 'Authorization: Bearer ACCESS-TOKEN'\
  -H 'User-Agent: https://www.npmjs.com/package/forecast-promise' \
  "https://api.forecastapp.com/whoami"

Getting your Airtable variables

Getting your Google OAuth variables

Getting your Pipedrive variables

Running the app for development

This project uses concurrently to start the server and client at the same time. If either process fails, both will be terminated.

yarn start

To start the server and the client separately (for finer control and troubleshooting), you can run the following commands in separate terminal windows.

To start the client,

yarn start-client

To start the server,

yarn start-server

Deployment

Currently being deployed to the tandem-staffing Heroku application manually.

git push heroku main

Notable dependencies

Client dependencies

Server dependencies

Helpful examples or links that pointed me in the right direction

Auth flow

Node