diff --git a/.gitignore b/.gitignore
index 8f00ef2..133fce8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
node_modules
-.env
+process.env
dist
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c67e348..b0b0315 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -16,7 +16,7 @@ We use github to host code, to track issues and feature requests, as well as acc
Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:
-1. Fork the repo and create your branch from `main`.
+1. Fork the repo and create your branch from `dev`.
2. If you've added code that should be tested, add tests.
3. Ensure the test suite passes.
4. Make sure your code lints.
diff --git a/README.md b/README.md
index 0941ded..b42b929 100644
--- a/README.md
+++ b/README.md
@@ -86,14 +86,12 @@
-
-
# Accessing Grafana
1. You will need to obtain the stateful set of your clusters.
- ```
+ ```
kubectl get statefulset
```
@@ -156,8 +154,6 @@
-
-
# Accessing Prometheus
@@ -193,7 +189,37 @@
-
+
+
+# Running Zeus
+
+1. Fork and clone the `dev` branch onto your local branch.
+ ``` bash
+ https://github.com/oslabs-beta/Zeus.git
+ ```
+
+2. Install all the dependencies
+ ``` bash
+ npm install
+ ```
+3. Create ```process.env``` file at the root directory
+ ``` bash
+ root
+ ├─ process.env
+ ├─ electron
+ └─ src
+ ```
+4. Connect to NoSQL database in .env
+
+ ``` js
+ mongoURI = "Your NoSQL URI string"
+ ```
+5. Ensure your cluster is running and then you can start the application with:
+ ``` bash
+ npm run electron
+ ```
+
+
# Made with
@@ -226,9 +252,9 @@

+
-
-
+
# Contributions
@@ -237,24 +263,42 @@ For more information regarding how to contribute, please refer to the
guidelines from this repo.
1. Fork and clone the `dev` branch onto your local branch.
-2. Create a new a feature branch
+ ``` bash
+ https://github.com/oslabs-beta/Zeus.git
```
+2. Create a new a feature branch
+ ``` bash
[your-name]/AWESOME-FEATURES
```
-3. Please ensure you are following eslint conventions.
-4. Please ensure to create tests for your feature and that it passes your test suite.
-5. Please be detailed in your pull request.
+
+3. Install all the dependencies
+ ``` bash
+ npm install
+ ```
+4. Create ```process.env``` file at the root directory
+ ``` bash
+ root
+ ├─ process.env
+ ├─ electron
+ └─ src
+ ```
+5. Connect to NoSQL database in .env
+
+ ``` js
+ mongoURI = "Your NoSQL URI string"
+ ```
+6. ***Please ensure you are following eslint conventions***.
+7. ***Please ensure to create tests for your feature and that it passes your test suite***.
+8. **Please be detailed in your pull request**.
+

-
-
# Founders
-- Ed Cho [LinkedIn](https://www.linkedin.com/in/edcho720/)| [GitHub](https://github.com/edcho720)
+- Ed Cho [LinkedIn](https://www.linkedin.com/in/edcho720/) | [GitHub](https://github.com/edcho720)
- John Wroge [LinkedIn](https://www.linkedin.com/in/john-wroge/) | [GitHub](https://github.com/johnwroge)
- Harvey Li [LinkedIn](https://www.linkedin.com/in/harvey-li/) | [GitHub](https://github.com/harvli)
-- Amy (Aimée) Nguyen [LinkedIn](https://www.linkedin.com/in/aqn/) |
- [GitHub](https://github.com/DoctorCodeine)
+- Amy (Aimée) Nguyen [LinkedIn](https://www.linkedin.com/in/aqn/) | [GitHub](https://github.com/DoctorCodeine)
diff --git a/jest.config.js b/jest.config.js
index 28c8662..ad92023 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,17 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
- preset: 'ts-jest',
- testEnvironment: ['node', 'jsdom']
- // moduleFileExtensions: [
- // 'js',
- // 'jsx',
- // 'json',
- // 'node',
- // 'ts'
- // ],
- // transform: {
- // '^.+\\.js$': 'babel-jest',
- // '^.+\\.(ts|tsx)$': 'ts-jest'
- // }
+ preset: 'ts-jest',
+ testEnvironment: ['node', 'jsdom']
};
diff --git a/package-lock.json b/package-lock.json
index 8ac5e6a..b5786bc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23,6 +23,7 @@
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"css-loader": "^6.7.2",
+ "dotenv": "^16.0.3",
"eslint-config-airbnb": "^19.0.4",
"express": "^4.18.2",
"formik": "^2.2.9",
@@ -36,6 +37,7 @@
"mongosh": "^1.6.1",
"node-fetch": "^3.3.0",
"nodemon": "^2.0.20",
+ "path": "^0.12.7",
"prom-client": "^14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -13795,12 +13797,11 @@
}
},
"node_modules/dotenv": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
- "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
- "dev": true,
+ "version": "16.0.3",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
+ "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"engines": {
- "node": ">=10"
+ "node": ">=12"
}
},
"node_modules/dotenv-expand": {
@@ -28775,6 +28776,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/path": {
+ "version": "0.12.7",
+ "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
+ "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
+ "dependencies": {
+ "process": "^0.11.1",
+ "util": "^0.10.3"
+ }
+ },
"node_modules/path-browserify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
@@ -28831,6 +28841,19 @@
"node": ">=8"
}
},
+ "node_modules/path/node_modules/inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "node_modules/path/node_modules/util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "dependencies": {
+ "inherits": "2.0.3"
+ }
+ },
"node_modules/pbkdf2": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
@@ -31762,6 +31785,15 @@
"node": ">=8"
}
},
+ "node_modules/react-scripts/node_modules/dotenv": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/react-scripts/node_modules/emittery": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz",
@@ -49082,10 +49114,9 @@
}
},
"dotenv": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
- "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
- "dev": true
+ "version": "16.0.3",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
+ "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
},
"dotenv-expand": {
"version": "5.1.0",
@@ -60317,6 +60348,30 @@
"integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==",
"dev": true
},
+ "path": {
+ "version": "0.12.7",
+ "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
+ "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
+ "requires": {
+ "process": "^0.11.1",
+ "util": "^0.10.3"
+ },
+ "dependencies": {
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "requires": {
+ "inherits": "2.0.3"
+ }
+ }
+ }
+ },
"path-browserify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
@@ -62376,6 +62431,12 @@
}
}
},
+ "dotenv": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
+ "dev": true
+ },
"emittery": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz",
diff --git a/package.json b/package.json
index 1501577..06ea9ee 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"css-loader": "^6.7.2",
+ "dotenv": "^16.0.3",
"eslint-config-airbnb": "^19.0.4",
"express": "^4.18.2",
"formik": "^2.2.9",
@@ -114,6 +115,7 @@
"mongosh": "^1.6.1",
"node-fetch": "^3.3.0",
"nodemon": "^2.0.20",
+ "path": "^0.12.7",
"prom-client": "^14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/src/server/database/db.ts b/src/server/database/db.ts
index 67269ce..e05bfa1 100644
--- a/src/server/database/db.ts
+++ b/src/server/database/db.ts
@@ -1,23 +1,27 @@
import { ErrorRequestHandler } from 'express';
+import path from 'path';
//acquiring mongoose framework
const mongoose = require('mongoose');
+require("dotenv").config({
+ path: path.resolve(__dirname, "../../../process.env"),
+});
+
//this line below is used to suppress deprecation warnings
mongoose.set('strictQuery', true);
//Data can be accessed anywhere -Look at env file to find username and password
-const mongoURI = 'mongodb+srv://zeus:123@cluster0.ntr77xf.mongodb.net/?retryWrites=true&w=majority';
//to hid server from public
-const URI = process.env.MONGO_URI || mongoURI;
+const URI = process.env.MONGO_URI;
//establishing connection to mongo
mongoose
.connect(URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
- dbName: 'zeus',
+ // dbName: 'zeus',
})
.then(() => console.log('🦆🦆🦆🦆🦆🦆🦆🦆 Mongoose is connected'))
.catch((err: ErrorRequestHandler) => {
@@ -34,5 +38,3 @@ const userSchema = new mongoose.Schema({
const Users = mongoose.model('Users', userSchema);
// Export db
module.exports = Users;
-
-export {};
diff --git a/test.html b/test.html
deleted file mode 100644
index 77247e2..0000000
--- a/test.html
+++ /dev/null
@@ -1,27 +0,0 @@
-Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age
-
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 2a369e2..f4d22d4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -23,12 +23,5 @@
],
},
"include": ["src/**/*", "__test__/"],
-
- // "paths": {
- // "*": [
- // "node_modules/*"
- // ]
- // },
- // "exclude": ["node_modules"],
}
//"ESNext" in module