Version 2 of this project is key to improving the previous website so that consumers can have a better information-gathering experience. In order to create this website, there are other different github projects that are responsible for their own thing and generate artifacts used by this project.
- You must have
npm
installed on your machine. Runsudo npm install -g npm
on Linux or Mac to installnpm
. To learn more, follownpm documentation
.
- You must have
Nodejs 18.0.0 above
installed on your machine. To install the latest version of Nodejs follow this linknodejs documentation
.
git clone https://github.com/forkfacts/forkfacts-v2
Note - Do you use multiple Github SSH Keys locally?
Before you run the git clone
command, please do not forget the following steps:
- Update the github domain in your
git clone command
. For example, based on your~/.ssh/config
, your clone command may be
git clone https://github.com/forkfacts/forkfacts-v2
. - Ensure that your SSH keys are available to your SSH Agent running locally.
- Run
ssh-add -l
to see if keys are listed in the output. If not, follow the next step. - Run
ssh-add ~/.ssh/<path_of_your_ssh_private_key>
to add the keys for your SSH Agent. - Run
ssh-add -l
to see ensure your SSH keys are available to your SSH Agent.
- Run
cd forkfacts-v2 && npm install or npm i
- Run
npm run develop or npm start
to start gatsby project locally. It internally runsgatsby develop
command. Your project will start on http://localhost:8000
- Run
npm run build
to create production build. - Run
gatsby serve
to start production build locally. It will start project on http://localhost:9000/
To run the app on android studio or excode locally, you must ensure you have the env variable key that will be pointing at server.url in the capacitor.config.ts file is set for capacitor to be able to use it.
- Add the env GATSBY_APP_URL
- Run the development server using
npm run start:develop
- Run
npm run sync && npm run open:android for android
- Run
npm run sync && npm run open:ios for ios
To generate icons from SVG images downloaded from the project Figma design, use the following command:
npm run svgr
This will use the @svgr/cli package to generate TypeScript files for the SVG icons in the src/images/icons directory. The generated files will be placed in the src/DesignIcons directory. The --replace-attr-values '#000=currentColor' option replaces any #000 fill values with the currentColor value, which allows the icons to inherit the color of their parent element.
We are using a version of 6 weeks cycle. However, we may not always run for 6 weeks depending upon the time and bandwidth available. But we do run a cycle. We prioritize what we can do in a cycle, and create a milestone. All our milestones are available here.
We try to keep the name of milestone from the list of herbs available here
We are using GitFlow to release the project. The feature branches
are worked upon based on the sub branches
. The code reviews (PRs) are opened against develop
branch. Once a PR
is merged, it goes into the sub branches
branch.
From time to time, we open a PR from sub branches
to main
branch. Currently, we do not wait for a cycle to complete
in order to merge to main
. We prefer to merge to main
(hence a release) as soon as we are happy with the quality of work.
- You can Assign yourself an unassigned ticket from the list of
🥑 High
priority. - Create a feature branch based on latest
main
branch. We are using Semantic Release for automated releases. So, please refer to commit message format guidelines to indicate the nature of change. Read Github Docs on how to reference issues in commits and in pull requests. - The commit format is expected to look like this:
[your name]_[ticket id]_[task title]
. Example (git commit -m "ayomiku_#3efhet3_commit_your_change_task"
). - Early on (with your first commit push itself),then you can create a draft pull requests to ensure builds are running and there are no merge conflicts. This can save a lot of time in the integration later. Also, with each PR, chromatic builds are connected to generate updated storybook components. This can be of tremendous help during the code review.
- Once you are done with the work, assign your PR to a reviewer.
let element = document.getElementById('ff-page-[food-name-route(fish-pollock-raw)]');
let jsonData = JSON.parse(element.getAttribute('data-json'));
To run this project, you'll need to set up some environment variables. These variables are used to connect to various APIs and services used in the project.
-
Copy the contents of the
.env.sample
file to a new file called.env
using the following command:npm run build:env:dev
This command will copy all the keys and their default values from
.env.sample
to.env
and.env.development
. -
Open the
.env
and.env.development
files and replace the default values with the appropriate values for your local environment. -
Save the
.env
and.env.development
files.
With the environment variables set up, you're ready to run the project!
After you done that successfully, reach out to the project owner for the key values
- There should not be any errors on the console.
- No use of @ts-ignore in the .tsx files.
- No console.log allowed in the code except in the development mode when you are debugging an issue. No information should be displayed on the browser console.
- Do not include a blank or inactive file in the project.
“This project is tested with BrowserStack.”