Skip to content

DRAFT: Windows Setup

Cris Simpson edited this page Feb 22, 2022 · 4 revisions

Windows Setup

Overview

​ This guide contains steps to run the app locally for Windows users. ​

Configure git to handle line ending issues

  • Before downloading the source code, run the following commands:
git config core.eol lf
git config core.autocrlf input

Download the source code

  • Navigate to local destination directory.
  • Clone the repo - $ git clone https://github.com/CodeForPhilly/paws-data-pipeline

Confirm correct line endings

  • The above $ git config commands should configure git to change line endings from CRLF to LF in the clone 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 (_review 1) here for how to check line endings and change them, if necessary, in VSC. ​

Run the Docker container

  • Run the Docker Desktop client locally
  • Navigate to .../paws-data-pipeline/src
  • Build the container: $ docker-compose build
  • Run the container: $ docker-compose up
  • The client should now be accessible at http://localhost:80 ​ Note - Changes made to the (_review 3) [resource files?] require removing volumes and rebuilding the container:
  • $ docker-compose down-v
  • $ docker-compose build
  • $ docker-compose up

Running the frontend

Configure package.json

  • bash in 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",
  ...
}

Run the local client

  • 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

Accessing the Docker API from the local client

While the Docker container is running, the API should be accessible to the local client. You can test this by going to http://localhost:5000/api/user/test. If you see "OK from User Test @ ...", the client is successfully accessing the Docker API. If not, see troubleshooting.

Clone this wiki locally