byronrthomas / free-helpie-main

Coordination area for projects across multiple repos and scripts, docs etc about infra
Apache License 2.0
0 stars 0 forks source link

Initial back-end in Node express #1

Open byronrthomas opened 6 years ago

byronrthomas commented 6 years ago

Plan is to extract out existing in-memory server into it's own process from free-helpie-frontend codebase. Have the server end-to-end tests in https://github.com/byronrthomas/free-helpie-frontend that can check the server is working. Plan will be:

  1. Start a node project and clone all of the existing code into it, set up the routes etc
  2. Make server implementation in front-end using axios to call real server
  3. Get front-end server e2e tests working with the back-end running locally
  4. Pull out e2e tests into server side, and ensure front-end codebase clean a. This includes extracting out all of the server-side unit tests into node unit tests
  5. Also think about how to structure the back-end versus static serving of the front-end code
byronrthomas commented 6 years ago

Slight change of plan due to not wanting to put any effort into something that isn't moving in the correct direction for client-server interaction. I want to start relying on cookies to carry the session tokens which is more like the long term direction. However, this makes the e2e server tests a bit trickier, and I've decided to just extract them up front (provided I can do this feasibly). So the plan next is:

  1. Try to run some e2e server tests using jest but outside the frontend project (and probably running backend independently if feasible, because long term the backend won't be javascript).
  2. Experiment with logging out the cookie contents on server side and test side, and trying to use axios interceptors to add the cookie info onto the requests when in testing mode