Spaces:
Sleeping
Development
The stable branch for the IFRC GO application is develop. All PRs intended for deployment should be merged into the develop branch.
Prerequisites
To begin, ensure you have network access. Then, you'll need the following
Make sure the correct versions of pnpm and Node.js are installed. They are specified under
enginessection inpackage.jsonfile.
Local development
Clone the repository using HTTPS, SSH, or Github CLI
git clone https://github.com/IFRCGo/go-web-app.git #HTTPS git clone git@github.com:IFRCGo/go-web-app.git #SSH gh repo clone IFRCGo/go-web-app #Github CLIInstall the dependencies
pnpm installCreate a
.envfile in theappdirectory and add variables from env.ts. Any variables marked with.optional()are not mandatory for setup and can be skipped.cd app touch .envStart the development server:
pnpm start:app
To work on a specific development task, ensure you have the backend setup appropriately and configured properly.
Create a new branch for your work. The stable branch for IFRC GO is
develop, and all PRs for deployment should be merged into it.git checkout -b name-of-your-branchCreate branches using the following convention
- Project Branch: For long-running features, create branches under
project/project-x. - Feature Branch: For small features, create branches under
feature/feature-name. - Fix Branch: For bug fixes, create branches under
fix/issue-description. - Chore Branch: For maintenance tasks, create branches under
chore/task-name.
- Project Branch: For long-running features, create branches under
Once you're happy with your changes, add and commit them to your branch.If your workflow requires changesets (e.g., when changes will impact versioning or are part of a release), create one before committing. Then push the branch to origin.
# Stage all changes git add . # Create a changeset (if changes will affect versioning, like new features or bug fixes) pnpm changeset # Commit your changes with a message git commit -m "some message" # Push your branch to origin git push -u origin name-of-your-branch
Ensure no lint errors before pushing. Use clear, concise commit messages that summarize the changes, avoiding vague or generic descriptions.
Review the Changesets documentation and the versioning guidelines for more details on versioning and tracking changes.
- Create a Pull Request. Please read the Issues and Pull Requests guide for further information.
Before committing and opening a Pull Request, please ensure there are no lint errors. Also please create a pull request only when the feature is ready to be merged.
CLI Commands
This repository contains several scripts and commands for performing tasks. The most relevant ones are described below.
Commands for Running & Building the Web Application
pnpm start:appruns the Local Development Server, listening by default onhttp://localhost:3000/.pnpm buildbuilds the Application in Production mode. The output is by default within thebuildfolder.- This is used for Deployments (Preview & Production).
pnpm previewpreviews the production build of the Application.pnpm generate:typegenerates the Typescript types for the API usingopenapi-typescript. The output is by default within thegeneratedfolder within theappworkspace.pnpm storybookstarts Storybook's local server for the@ifrc-go/uicomponents library, listening by default onhttp://localhost:6006/.pnpm build-storybookbuilds Storybook as a static web application for publishing.pnpm build:uibuilds the@ifrc-go/uicomponents library. To reflect any new changes in the components library we must ensure that it is built beforehand.
Commands for Maintenance Tasks
pnpm lintruns the linter for all the css, js, ts, and translation files.pnpm lint:fixattempts to fix any linting errors for css, js and ts files.pnpm translatte:generategenerates translation migration file.pnpm lint:unusedfinds unused files, dependencies, and exports.
IFRC GO UI Components Library
Please read the README and CONTRIBUTING guide for IFRC GO UI.
IFRC GO UI Storybook
Please read the README and CONTRIBUTING guide.