sfbrigade / bats-server

Routed is an app to help ambulances direct non-critical patients to hospital emergency rooms with the most availability.
https://routedapp.org/
GNU Affero General Public License v3.0
18 stars 12 forks source link

Move server source files into `server/` directory #173

Closed fwextensions closed 2 years ago

fwextensions commented 2 years ago

Move theme/ into src/ and move the following directories into server/:

Also update all the paths that reference these locations, mostly in app.js and .sequelizerc.

Ideally, src/ and public/ could get moved into a client/ folder, so it would be parallel to server/. But that seems to require either ejecting from CRA or using something like craco to specify a different src folder.

francisli commented 2 years ago

I went ahead and moved the tests folder into server as well, since that was back-end specific anyway. CRA expects client-side tests to just be side-by-side with components in the client source (and we haven't been doing any client component tests as of yet).

francisli commented 2 years ago

I don't think we need to eject the React app to move it into a separate client dir. Rather, if we were going to do that, I think we'd separate package.json into two separate package.json files in client and server, so each have their own dependencies (which is probably better than mixing them up as they are now). And then we'd just change the working directory into client to run CRA scripts, and into server to run back-end scripts.

Do you think it's worth it to do that work? Or is this enough of a clean-up win to just merge in first and put separating out the client into a TODO?

fwextensions commented 2 years ago

To me, this seems like a useful stepping stone, as it cleans up the top-level a lot and validates that everything still works with new paths.

Turning this into a monorepo seems like a sensible next step, though how to do that isn't something I'm familiar with.

fwextensions commented 2 years ago

Closing in favor of #177.