Skip to content

Commit

Permalink
Created a baseline Frontend from Digit UI core for Ifix Dashboard (#160
Browse files Browse the repository at this point in the history
…) (#161)
  • Loading branch information
jagankumar-egov authored Jan 24, 2023
1 parent 5a986a2 commit aab8770
Show file tree
Hide file tree
Showing 575 changed files with 42,172 additions and 4 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ core/ @sathishp-eGov @GhanshyamRawat-eGov @rushang7-eGov
reference-adapter/ @sathishp-eGov @GhanshyamRawat-eGov @rushang7-eGov
domain-services/ @sathishp-eGov @GhanshyamRawat-eGov @rushang7-eGov
utilities/ @sathishp-eGov @rushang7-eGov
frontend/micro-ui/ @jagankumar-egov
6 changes: 3 additions & 3 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ config:
- work-dir: "reference-adapter/pspcl-ifix-adapter"
image-name: "pspcl-ifix-adapter"
dockerfile: "build/maven/Dockerfile"
- name: "builds/iFix/ui/micro-ui/digit-ui"
- name: "builds/iFix/frontend/digit-ui"
build:
- work-dir: ui/micro-ui/
- work-dir: frontend/micro-ui/
dockerfile: frontend/micro-ui/web/docker/Dockerfile
image-name: digit-ui
dockerfile: ui/micro-ui/web/docker/Dockerfile
34 changes: 34 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Starting with Digit-UI Internal Development (Engineering Team) - MICRO-UI
cd into /micro-ui/web/micro-ui-internals
In the project directory, you can run:
### `yarn install`
### `yarn run start:dev` or `yarn run sprint`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

# Starting with Digit-UI App (Impelmentation Teams) - MICRO-UI
cd into /micro-ui/web
In the project directory, you can run:
### `yarn install`
### `yarn run start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

#### Reference Docs
Topic | Reference Docs
------ | --------------
Architecture | https://digit-discuss.atlassian.net/wiki/spaces/DD/pages/1555956005/DIGIT-UI

###### Dependencies and their references
1. https://www.npmjs.com/package/react-query
2. https://react-redux.js.org/
3. https://react-hook-form.com/
4. https://www.npmjs.com/package/react-table
5. https://www.npmjs.com/package/react-time-picker
6. https://reactrouter.com/web/guides/quick-start
7. https://recharts.org/

#### License
These reference apps are released under MIT
32 changes: 32 additions & 0 deletions frontend/micro-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.env
.eslintcache

# yarn $
.yarn
yarn.lock
.yarnrc.yml

# dependencies
node_modules
.yarn
/.pnp
.pnp.js

# testing
/coverage

# production
/web/build
dist
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions frontend/micro-ui/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jagankumar-egov @sathishp-eGov
3 changes: 3 additions & 0 deletions frontend/micro-ui/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library 'ci-libs'

buildPipeline(configFile: './build/build-config.yml')
33 changes: 33 additions & 0 deletions frontend/micro-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Digit UI
DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://www.digit.org for more details.

This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries.

#### Starting local server
1. To run server locally first change directory to **web** subdirectory
1. In the project run **yarn install** to install node modules and dependencies
1. Run **yarn start** to start the local server

#### Updating modules
To update the modules run *install-dep.sh* script this will pull all the updates from *micro-ui-internals* subfolder

#### Reference Docs

###### Module wise reference docs
Module | Reference Docs
------ | --------------
PGR | https://digit-discuss.atlassian.net/wiki/spaces/EPE/pages/1285587062/PGR+UI+Implementation+-+Guidelines+FAQs
FSM | https://digit-discuss.atlassian.net/wiki/spaces/EPE/pages/1290567710/FSM+UI+Implementation+-+Guidelines+FAQs
DIGIT Services | https://digit-discuss.atlassian.net/wiki/spaces/DD/pages/647364616/DIGIT+Services

###### Dependencies and their references
1. https://www.npmjs.com/package/react-query
2. https://react-redux.js.org/
3. https://react-hook-form.com/
4. https://www.npmjs.com/package/react-table
5. https://www.npmjs.com/package/react-time-picker
6. https://reactrouter.com/web/guides/quick-start
7. https://recharts.org/

#### License
These reference apps are released under MIT
4 changes: 4 additions & 0 deletions frontend/micro-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "digit-ui",
"version": "1.0.0"
}
5 changes: 5 additions & 0 deletions frontend/micro-ui/web/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env","@babel/preset-react"
]
}
3 changes: 3 additions & 0 deletions frontend/micro-ui/web/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_STATE_LEVEL_TENANT_ID=pb
REACT_APP_PROXY_URL=https://works-dev.digit.org
25 changes: 25 additions & 0 deletions frontend/micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FROM egovio/alpine-node-builder-14:yarn AS build
FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0
ARG WORK_DIR
WORKDIR /app
ENV NODE_OPTIONS "--max-old-space-size=8168"

