prithivMLmods commited on
Commit
38d4dbe
1 Parent(s): 7be19b1

Upload 8 files

Browse files
Dockerfile.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ARG VITE_SERVER_URL
2
+
3
+ FROM node:18
4
+
5
+ # Set up a new user named "user" with user ID 1000
6
+ RUN useradd -o -u 1000 user
7
+
8
+ # Switch to the "user" user
9
+ USER user
10
+
11
+ # Set home to the user's home directory
12
+ ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
+
15
+ # Set the working directory to the user's home directory
16
+ WORKDIR $HOME/app
17
+
18
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
19
+ COPY --chown=user . $HOME/app
20
+
21
+ # Install npm dependencies
22
+ RUN npm install
23
+
24
+ # Build client and server
25
+ RUN export VITE_SERVER_URL=$MODEL_REPO_NAME && npm run build
26
+
27
+ EXPOSE 7860
28
+ CMD [ "npm", "run", "start" ]
index.html ADDED
@@ -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="/src/app/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Clinical Database</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/app/main.tsx"></script>
12
+ </body>
13
+ </html>
nodemon.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "watch": ["src"],
3
+ "ext": "js,jsx,ts,tsx,json",
4
+ "exec": "ts-node --esm --project tsconfig.server.json --experimental-specifier-resolution=node ./src/server"
5
+ }
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
tailwind.config.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /** @type {import('tailwindcss').Config} */
2
+ export default {
3
+ content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
4
+ theme: {
5
+ extend: {},
6
+ },
7
+ plugins: [require('daisyui')],
8
+ };
tsconfig.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
6
+ "moduleResolution": "Node",
7
+ "strict": true,
8
+ "sourceMap": true,
9
+ "resolveJsonModule": true,
10
+ "esModuleInterop": true,
11
+ "types": ["vite/client", "node"],
12
+ "noEmit": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "noImplicitReturns": true,
16
+ "jsx": "react",
17
+ "allowJs": false,
18
+ "isolatedModules": true,
19
+ "skipLibCheck": false,
20
+ "allowSyntheticDefaultImports": true,
21
+ "forceConsistentCasingInFileNames": true
22
+ },
23
+ "include": ["./src/app"]
24
+ }
tsconfig.server.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "module": "ES2022",
6
+ "target": "ES2022",
7
+ "noEmit": false
8
+ },
9
+ "include": ["src/*.ts"],
10
+ "exclude": ["src/app"]
11
+ }
vite.config.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import dotenv from 'dotenv';
2
+ dotenv.config();
3
+
4
+ import { defineConfig } from 'vite';
5
+ import reactRefresh from '@vitejs/plugin-react-refresh';
6
+
7
+ const { PORT = 7860 } = process.env;
8
+
9
+ // https://vitejs.dev/config/
10
+ export default defineConfig({
11
+ plugins: [reactRefresh()],
12
+ server: {
13
+ proxy: {
14
+ '/api': {
15
+ target: `http://localhost:${PORT}`,
16
+ changeOrigin: true,
17
+ },
18
+ },
19
+ },
20
+ build: {
21
+ outDir: 'dist/app',
22
+ },
23
+ });