-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ba9c16f
Showing
113 changed files
with
31,636 additions
and
0 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,42 @@ | ||
name: content-api | ||
|
||
# This workflow is triggered on push to the 'content-web' directory of the main branch of the repository | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'content-api/**' | ||
|
||
# Configure workflow to also support triggering manually | ||
workflow_dispatch: | ||
|
||
# Environment variables are defined so that they can be used throughout the job definitions. | ||
env: | ||
imageRepository: 'content-api' | ||
resourceGroupName: 'Fabmedical-[SHORT_SUFFIX]' | ||
containerRegistryName: 'fabmedical[SHORT_SUFFIX]' | ||
containerRegistry: 'fabmedical[SHORT_SUFFIX].azurecr.io' | ||
dockerfilePath: './content-api' | ||
tag: '${{ github.run_id }}' | ||
|
||
# Jobs define the actions that take place when code is pushed to the main branch | ||
jobs: | ||
|
||
build-and-publish-docker-image: | ||
name: Build and Push Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo | ||
- uses: actions/checkout@master | ||
|
||
- name: Build and push an image to container registry | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.ACR_USERNAME }} | ||
password: ${{ secrets.ACR_PASSWORD }} | ||
path: ${{ env.dockerfilePath }} | ||
dockerfile: '${{ env.dockerfilePath }}/Dockerfile' | ||
registry: ${{ env.containerRegistry }} | ||
repository: ${{ env.imageRepository }} | ||
tags: ${{ env.tag }},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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: content-init | ||
|
||
# This workflow is triggered on push to the 'content-web' directory of the main branch of the repository | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'content-init/**' | ||
|
||
# Configure workflow to also support triggering manually | ||
workflow_dispatch: | ||
|
||
# Environment variables are defined so that they can be used throughout the job definitions. | ||
env: | ||
imageRepository: 'content-init' | ||
resourceGroupName: 'Fabmedical-[SHORT_SUFFIX]' | ||
containerRegistryName: 'fabmedical[SHORT_SUFFIX]' | ||
containerRegistry: 'fabmedical[SHORT_SUFFIX].azurecr.io' | ||
dockerfilePath: './content-init' | ||
tag: '${{ github.run_id }}' | ||
|
||
# Jobs define the actions that take place when code is pushed to the main branch | ||
jobs: | ||
|
||
build-and-publish-docker-image: | ||
name: Build and Push Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo | ||
- uses: actions/checkout@master | ||
|
||
- name: Build and push an image to container registry | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.ACR_USERNAME }} | ||
password: ${{ secrets.ACR_PASSWORD }} | ||
path: ${{ env.dockerfilePath }} | ||
dockerfile: '${{ env.dockerfilePath }}/Dockerfile' | ||
registry: ${{ env.containerRegistry }} | ||
repository: ${{ env.imageRepository }} | ||
tags: ${{ env.tag }},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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
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,64 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
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,19 @@ | ||
FROM node:alpine AS base | ||
RUN apk -U add curl | ||
WORKDIR /usr/src/app | ||
EXPOSE 3001 | ||
|
||
FROM node:argon AS build | ||
WORKDIR /usr/src/app | ||
|
||
# Install app dependencies | ||
COPY package.json /usr/src/app/ | ||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . /usr/src/app | ||
|
||
FROM base AS final | ||
WORKDIR /usr/src/app | ||
COPY --from=build /usr/src/app . | ||
CMD [ "npm", "start" ] |
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 @@ | ||
exports.appSettings = { | ||
db: (function(){ | ||
return process.env.MONGODB_CONNECTION || 'mongodb://localhost:27017/contentdb'; | ||
})() | ||
}; |
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,37 @@ | ||
const sessionController = require('./sessions.server.controller'); | ||
const speakerController = require('./speakers.server.controller'); | ||
|
||
const counters = { | ||
stats: 0, | ||
speakers: 0, | ||
sessions: 0 | ||
}; | ||
|
||
function stats() { | ||
return { | ||
taskId: process.pid, | ||
hostName: process.env.HOSTNAME, | ||
pid: process.pid, | ||
mem: process.memoryUsage(), | ||
counters: counters, | ||
uptime: process.uptime() | ||
} | ||
} | ||
|
||
exports.speakersGet = function(req, res) { | ||
speakerController.list({}, function(err, speakers) { | ||
counters.speakers++; | ||
res.json(speakers); | ||
}); | ||
}; | ||
|
||
exports.statsGet = function(req, res) { | ||
counters.stats++; | ||
res.json(stats()); | ||
}; | ||
exports.sessionsGet = function(req, res) { | ||
sessionController.list({}, function(err, sessions) { | ||
counters.sessions++; | ||
res.json(sessions); | ||
}); | ||
}; |
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,14 @@ | ||
const mongoose = require('mongoose'), | ||
Session = mongoose.model('Session'); | ||
|
||
exports.list = function(query, callback) { | ||
console.log("==== Load Sessions ===="); | ||
Session.find(query).lean().exec(function(err, sessionsList) { | ||
if (err) { | ||
console.error(err); | ||
callback(err); | ||
} else { | ||
callback(null, sessionsList); | ||
} | ||
}); | ||
}; |
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,13 @@ | ||
const mongoose = require('mongoose'), | ||
Speaker = mongoose.model('Speaker'); | ||
|
||
exports.list = function(query, callback) { | ||
console.log("==== Load Speakers ===="); | ||
Speaker.find(query).lean().exec(function(err, speakersList) { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
callback(null, speakersList); | ||
} | ||
}); | ||
}; |
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,58 @@ | ||
const mongoose = require('mongoose'), | ||
Schema = mongoose.Schema; | ||
|
||
const SessionSchema = new Schema({ | ||
_id: { | ||
type: String | ||
}, | ||
abstract: { | ||
type: String | ||
}, | ||
date: { | ||
type: String | ||
}, | ||
endTime: { | ||
type: Date | ||
}, | ||
eventName: { | ||
type: String | ||
}, | ||
hidden: { | ||
type: Boolean | ||
}, | ||
roomID: { | ||
type: Number | ||
}, | ||
roomName: { | ||
type: String | ||
}, | ||
sessionID: { | ||
type: Number | ||
}, | ||
sessioncode: { | ||
type: String | ||
}, | ||
speakerNames: [{ | ||
type: String | ||
}], | ||
speakers: [{ | ||
type: String | ||
}], | ||
startTime: { | ||
type: Date | ||
}, | ||
timeSlot: { | ||
type: Number | ||
}, | ||
title: { | ||
type: String | ||
}, | ||
trackNames: [{ | ||
type: String | ||
}], | ||
tracks: [{ | ||
type: String | ||
}] | ||
}); | ||
|
||
module.exports = mongoose.model('Session', SessionSchema); |
Oops, something went wrong.