Code behind the PHLASK Web Map
.
├── Dockerfile <-- Dockerfile defining container for local dev and deploy
├── README.md
├── _phlask.code-workspace
├── assets
├── contributing.md
├── cypress <-- Unit tests
│ ├── fixtures <-- Fixtures for mocked out data
│ └── integration <-- Source files for unit tests
├── cypress.json
├── docker compose.yml
├── package-lock.json
├── package.json
├── public
├── src <-- Source files for project
│ ├── App.js
│ ├── actions <-- Source for all Redux actions
│ ├── components <-- Source for all React components
│ ├── firebase <-- Source for configurations used to connect to Firebase database
│ ├── helpers <-- Helper functions shared across components/pages
│ ├── hooks <-- Custom hooks
│ ├── reducers <-- Redux reducers
│ ├── selectors <-- Source for all Redux selectors
│ └── theme.js <-- Theme file for Material UI
├── yarn-error.log
└── yarn.lock
GitHub Codespaces provides you with a remote development environment without needing to install anything locally. You can also connect to your Codespace from VSCode, if desired. A default codespace configuration in the .devcontainer/devcontainer.json
file has been prepared that will ensure your codespace has everything needed to run PHLASK. Once the codespace has started, you should be able to use the Terminal window in the bottom to run yarn start
. That will load a local development copy of the PHLASK site for you to test with.
To learn more about Codespaces, review this page: https://github.com/features/codespaces
As of this writing, PHLASK does not fund these codespaces. However, GitHub offers up to 60 hours/month of free use for codespaces. For more details on Codespace pricing, review this page: https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts
Note that core hours per month
means each core on your codespace consumes independent hours from your code hour limit. If you choose a 2-core space (sufficient for PHLASK), you use 2 core-hours every hour from the free core hours per month
allowance.
nvm install
<- this will download the required verison (only required on the first installation)nvm use
sets that to the active version of node in your terminalyarn install
yarn start
Download Docker Desktop
Open up a terminal (Powershell on Windows, Terminal on Mac, bash on Linux, or whatever your preferred terminal is)
Confirm Docker Desktop installed successful: docker --version
Expected output:
$ docker --version
# something similar to below should be printed out
# older versions of Docker OK
Docker version x.y.z, build xxx
Clone this repo: git clone git@github.com:phlask/phlask-map.git
Navigate to the root of the cloned repo: cd phlask-map
Build the container with docker compose: docker compose build app
.
Note: this may take awhile. In the past this has taken ~5 minutes. If this step takes longer than 10 minutes, kill the process and try again. Final output should look like this:
[+] Building 238.2s (12/12) FINISHED
...
=> => writing image sha256:c98c...
Run the container with docker compose: docker compose up app
Note: this may take awhile. Once the application is up, output similar to this should be printed out to the console:
Beta site https://beta.phlask.me/
Project is running at http://172.21.112.1/
...
Starting the development server...
Navigate to localhost:3000 on your browser.
We use Prettier to ensure a consistent code formatting across the project, if you are running VSCode, please make sure to install the Prettier extension, the project configuration will ensure that Prettier is set as your default formatter as well.
During development, you may need to make changes to components which interact with Redux state. If you would like to have a better idea of the values in the Redux state while in development, install the Redux DevTools using the instructions here: https://github.com/reduxjs/redux-devtools/tree/main/extension#installation
For a guide on how to use the extension check the Docs section of their documentation. This video in particular may be useful: https://egghead.io/lessons/javascript-getting-started-with-redux-dev-tools
For more information on how to understand/use the PHLASK Map Redux state, see our Redux Guide
We use Storybook for documentation and testing of the PHLask components and design system.
You can run yarn storybook
in order to access it.
We highly recommend for any new collaborators to access Storybook in order to get more familiar with our components and how to use them.
See our Contribution Guide to learn about our branching strategy and issue reporting etiquette, and more!
The technical goals for this project are:
The PHLASK Map runs on a static page built with:
This project uses Cypress for testing.
This project has been configed to run all tests in the cypress/integration
directory. To run these tests:
cd
into the root (top-level) directory of the projectyarn install
or npm install
yarn test
TBD - This has not yet been tested.
Please refer to the cypress.json
file for testing configurations.
Tests follow the convention of being placed in a <test-file-name>.spec.js
file where <test-file-name>
is descriptive of the features/functionality the file tests for. Example, water-tap-viewing.spec.js
tests feature related to viewing taps and the information displayed on the web page.
To add new tests, create a *.spec.js
file at the top level of /cypress/integration
.
Refer to /cypress/integration/example
for the kinds of things cypress can test for -- NOTE the *.spec.js
files are configured to not run when running npm run test
.
The site runs on: