Skip to content

Commit a3ebe95

Browse files
Merge pull request #10 from OpenSignLabs/staging
update
2 parents 4e90ae6 + ecfad49 commit a3ebe95

25 files changed

+1687
-275
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,24 @@
151151
"contributions": [
152152
"code"
153153
]
154+
},
155+
{
156+
"login": "rishabjasrotia",
157+
"name": "Rishab",
158+
"avatar_url": "https://avatars.githubusercontent.com/u/33950743?v=4",
159+
"profile": "https://github.com/rishabjasrotia",
160+
"contributions": [
161+
"code"
162+
]
163+
},
164+
{
165+
"login": "maoo",
166+
"name": "Maurizio Pillitu",
167+
"avatar_url": "https://avatars.githubusercontent.com/u/327285?v=4",
168+
"profile": "https://session.it",
169+
"contributions": [
170+
"bug"
171+
]
154172
}
155173
]
156174
}

.env.local_dev

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Clone the repo and rename this file to .env if you want to run the frontend react app locally for some quick contributions to the project.
2+
# When used as it is, this env config will connect to our hosted UAT backend
3+
# Note that any data in staging will get cleared from time to time and you may have to sign up again and again
4+
5+
# Set CI to false while running the app locally
6+
CI=false
7+
# Set it to the URL form where the app home page will be accessed
8+
PUBLIC_URL=http://localhost:3000
9+
# Set it to true if you want to generate the Sourcemap for debugging
10+
GENERATE_SOURCEMAP=false
11+
# Set it to the URL from where APIs will be accessible, for local development it should be localhost:3000/api/app (use your local port number instead)
12+
REACT_APP_SERVERURL=http://localhost:8080/app
13+
# A 12 character long random app identifier. The value of this should be same as APP_ID which is a variable used by backend API.
14+
REACT_APP_APPID=opensignstgn
15+
16+
17+
# Backend ExpressJS config ****************************************************************************************************************************************************************************************
18+
# A 12 character long random app identifier. The value of this should be same as REACT_APP_APPID which is a variable used by Frontend React App.
19+
APP_ID=opensignstgn
20+
# Name of the app. It will be visible in the verification emails sent out.
21+
appName=open_sign_server
22+
# A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database.
23+
MASTER_KEY=XnAadwKxxByMr
24+
# Mongodb URI to connect to
25+
MONGODB_URI=mongodb://host.docker.internal:27017/OpenSignDB
26+
# Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions.
27+
PARSE_MOUNT=/app
28+
# Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead)
29+
SERVER_URL=http://127.0.0.1:8080/app
30+
31+
# Storage config ************************************************************************************************************************************************************************************************
32+
# Digital ocean space name or AWS S3 bucket name for uploading documents
33+
DO_SPACE=DOSPACENAME
34+
# Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents
35+
DO_ENDPOINT=ams3.digitaloceanspaces.com
36+
# Digital ocean baseurl or AWS S3 base URL
37+
DO_BASEURL=https://DOSPACENAME.ams3.digitaloceanspaces.com
38+
# Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs
39+
DO_ACCESS_KEY_ID=
40+
# Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs
41+
DO_SECRET_ACCESS_KEY=
42+
# Digital ocean spaces region or AWS s3 region
43+
DO_REGION=us-west
44+
# local storage
45+
USE_LOCAL=TRUE
46+
47+
# Email mailgun config (The app will not initialize if any of these 3 variables are not set) *********************************************************************************************************************
48+
MAILGUN_API_KEY=XXXXX
49+
MAILGUN_DOMAIN=mail.yourdomain.com
50+
51+
52+
# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************
53+
PFX_BASE64=

INSTALLATION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ or follow below instructions to install it on your own infrastructure.
77

88
- Localhost(Frontend only)
99
- Digital Ocean
10+
- Localhost(Docker)
1011

1112
## Localhost(Frontend only)
1213

@@ -83,3 +84,9 @@ You can install all 3 components on digital ocean using the button below -
8384