COPY ${WORK_DIR} .
RUN ls -lah

#RUN node web/envs.js
RUN cd web/ \
&& ./install-deps.sh \
&& yarn install \
&& yarn build

FROM nginx:mainline-alpine
#FROM ghcr.io/egovernments/nginx:mainline-alpine
ENV WORK_DIR=/var/web/digit-ui

RUN mkdir -p ${WORK_DIR}

COPY --from=build /app/web/build ${WORK_DIR}/
COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf
26 changes: 26 additions & 0 deletions frontend/micro-ui/web/docker/devDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#FROM egovio/alpine-node-builder-14:yarn AS build
FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0
ARG WORK_DIR
WORKDIR /app
ENV NODE_OPTIONS "--max-old-space-size=1792"

COPY ${WORK_DIR} .
RUN ls -lah

#RUN node web/envs.js
RUN cd web/ \
&& node envs.js \
&& ./install-deps.sh \
&& yarn install \
&& yarn build

#FROM nginx:mainline-alpine
FROM ghcr.io/egovernments/nginx:mainline-alpine
ENV WORK_DIR=/var/web/digit-ui

RUN mkdir -p ${WORK_DIR}

COPY --from=build /app/web/build ${WORK_DIR}/
COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf
25 changes: 25 additions & 0 deletions frontend/micro-ui/web/docker/masDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#FROM egovio/alpine-node-builder-14:yarn AS build
FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0
ARG WORK_DIR
WORKDIR /app
ENV NODE_OPTIONS "--max-old-space-size=3792"

COPY ${WORK_DIR} .
RUN ls -lah

#RUN node web/envs.js
RUN cd web/ \
&& node envs.js \
&& yarn install \
&& yarn build

#FROM nginx:mainline-alpine
FROM ghcr.io/egovernments/nginx:mainline-alpine
ENV WORK_DIR=/var/web/digit-ui

RUN mkdir -p ${WORK_DIR}

COPY --from=build /app/web/build ${WORK_DIR}/
COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf
12 changes: 12 additions & 0 deletions frontend/micro-ui/web/docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server
{
listen 80;
underscores_in_headers on;

location /digit-ui
{
root /var/web;
index index.html index.htm;
try_files $uri $uri/ /digit-ui/index.html;
}
}
Empty file added frontend/micro-ui/web/envs.js
Empty file.
15 changes: 15 additions & 0 deletions frontend/micro-ui/web/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

BRANCH="$(git branch --show-current)"

echo "Main Branch: $BRANCH"

INTERNALS="micro-ui-internals"

cd $INTERNALS && echo "Branch: $(git branch --show-current)" && echo "$(git log -1 --pretty=%B)" && echo "installing packages" && yarn install && echo "starting build" && yarn build && echo "building finished" && find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' \;
cd ..

rm -rf node_modules
rm -f yarn.lock

# yarn install
143 changes: 143 additions & 0 deletions frontend/micro-ui/web/micro-ui-internals/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,react
# Edit at https://www.toptal.com/developers/gitignore?templates=node,react

### eGov ###
packages/css/example/index.css
package-lock.json
locales/
build/
packages/**/dist/

# yarn #
.yarn
.yarnrc.yml

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist
dist-storybook

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### react ###
.DS_*
**/*.backup.*
**/*.back.*

node_modules

*.sublime*

psd
thumb
sketch

# vs code
.vscode/

# End of https://www.toptal.com/developers/gitignore/api/node,react
Loading

0 comments on commit aab8770

Please sign in to comment.