Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Small React project to make it easy to visualize possible upcoming staffing scenarios and plan for multiple possible futures at once

Notifications You must be signed in to change notification settings

madeintandem/staffing-strategy

Repository files navigation

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

  • DayJS: Since Moment is no longer recommended, using an alternative date library in both the client and server

Client dependencies

Server dependencies

  • forecast-promise - Forecast doesn't have a supported API so we're using a small (unsupported) Node package which wraps Forecast and provides a slim API for us to use
  • axios - For making http requests from the Node server
  • jsonwebtoken - For managing JWT in auth flow
  • google-auth-library - For Google OAuth on the server

Helpful examples or links that pointed me in the right direction

Auth flow

Node

About

Small React project to make it easy to visualize possible upcoming staffing scenarios and plan for multiple possible futures at once

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published