Guidelines and principles of egov Frontend


Pre-requisites :

  • Prior knowledge of Javascript

  • Prior knowledge of React.js

  • Prior knowledge of CSS,HTML,JSON

  • Prior knowledge on G

 

  1. One should know how to create single-page React applications 

https://create-react-app.dev/docs/getting-started/

  1. Keep updated with the latest versions and hooks of React.

  1. The strong base on Javascript

ES5 and ES6 features.

  1. Basic knowledge of Cascading Style Sheet(CSS).

Including media query styles and pseudo-classes

 

Guidelines and Principles: 

 

  1. Clone the repository - https://github.com/egovernments/frontend

  2. Install the dependencies

  • sudo apt-get update

    • sudo apt-get install node.js (above version 10)

    • sudo apt-get install npm

    • apt install yarn

    • npm install --global lerna

    • npm run go  (frontend/web/rainmaker - path)

  1. Run Employee/Citizen app 

  • npm run dev:employee

    • npm run dev:citizen

  1. The modules inside

frontend/web/rainmaker/dev-packages are themselves a single-page application

  1. Change REACT_APP_DEFAULT_TENANT_ID=pb in .env file to respective tenant id.

/frontend/web/rainmaker/packages/citizen/.env or /frontend/web/rainmaker/packages/employee/.env

  1. The changes made in the module should be transpiled using the scripts written in 

/frontend/web/rainmaker/package.json.

Eg: npm run egov-tradelicence (if any changes made in egov-tradelicence-dev)

 


Debugging in browser: 

 

  1. Locate the file, apply breakpoints, and refresh the page. This triggers the breakpoint and waits for us to perform the next action.           

 

Git branching and guidelines: 

  • Identify the Jira ticket with the ticket ID.

  • Create a feature branch with Ticket ID as the branch name. ex: RAIN-1331 (either from master or develop depending on the above-mentioned use-cases).

  • Commit message format : <Ticket-ID : Ticket-description>

  • Unit testing performed in the dev environment with the feature branch

New Feature implementation -

  1. Use the ‘develop‘ branch to implement the latest releases/features.

  1. Merge master to the ‘develop’ branch frequently.

  • git merge master (code currently pointing to release branch)

  1. Push day-to-day changes or features to the ‘develop’ branch.

  • git push

  1. Merge the' develop' branch to master copy and raise the PR to master before every release cycle.

Previous release bugs -

  1. Fix the issues in the feature branch from the latest 'master'.

  2. Raise PR to ‘master’ after dev testing on the feature branch.

  3. Once merged to master, cherry-pick the commit id to 'develop' branch.

  4. Provide both master and develop branch builds to the QA team.

 

Do’s and Dont’s while working with egov UI

DO’s

  • Always take pull before doing any changes.

  • All the commits should be tagged with Jira Tickets - ID and description.

  • Frequently keep develop branch up-to-date with the master branch.

  • Resolve any conflicts before pushing to origin/branch.

  • Once any feature/issue is fixed, unit test must be done in the feature branch locally and then in the dev environment as a dev sign-off step.

  • Make sure while giving builds to the QA team, the corresponding Ticket ID is marked “DONE“.

  • Delete all the unused branches on a frequent basis.

DONT’s

  • Do not give random branch names and random commit messages.

  • Do not push the commits without resolving conflicts.

  • Do not just test locally without testing in the dev environment and give dev sign-off.

  • Do not move the ticket status to “DONE” unless its test in dev and builds are shared.

  • Do not merge code to master or develop branches without reviewing the code.

  • Do not push the changes unless the branch you working on is up-to-date with the remote branch.

  • Do not copy any codebase of any module and junk the folder with unused codes.