Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ config:
image-name: "application-service"
dockerfile: "build/maven/Dockerfile"
- work-dir: "studio-services/application-service/script"
image-name: "application-service-db"
image-name: "application-service-db"

- name: "builds/DIGIT-Studio/studio-ui/digit-studio"
build:
- work-dir: "micro-ui/"
dockerfile: "micro-ui/web/docker/Dockerfile"
image-name: "digit-studio"
32 changes: 32 additions & 0 deletions 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*
3 changes: 3 additions & 0 deletions 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')
140 changes: 140 additions & 0 deletions micro-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@

# workbench ui

A React App built on top of DIGIT UI Core.

# DIGIT

DIGIT eGovernance Platform Services

DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://core.digit.org/ for more details.

DIGIT platform is microservices based API platform enabling quick rebundling of services as per specific needs. This is a repo that lays down the core platform on top of which other mission services depend.


# DIGIT UI


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

Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications

It is also used to manage the Localisation data present in the system (Localisation service)


## Run Locally

Clone the project

```bash
git clone https://github.com/egovernments/DIGIT-Frontend.git
```

Go to the Sub directory to run UI
```bash
cd into micro-ui/web/micro-ui-internals
```

Install dependencies

```bash
yarn install
```

Add .env file
```bash
micro-ui/web/micro-ui-internals/example/.env
```

Start the server

```bash
yarn start
```


## Environment Variables

To run this project, you will need to add the following environment variables to your .env file

`REACT_APP_PROXY_API` :: `{{server url}}`

`REACT_APP_GLOBAL` :: `{{server url}}`

`REACT_APP_PROXY_ASSETS` :: `{{server url}}`

`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}`

`SKIP_PREFLIGHT_CHECK` :: `true`

[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev)

## Tech Stack

**Libraries:**

[React](https://react.dev/)

[React Hook Form](https://www.react-hook-form.com/)

[React Query](https://tanstack.com/query/v3/)

[Tailwind CSS](https://tailwindcss.com/)

[Webpack](https://webpack.js.org/)

## License

[MIT](https://choosealicense.com/licenses/mit/)


## Author

- [@jagankumar-egov](https://www.github.com/jagankumar-egov)


## Documentation

[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui)


## Support

For support, add the issues in https://github.com/egovernments/DIGIT-core/issues.


## Modules

1. Core
2. Workbench
3. HRMS
4. Dashboard
5. Engagement
6. Payment

## Starting with Digit-UI App (Impelmentation Teams) - MICRO-UI


Go to the Sub directory to run UI

```bash
cd into micro-ui/web
```

```bash
yarn install
```

Add .env file
```bash
micro-ui/web/.env
```

Start the server

```bash
yarn start
```


![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png)
4 changes: 4 additions & 0 deletions micro-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "workbench-ui",
"version": "1.0.0"
}
4 changes: 4 additions & 0 deletions micro-ui/web/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-nullish-coalescing-operator", "@babel/plugin-proposal-optional-chaining"]
}
3 changes: 3 additions & 0 deletions 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
41 changes: 41 additions & 0 deletions micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Use Alpine-based Node.js image as the build stage
FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build

# Update and upgrade the package lists and add required dependencies
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0

# Define working directory
ARG WORK_DIR
WORKDIR /app

# Set memory limits for Node.js processes
ENV NODE_OPTIONS "--max-old-space-size=8168"

# Copy the application files
COPY ${WORK_DIR} .

# List the contents of the directory for debugging
RUN ls -lah

# Clean up yarn cache and node_modules to avoid old dependencies being used
RUN yarn cache clean && rm -rf node_modules

# Install dependencies and build
RUN cd web/ \
&& ./install-deps.sh \
&& yarn install \
&& yarn build:webpack

# Use Nginx to serve the static files
FROM nginx:mainline-alpine

# Set the working directory for Nginx
ENV WORK_DIR=/var/web/digit-ui

# Create the target directory for the web build
RUN mkdir -p ${WORK_DIR}

# Copy the build output and Nginx configuration from the build stage
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 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 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 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 micro-ui/web/envs.js
Empty file.
14 changes: 14 additions & 0 deletions micro-ui/web/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

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

echo "Main Branch: $BRANCH"

INTERNALS="micro-ui-internals"

cp $INTERNALS/example/src/UICustomizations.js src/Customisations

cd $INTERNALS && echo "Branch: $(git branch --show-current)" && echo "$(git log -1 --pretty=%B)" && echo "installing packages"


# yarn install
Loading