CodeForBoulder / upswyng

UpSwyng is a mobile-ready, digital directory of resources to assist the unhoused and at-risk communities of Boulder, CO
https://www.upswyng.org
MIT License
19 stars 21 forks source link

♻️ Local dev environment improvements #463

Closed jollyjerr closed 3 years ago

jollyjerr commented 3 years ago

This PR closes #460 and closes #441 (Except for the circular dependencies mentioned in #441 - I think we should make an additional ticket for those)

What does this PR do?

This PR makes many enhancements targeted at improving the developer experience of upswyng. Highlights:

  1. Our docker environment now stands up a local Redis instance, so the server will stop yelling that it cant connect to Redis. Currently, it's not really used locally, but now the worker service actually stands up so that is cool.
  2. Setting up the app locally can now all be done by running yarn start:local. This new script installs dependencies, builds local packages when needed, sets up .env files when needed, sets up a local database (with seeds) and redis instance when needed, and starts the server and web packages in development mode. Obviously, developers do not have to use this script, but it abstracts nearly the entire setup process for new engineers that just want to see the thing build and get started.
  3. Cleans up a lot of really small stuff that was making the server logs really noisy (unused CSS, depreciation warnings).
  4. I cleaned up our vscode settings and moved to an actual code workspace which I personally find really improves the experience of working with a monorepo like this. This change also makes it where vscode-jest actually works and is not yelling at you all the time ☺️ . I am happy to revert this change back to the old settings folders though - I know that a workspace can feel like a big change at first 😬 ! Let me know what you think @jacobvenable
  5. Cleaned up developer documentation for getting started. I also merged #439 and #438 and adapted them into this new setup.
  6. Fixed our cypress setup so now devs can run the full ci locally (see the testing section in the readme).
  7. Added a yarn reset command as an escape hatch that totally resets someone's local environment if things are just not working out.

How does this PR make you feel? :link:

jollyjerr commented 3 years ago

Hey, @jacobvenable I am going to make one more change to this before it should be merged. Right now we can't run the full test suite locally because cypress does not know how to work without being on the CI server - so I'm going to get that working and then this should be good to go ☺️ !

jollyjerr commented 3 years ago

@jacobvenable Okay now I think this is ready to go! ☺️

rhinodavid commented 3 years ago

Get it boys I'm so proud of uuu

cjlynch278 commented 3 years ago

Just thought I'd add that I tested this branch and it worked locally on my ubuntu environment. I was still getting those redis errors: [server] [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379 [server] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

I was able to click each of the apps and load the data within.

jollyjerr commented 3 years ago

Just thought I'd add that I tested this branch and it worked locally on my ubuntu environment. I was still getting those redis errors: [server] [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379 [server] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

I was able to click each of the apps and load the data within.

@cjlynch278 I'm glad it booted up for you! You got those redis errors because your .env was not up to date with what this branch needs. I might add a little logging to warn that you need to delete your .env files.. or perhaps I'll think of another solution.... hmmm I'll keep you posted!

Edit: I added a yarn reset script that totally cleans up your local environment so you can start from scratch if something obscure like this is giving you trouble!

jollyjerr commented 3 years ago

@jacobvenable

Screen Shot 2021-05-11 at 7 12 51 PM