8485
Visit below link if you face any issues while following the above instructions -
8586
- https://repost.aws/knowledge-center/create-access-key
87+
88+
89+
## Localhost(Docker)
90+
91+
Below are the steps to follow -
92+
- Execute `make build`

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build:
2+
cp .env.local_dev .env
3+
docker compose up -d

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ We would like to thank all our contributors and users for their support and feed
122122
<tr>
123123
<td align="center" valign="top" width="14.28%"><a href="https://github.com/VishakhaSainani"><img src="https://avatars.githubusercontent.com/u/113436770?v=4?s=100" width="100px;" alt="VishakhaSainani"/><br /><sub><b>VishakhaSainani</b></sub></a><br /><a href="#code-VishakhaSainani" title="Code">💻</a></td>
124124
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andrew-opensignlabs"><img src="https://avatars.githubusercontent.com/u/148278535?v=4?s=100" width="100px;" alt="Andrew"/><br /><sub><b>Andrew</b></sub></a><br /><a href="#code-andrew-opensignlabs" title="Code">💻</a></td>
125+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rishabjasrotia"><img src="https://avatars.githubusercontent.com/u/33950743?v=4?s=100" width="100px;" alt="Rishab"/><br /><sub><b>Rishab</b></sub></a><br /><a href="#code-rishabjasrotia" title="Code">💻</a></td>
126+
<td align="center" valign="top" width="14.28%"><a href="https://session.it"><img src="https://avatars.githubusercontent.com/u/327285?v=4?s=100" width="100px;" alt="Maurizio Pillitu"/><br /><sub><b>Maurizio Pillitu</b></sub></a><br /><a href="#bug-maoo" title="Bug reports">🐛</a></td>
125127
</tr>
126128
</tbody>
127129
</table>

apps/OpenSign/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ FROM node:16
55
WORKDIR /usr/src/app
66

77
# Copy package.json and package-lock.json first to leverage Docker cache
8-
COPY apps/OpenSign/package*.json ./
8+
COPY ./package*.json ./
99

1010
# Install application dependencies
1111
RUN npm install
1212

1313
# Copy the current directory contents into the container
14-
COPY apps/OpenSign/ .
15-
COPY apps/OpenSign/.husky .
14+
COPY ./ .
15+
COPY ./.husky .
1616

1717
# Make port 3000 available to the world outside this container
1818
EXPOSE 3000

apps/OpenSign/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
},
4242
"scripts": {
4343
"start": "mf-cra start",
44-
"build": "npm run micro && CI=false && mf-cra build",
44+
"start-prod": "serve -s build",
45+
"build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build",
4546
"micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build",
4647
"test": "react-scripts test",
4748
"eject": "react-scripts eject",
@@ -84,4 +85,4 @@
8485
"pretty-quick": "^3.1.3",
8586
"tailwindcss": "^3.3.3"
8687
}
87-
}
88+
}

apps/OpenSign/public/mfbuild/.gitkeep

Whitespace-only changes.

apps/OpenSign/src/components/ReportMicroapp.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const MicroappModal = () => {
1515
// console.log("value ", key + ":" + value);
1616

1717
if (key === "remoteUrl") {
18-
obj = { ...obj, [key]: atob(value) };
18+
const url = window.location.origin + "/mfbuild/remoteEntry.js";
19+
// console.log("atob(value) ", atob(value))
20+
obj = { ...obj, [key]: url };
1921
} else {
2022
if (key === "moduleToLoad") {
2123
obj = { ...obj, [key]: "./" + value };
@@ -45,9 +47,9 @@ const MicroappModal = () => {
4547
>
4648
Back
4749
</button>
48-
{localStorage.getItem('domain') && (
50+
{localStorage.getItem("domain") && (
4951
<p className="flex-1 w-full text-sm md:text-base text-black text-center">
50-
{localStorage.getItem('domain') === "contracts" ? "Document":""}
52+
{localStorage.getItem("domain") === "contracts" ? "Document" : ""}
5153
</p>
5254
)}
5355
</div>

apps/OpenSign/src/routes/RemoteApp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export default function RemoteAppContainer() {
6565
// console.log("value ", key + ":" + value);
6666

6767
if (key === "remoteUrl") {
68-
obj = { ...obj, [key]: atob(value) };
68+
const url = window.location.origin + "/mfbuild/remoteEntry.js";
69+
// console.log("atob(value) ", atob(value))
70+
obj = { ...obj, [key]: url };
6971
} else {
7072
if (key === "moduleToLoad") {
7173
obj = { ...obj, [key]: "./" + value };

0 commit comments

Comments
 (0)