You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+94-30Lines changed: 94 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,64 +6,128 @@ The Pittsburgh Lenten Fish Fry Map is the brainchild of Hollen Barmer, who has t
6
6
7
7
The raw data isn't here! That is by design. The map gets data from the Fish Fry API @ [fishfry.codeforpgh.com/api/fishfries](http://fishfry.codeforpgh.com/api/fishfries). Anyone can use that URL to get data to make their own fish fry map, or do things with the Fish Fry data that we haven't thought of. If you want to learn more about the database and API, head over to the [Fish Fry Form](https://github.com/CodeForPittsburgh/fishfryform) repository.
8
8
9
-
Occassional snapshots of the data from are being dumped into the `data`folder of this repo, but only for posterity.
9
+
Occassional snapshots of the data are kept in `public/data`for local fallback and posterity.
10
10
11
-
## Development
12
-
13
-
This is a static web site. We're serving it up with GitHub pages, but it can run on any web server as-is, really.
11
+
## Developer Quickstart
14
12
15
13
### Prerequisites
16
14
17
-
To develop this, you have [NodeJS](https://nodejs.org/en/) installed, such that you can call `node` and `npm` from the command line.
This will use the `package.json` file to get and install NodeJS dependencies locally, in a `node_modules` folder.
52
+
```bash
53
+
npm run test:unit
54
+
```
24
55
25
-
You will also need these things (available on [NPM](https://www.npmjs.com)):
56
+
Playwright parity tests (first-time setup):
26
57
27
-
*[GulpJS](https://www.npmjs.com/package/gulp), with `gulp` callable from the command line. Install with `npm install gulp@4.0 -g`
28
-
*[Http-Server](https://www.npmjs.com/package/http-server), with `http-server` callable from the command line. Install with: `npm install http-server -g`
58
+
```bash
59
+
npx playwright install --with-deps chromium
60
+
npm run test:parity
61
+
```
29
62
30
-
Those two things need to be available globally. the `-g` flag in those commands makes sure of that.
63
+
Run all tests:
31
64
32
-
### Building and Watching
65
+
```bash
66
+
npm test
67
+
```
33
68
34
-
GulpJS is a task-runner that compiles and bundles source code from `src` folder into the `assets` folder. Since the deployment path for this is GitHub pages, we put things into the `assets` folder, which is where Jekyll, the software that runs GitHub pages, expects those things to be.
69
+
### 5) Build and preview production bundle
35
70
36
-
We run those tasks with `npm` scripts.
71
+
```bash
72
+
npm run build
73
+
npm run preview
74
+
```
37
75
38
-
Running `npm run build`will compile and bundle the source code one time.
76
+
`npm run build`outputs to `dist/`.
39
77
40
-
Running `npm run dev` will do that, plus run `http-server`, open the site in a web browser at [http://localhost:3000](http://localhost:3000), and, upon detecting changes to files in `src`, re-runs compiling/bundling and refreshes your browser. Nice!
78
+
## Scripts
41
79
42
-
If the site doesn't load after `pnpm run dev`, check [http://localhost:4000](http://localhost:4000) in your browser. This is where `http-server` lives. If you don't see anything there, make sure you can run `http-server` from the command line (see **prerequisites** above).
80
+
-`npm run dev` starts Vite dev server
81
+
-`npm run build` builds production bundle
82
+
-`npm run preview` serves the production bundle
83
+
-`npm run test:unit` runs Vitest unit tests
84
+
-`npm run test:parity` runs Playwright parity tests
85
+
-`npm test` runs both suites
43
86
44
-
### Where the functionality lives / where you can hack on the code
87
+
##Project Layout
45
88
46
-
Most of the work is happening in `src/js/app.js`. The rest happens in `index.html`.
89
+
-`src/` app source code
90
+
-`src/features/` UI and map features
91
+
-`src/store/` Redux Toolkit slices and APIs
92
+
-`src/domain/` shared business logic (filters, date logic, normalization)
93
+
-`src/styles/` app styles and theme overrides
94
+
-`public/data/fishfrymap.geojson` fallback dataset used when API is unavailable
47
95
48
-
> TODO: the source code for this app is a bit of a mess...the result of quick prototyping.
96
+
## Theming
49
97
50
-
### Deploying this Site
98
+
- Base theme: `bootswatch/dist/darkly/bootstrap.min.css` (imported in `src/main.jsx`)
Run `npm run build` and deploy the generated `dist/` assets.
53
121
54
122
## Credits
55
123
56
124
The Fish Fry Map is built and maintained by members of Code for Pittsburgh.
57
125
58
-
It started with <ahref='https://github.com/bmcbride/bootleaf'>Bootleaf</a> (which we've adapted it and modified heavily for this project), and uses <ahref="http://getbootstrap.com/">Bootstrap 3</a>, <ahref="http://leafletjs.com/"target="_blank">Leaflet</a>, and <ahref="http://twitter.github.io/typeahead.js/"target="_blank">typeahead.js</a>, among other things.
***Black n' Gold** basemap: Map tiles from <ahref="http://stamen.com">Stamen Design</a>, under <ahref="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> license. Basemap data by <ahref="http://openstreetmap.org">OpenStreetMap</a>, under <ahref="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a> license.
-**Black n' Gold** basemap: Map tiles from <ahref="http://stamen.com">Stamen Design</a>, under <ahref="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> license. Basemap data by <ahref="http://openstreetmap.org">OpenStreetMap</a>, under <ahref="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a> license.
0 commit comments