diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 81749a4..579a924 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,50 +4,46 @@ about: Create a report to help us improve labels: 'kind/bug' --- +# Bug report + -Current Behavior ----------------- +## Current Behavior + +## Expected Behavior -Expected Behavior ------------------ +## Possible Solution -Possible Solution ------------------ +## Steps to Reproduce -Steps to Reproduce ------------------- -1. -2. -3. +1. 2. 3. + +## Context -Context -------- +## Your Environment -Your Environment ----------------- -``` + +```bash (replace the example bellow with the script output) Last commit: 583bc87 Fix configuration issue diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index a7400dc..c17d4b3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,20 +4,20 @@ about: Suggest an idea for this project labels: 'kind/feature' --- +# Feature request + -Current Behavior ----------------- +## Current Behavior + +## Expected Behavior -Expected Behavior ------------------ +## Possible Solution -Possible Solution ------------------ -Problem -------- - +## Problem + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5b82f89..dc86f58 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,7 @@ -Types of changes ----------------- +# Pull request + +## Types of changes + - - +## Checklist -Checklist: ----------- + Fixes: PeopleForBikes/PeopleForBikes.github.io# diff --git a/config.toml b/config.toml index a3a1487..fc79442 100644 --- a/config.toml +++ b/config.toml @@ -8,7 +8,7 @@ compile_sass = true build_search_index = true theme = "juice" -title = "PeopleForBikes Tech" +title = "BNA Mechanics" [markdown] # Whether to do syntax highlighting @@ -18,7 +18,7 @@ highlight_theme = "inspired-github" [extra] # Put all your custom variables here -juice_logo_name = "PeopleForBikes Tech" +juice_logo_name = "BNA Mechanics" juice_logo_path = "logo_pfb.svg" juice_extra_menu = [ { title = "Github ↗", link = "https://github.com/PeopleForBikes" } diff --git a/content/_index.md b/content/_index.md index af48253..9ffb260 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,24 +1,37 @@ +++ -title = "PeopleForBikes Tech" +title = "BNA Mechanics" sort_by = "weight" +++ # Overview -**[PeopleForBikes](https://www.peopleforbikes.org/)** is an industry coalition -made up of 280 cycling-industry members and a cycling community of almost 1.4 -million individual riders to promote stronger representation in congress and -coordinated advocacy programs and help develop and promote economic policies -that benefit bike businesses. +**[PeopleForBikes]** is a national bike advocacy organization and trade group +for the bike industry working to make bicycling safe, convenient, and fun for +people of all ages and abilities. The [Bicycle Network Analysis], a.k.a. the +BNA, is open source software that assesses the quality and connectivity of bike +networks in cities. The [BNA] is an integral part of PeopleForBikes’ [City +Ratings] program, which measures progress towards building great cities for +bikes, shares best practices, and engages more people in bike advocacy. -**PeopleForBikes Tech** is PFB's technical arm. We aim to simplify and automate -tasks to help our advocates focus on what they do best: get more people riding -bikes more often, and make bike riding better for everyone. +**BNA Mechanics** is the technical group developing the [BNA]. We aim to +simplify and automate tasks to help our advocates focus on what they do best: +get more people riding bikes more often, and make bike riding better for +everyone. Our projects: -- [retrieve](https://github.com/PeopleForBikes/retrieve): Simplify downloading - PeopleForBikes dataset -- [svggloo](https://github.com/PeopleForBikes/svggloo): Render SVG templates -- [measure](https://github.com/PeopleForBikes/measure): Quantify and identify - bike lanes in cities +- [brokenspoke]: A collection of tools for the BNA +- [brokenspoke-analyzer]: Run Bicycle Network Analysis locally +- [measure]: Quantify and identify bike lanes in cities +- [scorecards]: Retrieve the BNA scorecards for your country + +And more to come! + +[bicycle network analysis]: https://bna.peopleforbikes.org/ +[bna]: https://bna.peopleforbikes.org/ +[brokenspoke]: https://peopleforbikes.github.io/brokenspoke/ +[brokenspoke-analyzer]: https://peopleforbikes.github.io/brokenspoke-analyzer/ +[city ratings]: https://cityratings.peopleforbikes.org/ +[measure]: https://github.com/PeopleForBikes/measure +[peopleforbikes]: https://www.peopleforbikes.org/ +[scorecards]: https://peopleforbikes.github.io/scorecards/ diff --git a/content/language-tooling-guidelines.md b/content/language-tooling-guidelines.md index 388e2ed..e7435fc 100644 --- a/content/language-tooling-guidelines.md +++ b/content/language-tooling-guidelines.md @@ -42,12 +42,13 @@ recent years: Like dependencies, we try to reduce the amount of general-purpose programming languages we use for [PeopleForBikes] projects, therefore we decided to only -adopt [Rust] and [Python]. +adopt Javascript, [Rust] and [Python]. They are respectively used for the following use cases: -- Projects dealing with data science must be written in Python. -- All other projects must be written in Rust. +- Web projects must be written in Javascript +- Projects dealing with data science or GIS must be written in [Python]. +- All other projects must be written in [Rust]. ## General Concepts @@ -89,10 +90,35 @@ poetry config virtualenvs.in-project true --local Describes special sections to add to the `pyproject.toml` configuration file. +#### coverage + +Leaves some files out the measurements. + +```toml +[tool.coverage.run] +omit = ["*/__init__.py"] +``` + +#### isort + +Enables the compatibility with `black` while shaping the import as a grid where +each import has its own line. + ```toml [tool.isort] profile = "black" -force_single_line = "true" +force_grid_wrap = 2 +``` + +#### pytest + +Removes the warnings, configures the code coverage report and run the doctests +with [xdoctest]. + +```toml +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "-p no:warnings --cov-report term-missing --cov-report html --xdoctest" ``` ### Initialization @@ -100,7 +126,7 @@ force_single_line = "true" To quickly start a project, run the following commands: ```bash -POETRY_PROJECT=my-project +export POETRY_PROJECT=my-project poetry new ${POETRY_PROJECT} cd ${POETRY_PROJECT} poetry add -D \ @@ -133,6 +159,7 @@ poetry add -D \ - [alive-progress]: progress reporting - [loguru]: logging made (stupidly) simple - [pydantic]: models, settings and automated serialization/deserialization +- [rich]: rich text and beautiful formatting in the terminal - [tenacity]: advanced retry library - [typer]: CLI made easy @@ -162,6 +189,7 @@ poetry add -D \ tests) - [pytest-socket]: prevents all network call from the tests - [pytest-xdist]: run the unit tests in parallel +- [xdoctest]: better doctest ## Markdown @@ -194,6 +222,111 @@ poetry add -D \ - [just]: General purpose task runner +## Web + +Web project must be built with [React], [Next.js] and [Tailwind CSS]. + +### Initialization + +To quickly start a project, run the following commands: + +```bash +export WEB_PROJECT=my-project +npx create-next-app ${WEB_PROJECT} +cd ${WEB_PROJECT} +npm install -D tailwindcss postcss autoprefixer +npx tailwindcss init -p +``` + +Go through the next sections to configure [Tailwind CSS] correctly. + +#### tailwind.config.js + +We extend the existing [Tailwind CSS] theme with the PFB fonts and colors: + +```js +// tailwind.config.js + +module.exports = { + content: [ + "./pages/**/*.{js,ts,jsx,tsx}", + "./components/**/*.{js,ts,jsx,tsx}", + ], + theme: { + fontFamily: { + sans: ["Montserrat", "sans-serif"], + dharma": ["Dharma Gothic E"], + }, + extend: { + colors: { + "pfb-deep-navy": "#00263E", + "pfb-bright-cyan": "#009EDB", + "pfb-bright-red": "#D71920", + "pfb-coal": "#4D4D4F", + "pfb-gray": "#8B8A8D", + }, + }, + }, + plugins: [], +}; +``` + +#### Custom fonts + +PFB uses some custom private fonts that require some setup in order to be used. + +First, copy the font files into the `public/fonts` folder of the web project. +The font are available in the +[Brokenspoke repository](https://github.com/PeopleForBikes/brokenspoke/tree/main/assets/fonts/DharmaGothicExtended). + +The folders should look like this: + +```bash +public +├── fonts +│   ├── Dharma Type - DharmaGothicE-Bold.otf +│   └── Dharma Type - DharmaGothicE-Light.otf +``` + +Add the new `font-faces` to `styles/globals.css`: + +```css +// styles/globals.css + +@font-face { + font-family: "Dharma Gothic E"; + src: url("../public/fonts/Dharma Type - DharmaGothicE-ExBold.otf") format("opentype"); +} + +@font-face { + font-family: "Dharma Gothic E"; + src: url("../public/fonts/Dharma Type - DharmaGothicE-ExLight.otf") format("opentype"); +} +``` + +A new custom font family is now available using the [Tailwind CSS] class +`font-dharma`. + +### Component Collections + +Here are the components collection that have been selected by the team: + +- +- +- +- +- +- +- +- +- +- +- + +### Helpers + +- + [alive-progress]: https://github.com/rsalmei/alive-progress @@ -210,6 +343,7 @@ poetry add -D \ [loguru]: https://github.com/Delgan/loguru [markdownlint]: https://github.com/DavidAnson/markdownlint [myst-parser]: https://myst-parser.readthedocs.io/en/latest/ +[next.js]: https://nextjs.org [poetry]: https://python-poetry.org/ [pydantic]: https://pydantic-docs.helpmanual.io/ [pydocstyle]: https://www.pydocstyle.org/en/stable/ @@ -219,8 +353,10 @@ poetry add -D \ [pytest-rerunfailures]: https://github.com/pytest-dev/pytest-rerunfailures [pytest-socket]: https://github.com/miketheman/pytest-socket [pytest-xdist]: https://github.com/pytest-dev/pytest-xdist -[pytest]: https://docs.pytest.org/en/latest/ +[pytest]: https://docs.pytest.org/en/latest +[react]: https://reactjs.org/ [reqwest]: https://github.com/seanmonstar/reqwest +[rich]: https://github.com/Textualize/rich [seaorm]: https://www.sea-ql.org/SeaORM/ [serde]: https://serde.rs/ [shellcheck]: https://github.com/koalaman/shellcheck @@ -229,10 +365,12 @@ poetry add -D \ [sphinx-copybutton]: https://github.com/executablebooks/sphinx-copybutton [sphinx]: https://www.sphinx-doc.org/en/master/ [sqlfluff]: https://docs.sqlfluff.com/en/stable/index.html +[tailwind css]: https://tailwindcss.com/ [tenacity]: https://tenacity.readthedocs.io/en/latest/ [tracing.rs]: https://tracing.rs/tracing/ [tokio]: https://tokio.rs/ [typer]: https://typer.tiangolo.com/ +[xdoctest]: https://github.com/Erotemic/xdoctest diff --git a/content/project-standards.md b/content/project-standards.md index 33f3150..1a19d43 100644 --- a/content/project-standards.md +++ b/content/project-standards.md @@ -113,7 +113,7 @@ rsync -vrlp --exclude '.git' "${DOT_GITHUB_TMP}" . Then apply the labels with [labelr](https://github.com/rgreinho/labelr-rs): ```bash -labelr --organization PeopleForBikes --sync .github/labels +labelr --organization PeopleForBikes --sync .github/labels.yml ``` And finally submit the changes: diff --git a/pfb-words.txt b/pfb-words.txt index 0d7d296..d926bfc 100644 --- a/pfb-words.txt +++ b/pfb-words.txt @@ -1,15 +1,21 @@ # PeopleForBikes Words +addopts autobuild bpython +Brokenspoke codecov copybutton deserialization +doctest +doctests EDITMSG furo isort justfile labelr +minversion mktemp +opentype PFB's pydocstyle pylint @@ -19,6 +25,7 @@ rerunfailures scrapd socio svggloo +tailwindcss timeframe virtualenvs vrlp diff --git a/templates/index.html b/templates/index.html index e97033d..3157406 100644 --- a/templates/index.html +++ b/templates/index.html @@ -19,9 +19,9 @@ {% block hero %}
-

grok biking safety, nationwide

+

Building safe cities for bikes

- Technology that helps _____ + Technology that measures progress and shares data