-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from SmartAPI/redesign
New Feature
- Loading branch information
Showing
102 changed files
with
29,329 additions
and
45,838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy-to-EC2-Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- vite-app | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to EC2 on branch push | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Step 0 - Install APT Dependences | ||
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl libxml2 libxmlsec1 pkg-config | ||
|
||
- name: Step 1 - Checkout the Files | ||
uses: actions/checkout@v3 | ||
|
||
- name: Step 2 - Install Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '20.9.0' | ||
|
||
- name: Step 3 - Build Frontend | ||
run: | | ||
cd web-app | ||
npm install | ||
NODE_OPTIONS="--max-old-space-size=1512" npm run build | ||
- name: Step 4 - Deploy to Dev Server | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
SOURCE: "/" | ||
SSH_PRIVATE_KEY: ${{ secrets.AWS_DEV_EC2_SSH_KEY }} | ||
REMOTE_HOST: ${{ secrets.AWS_DEV_HOST_DNS }} | ||
REMOTE_USER: ${{ secrets.AWS_DEV_USERNAME }} | ||
TARGET: ${{ secrets.AWS_DEV_TARGET_DIR }} | ||
SCRIPT_AFTER: | | ||
set -x | ||
echo "Activate python env." | ||
cd /home/ubuntu/smartapi | ||
source .env/bin/activate | ||
echo "Installing backend requirements." | ||
pip install -Ur requirements.txt --no-cache-dir --ignore-installed --force-reinstall | ||
echo "Restarting smartapi backend services..." | ||
sudo systemctl restart smartapi@8000 | ||
sleep 10 | ||
sudo systemctl restart smartapi@8080 | ||
echo "Smartapi backend services restarted!!!" | ||
set +x | ||
echo $RSYNC_STDOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ boto3 | |
|
||
# Biolink Model Toolkit, used in /api/metakg endpoint | ||
bmt-lite-v3.1.0==2.2.2 | ||
|
||
networkx==3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-env node */ | ||
require('@rushstack/eslint-patch/modern-module-resolution') | ||
|
||
module.exports = { | ||
root: true, | ||
'extends': [ | ||
'plugin:vue/vue3-essential', | ||
'eslint:recommended', | ||
'@vue/eslint-config-prettier/skip-formatting' | ||
], | ||
overrides: [ | ||
{ | ||
files: [ | ||
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}' | ||
], | ||
'extends': [ | ||
'plugin:cypress/recommended' | ||
] | ||
} | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/prettierrc", | ||
"semi": true, | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,57 @@ | ||
# web-app | ||
# SmartAPI web app | ||
|
||
## Project setup | ||
``` | ||
Developed with Vue 3 in Vite. | ||
|
||
## Recommended IDE Setup | ||
|
||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). | ||
|
||
## Customize configuration | ||
|
||
See [Vite Configuration Reference](https://vitejs.dev/config/). | ||
|
||
## Project Setup | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
### Compile and Hot-Reload for Development | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
npm run serve | ||
|
||
### Compile and Minify for Production | ||
|
||
```sh | ||
npm run build | ||
``` | ||
|
||
### Compiles and minifies for production | ||
### Run Unit Tests with [Vitest](https://vitest.dev/) | ||
|
||
```sh | ||
npm run test:unit | ||
``` | ||
npm run build | ||
|
||
### Run End-to-End Tests with [Cypress](https://www.cypress.io/) | ||
|
||
```sh | ||
npm run test:e2e:dev | ||
``` | ||
|
||
### Lints and fixes files | ||
This runs the end-to-end tests against the Vite development server. | ||
It is much faster than the production build. | ||
|
||
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): | ||
|
||
```sh | ||
npm run build | ||
npm run test:e2e | ||
``` | ||
|
||
### Lint with [ESLint](https://eslint.org/) | ||
|
||
```sh | ||
npm run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { defineConfig } = require('cypress') | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}', | ||
baseUrl: 'http://localhost:4173' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// https://on.cypress.io/api | ||
|
||
describe('My First Test', () => { | ||
it('visits the app root url', () => { | ||
cy.visit('/') | ||
cy.contains('h1', 'You did it!') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress"] | ||
}, | ||
"include": ["./**/*", "../support/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="blue-grey darken-4"> | ||
<html lang="en"> | ||
<head> | ||
<!-- NO CHANGE --> | ||
<meta charset="UTF-8"> | ||
|
@@ -52,10 +52,8 @@ | |
<link rel="stylesheet" href="https://unpkg.com/tippy.js@4/themes/light.css"/> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but SmartAPI doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
<!-- Swagger Editor Preset--> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/swagger-editor-standalone-preset.js"></script> | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.