Skip to content

Commit b7c3afe

Browse files
authored
Merge pull request #28 from nomad-nmr/vite
Vite + AntD 5
2 parents 349978b + 2bda40d commit b7c3afe

File tree

116 files changed

+6586
-33690
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+6586
-33690
lines changed

Dockerfile.serv

+10-11
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ WORKDIR /app
44

55
COPY ./nomad-front-end/package.json .
66

7-
RUN npm install --legacy-peer-deps
7+
RUN npm install
88

99
COPY ./nomad-front-end .
1010

11-
ENV SKIP_PREFLIGHT_CHECK=true
12-
ENV PORT=3000
11+
# ENV SKIP_PREFLIGHT_CHECK=true
12+
# ENV PORT=3000
1313
#following setting should work for hosting of whole NOMAD app on one machine using nginx reverse proxy
14-
ENV REACT_APP_API_URL=/api
15-
ENV REACT_APP_NMRIUM_URL=/nmrium
14+
ENV VITE_API_URL=/api
15+
ENV VITE_NMRIUM_URL=/nmrium
1616

1717
#Set true if NOMAD submission is used
18-
ENV REACT_APP_SUBMIT_ON=true
19-
ENV REACT_APP_BATCH_SUBMIT_ON=true
20-
ENV REACT_APP_DATASTORE_ON=true
18+
ENV VITE_SUBMIT_ON=true
19+
ENV VITE_BATCH_SUBMIT_ON=true
20+
ENV VITE_DATASTORE_ON=true
2121

22-
RUN npm run build-docker
22+
RUN npm run build
2323

2424

2525
FROM node:16 as nmrium
2626

2727
WORKDIR /app
2828

2929
COPY ./nomad-nmrium/package.json .
30-
COPY ./nomad-nmrium/package-lock.json .
3130

3231
RUN npm install
3332

@@ -38,7 +37,7 @@ RUN npm run build
3837

3938
FROM nginx:stable-alpine
4039

41-
COPY --from=frontend /app/build /react-builds/frontend
40+
COPY --from=frontend /app/dist /react-builds/frontend
4241

4342
COPY --from=nmrium /app/dist /react-builds/nmrium
4443

Dockerfile.serv-tls

+10-11
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ WORKDIR /app
44

55
COPY ./nomad-front-end/package.json .
66

7-
RUN npm install --legacy-peer-deps
7+
RUN npm install
88

99
COPY ./nomad-front-end .
1010

11-
ENV SKIP_PREFLIGHT_CHECK=true
12-
ENV PORT=3000
11+
# ENV SKIP_PREFLIGHT_CHECK=true
12+
# ENV PORT=3000
1313
#following setting should work for hosting of whole NOMAD app on one machine using nginx reverse proxy
14-
ENV REACT_APP_API_URL=/api
15-
ENV REACT_APP_NMRIUM_URL=/nmrium
14+
ENV VITE_API_URL=/api
15+
ENV VITE_NMRIUM_URL=/nmrium
1616

1717
#Set true if NOMAD submission is used
18-
ENV REACT_APP_SUBMIT_ON=true
19-
ENV REACT_APP_BATCH_SUBMIT_ON=true
20-
ENV REACT_APP_DATASTORE_ON=true
18+
ENV VITE_SUBMIT_ON=true
19+
ENV VITE_BATCH_SUBMIT_ON=true
20+
ENV VITE_DATASTORE_ON=true
2121

22-
RUN npm run build-docker
22+
RUN npm run build
2323

2424

2525
FROM node:16 as nmrium
2626

2727
WORKDIR /app
2828

2929
COPY ./nomad-nmrium/package.json .
30-
COPY ./nomad-nmrium/package-lock.json .
3130

3231
RUN npm install
3332

@@ -38,7 +37,7 @@ RUN npm run build
3837

3938
FROM nginx:stable-alpine
4039

41-
COPY --from=frontend /app/build /react-builds/frontend
40+
COPY --from=frontend /app/dist /react-builds/frontend
4241

4342
COPY --from=nmrium /app/dist /react-builds/nmrium
4443

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Server side code for [NOMAD system](https://www.nomad-nmr.uk/) made out of three
66

77
### nomad-front-end
88

9-
React front-end bootstrapped with **[Create React App](https://github.com/facebook/create-react-app)**.
9+
React front-end bootstrapped with **[Vite JS](https://vitejs.dev/)**.
1010

1111
### nomad-rest-api
1212

env-example/frontend.env

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
SKIP_PREFLIGHT_CHECK=true
2-
PORT=3003
3-
REACT_APP_API_URL=http://localhost:8080
4-
REACT_APP_NMRIUM_URL=http://localhost:3000
1+
VITE_API_URL=http://localhost:8080
2+
VITE_NMRIUM_URL=http://localhost:3000
53

64
#Set true if corresponding NOMAD modules are used
7-
REACT_APP_SUBMIT_ON=true
8-
REACT_APP_BATCH_SUBMIT_ON=true
9-
REACT_APP_DATASTORE_ON=true
5+
VITE_SUBMIT_ON=true
6+
VITE_BATCH_SUBMIT_ON=true
7+
VITE_DATASTORE_ON=true

nomad-front-end/.dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
build
2+
dist
33
Dockerfile
44
README.md
55
.git

nomad-front-end/.gitignore

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
15-
/config
16-
.DS_Store
17-
.env.local
18-
.env.development.local
19-
.env.test.local
20-
.env.production.local
21-
1+
# Logs
2+
logs
3+
*.log
224
npm-debug.log*
235
yarn-debug.log*
246
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

nomad-front-end/Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ WORKDIR /app
44

55
COPY package.json /app/
66

7-
#--legacy-peer-deps for CRACO being able to use react-scripts@4.0.0 as dev dependency
8-
RUN npm install --legacy-peer-deps
7+
RUN npm install
98

109
## next line allows to avoid overwriting node_modules using anonymous volume
11-
RUN mkdir node_modules/.cache && chmod -R 777 node_modules/.cache
10+
RUN chown -R node.node /app/node_modules
1211

1312
COPY . .
1413

nomad-front-end/README.md

-68
This file was deleted.

nomad-front-end/config-overrides.js

-24
This file was deleted.

nomad-front-end/craco.config.js

-30
This file was deleted.

nomad-front-end/debug.log

-3
This file was deleted.

nomad-front-end/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>NOMAD 3</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/index.jsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)