-
Notifications
You must be signed in to change notification settings - Fork 9
DRAFT: Windows Setup
Stephen Carroll edited this page Mar 1, 2022
·
4 revisions
This guide contains steps to run the app locally for Windows users.
- Before downloading the source code, run the following commands:
git config core.eol lf
git config core.autocrlf input
- Navigate to local destination directory.
- Clone the repo -
> git clone https://github.com/CodeForPhilly/paws-data-pipeline
- The above
> git config
commands should configure git to change line endings from CRLF to LF in theclone
process, but to avoid trouble, double check that the following files have LF line endings:
src/server/bin/startServer.sh
src/server/bin/export_secrets.sh
src/server/secrets_dict.py
See this gif for how to check line endings and change them, if necessary, in VSC.
- Run the Docker Desktop client locally
- Navigate to
../paws-data-pipeline/src
- Build the container (do this every time you make a change to the code):
> docker-compose build
- Run the container:
> docker-compose up
The client should now be accessible at http://localhost:80
.
Note - Changes made to the image files require removing volumes and rebuilding the container:
> docker-compose down-v
> docker-compose build
-
> docker-compose up
- Windows requires different syntax for setting environment variables. As a result, the
package.json
file must be changed.
In /src/client/package
, change:
"scripts": {
"start": "IS_LOCAL=false react-scripts start",
"start:local": "IS_LOCAL=true react-scripts start",
...
}
to
"scripts": {
"start": "set IS_LOCAL=false && react-scripts start",
"start:local": "set IS_LOCAL=true && react-scripts start",
...
}
- Navigate to
../paws-data-pipeline/src/client
- Install dependencies locally -
> npm install
- Run the client -
> npm run start
The client should now be accessible at http://localhost:3000
.
The Docker container should expose an endpoint that the local client can access. You can test this in a browser while the container is running by navigating to http://localhost:5000/api/user/test
. If you do not see "OK from User Test @ ..."
, see troubleshooting.