Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
28 changes: 28 additions & 0 deletions DockerCompose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.8'

services:
rerum:
build:
context: C:\Users\supra\OneDrive\PSD project\rerum_server_nodejs
ports:
- "3000:3000"
depends_on:
- mongo
environment:
MONGO_URI: "mongodb://mongo:27017/rerum"

tiny:
build:
context: C:\Users\supra\OneDrive\PSD project\TinyNode
ports:
- "4000:4000"

mongo:
image: mongo:5.0
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db

volumes:
mongo_data:
36 changes: 36 additions & 0 deletions Reflection
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Github link: https://github.com/slu-csci-5030/image-recognition-integration-system/tree/iris/Supraja050202

## What did you observe about the process?

Mob programming process encouraged teamwork and feedback. It was very helpful as a group of people
are working on the same problem for issues like Docker file errors and YAML indentation. Collaborative
effort made it easier to learn from others and solve problems faster.

## What did you contribute?

I helped in debugging the docker-compose file and fixed syntax errors in the Docker files for both RERUM and
Tiny Node. I have also resolved the issue with the Docker Desktop as it was not running properly on windows.
I have ensured that the folder structure and paths were correct.

## Did you have ideas that did not get included? If so, why?

I have suggested .env file for configuration management, which would help code separation from environment
specific values. We decided to meet the requirement running without .env file to keep it simpler.

##Where you familiar with any of the tools before we used them? If so, how could we have used them better? If not,
what would have helped you use the tools more easily?

No, I don’t have much familiarity with Docker but had basic knowledge of Docker. This session helped me in
understanding and debugging the issues.

## How can we encourage communication within the group while doing mob programming?

To keep everyone involved, we set a timer for each member so that everyone would get a chance to give their input.
And also setting short-term goals for each session could help maintain focus and balance contributions.

## Where there things that worked well for the group? How can we amplify those things?

Real-time debugging and feedback were very effective. We stayed productive and learned by solving problems together
and it also helped with knowledge sharing.


81 changes: 81 additions & 0 deletions TinyNode/.github/workflows/cd_dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: TinyNode Dev Deploy on PR to main
on:
pull_request:
branches: main
jobs:
merge-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Merge with main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: ${{ github.head_ref }}
github_token: ${{ secrets.BRY_PAT }}
message: Merge main into this branch to deploy to dev for testing.
test:
needs: merge-branch
strategy:
matrix:
machines:
- vlcdhp02
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Create .env from secrets
uses: SpicyPizza/create-envfile@v2
with:
envkey_RERUM_REGISTRATION_URL: https://devstore.rerum.io/v1
envkey_RERUM_API_ADDR: https://devstore.rerum.io/v1/api/
envkey_RERUM_ID_PATTERN: https://devstore.rerum.io/v1/id/
envkey_RERUM_ACCESS_TOKEN_URL: https://devstore.rerum.io/client/request-new-access-token
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: "22"
- name: Cache node modules
uses: actions/cache@master
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies and run the test
run: |
npm install
npm run functionalTests
deploy:
if: github.event.pull_request.draft == false
needs:
- merge-branch
- test
strategy:
matrix:
node-version:
- 22
machines:
- vlcdhp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Deploy the app on the server
run: |
if [[ ! -e /srv/node/logs/tinynode.txt ]]; then
mkdir -p /srv/node/logs
touch /srv/node/logs/tinynode.txt
fi
cd /srv/node/tiny-node/
pm2 stop tinyNode
git stash
git pull
git checkout ${{ github.head_ref }}
git pull
npm install
pm2 start -i max bin/tinyNode.js
46 changes: 46 additions & 0 deletions TinyNode/.github/workflows/cd_prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: TinyNode production deploy on push to main.
on:
push:
branches: main
jobs:
test:
strategy:
matrix:
machines:
- vlcdhprdp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Test the app on the server
run: |
cd /srv/node/tiny-node/
git stash
git checkout main
git pull
npm install
npm run allTests
deploy:
needs:
- test
strategy:
matrix:
node-version:
- 22
machines:
- vlcdhprdp02
runs-on: ${{ matrix.machines }}
steps:
- uses: actions/checkout@master
- name: Deploy the app on the server
run: |
if [[ ! -e /srv/node/logs/tinynode.txt ]]; then
mkdir -p /srv/node/logs
touch /srv/node/logs/tinynode.txt
fi
cd /srv/node/tiny-node/
pm2 stop tinyNode
git stash
git checkout main
git pull
npm install
pm2 start -i max bin/tinyNode.js
104 changes: 104 additions & 0 deletions TinyNode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://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/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
1 change: 1 addition & 0 deletions TinyNode/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thehabes @cubap
74 changes: 74 additions & 0 deletions TinyNode/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contribute to the TinyThings RERUM Client
```
██████╗ ███████╗██████╗ ██╗ ██╗███╗ ███╗
██╔══██╗██╔════╝██╔══██╗██║ ██║████╗ ████║
██████╔╝█████╗ ██████╔╝██║ ██║██╔████╔██║
██╔══██╗██╔══╝ ██╔══██╗██║ ██║██║╚██╔╝██║
██║ ██║███████╗██║ ██║╚██████╔╝██║ ╚═╝ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
```
## ❤️ Thank You

Thank you for considering a contribution to this application! The `main` branch is protected and you cannot push to it.

## localhost / I Need Tokens!

If you want to contribute, it is imortant you are able to deploy the code and run tests locally. To do so, you will need to create a `.env` file which contains secrets for developers. Once you have the secrets, you can continue.

Contact the developers for the required development secrets!
* [Patrick Cuba](https://github.com/orgs/CenterForDigitalHumanities/people/cubap), IT Architect. [email protected] <br>![Github stats](https://github-readme-stats.vercel.app/api?username=cubap&theme=highcontrast&show_icons=true&count_private=true)
* [Bryan Haberberger](https://github.com/orgs/CenterForDigitalHumanities/people/thehabes), Full-Stack Developer. [email protected] <br>![Github stats](https://github-readme-stats.vercel.app/api?username=thehabes&theme=highcontrast&show_icons=true&count_private=true)
* [Research Computing Group at Saint Louis Univsersity](https://github.com/CenterForDigitalHumanities) -- [email protected]

## Ready to Install It And Run It!

First, make sure NodeJS is installed on your machine. For download and installation instructions [head to the NodeJS guide](https://nodejs.org/en/download).

Also make sure Git is installed on your machine. For download and installation instruction, [head to the Git guide](https://git-scm.com/downloads). Note this can also be achieved by installing [GitHub for Desktop](https://desktop.github.com/).

The following is a git shell example for installing the app on your local machine.

```shell
cd /code_folder
git clone https://github.com/CenterForDigitalHumanities/TinyNode.git tiny_things
npm install
```
**Note: do not run** `npm audit fix`. We will do that upstream in the `main` branch.

Create a file named `.env` in the root folder. In the above example, the root is `/code_folder/tiny_things`. `/code_folder/tiny_things/.env` looks like this:

```shell
ACCESS_TOKEN = OBTAINED_FROM_ADMINS
REFRESH_TOKEN = OBTAINED_FROM_ADMINS
RERUM_REGISTRATION_URL = https://store.rerum.io/v1/
RERUM_API_ADDR = https://store.rerum.io/v1/api/
RERUM_ID_PATTERN = https://store.rerum.io/v1/id/
RERUM_ACCESS_TOKEN_URL = https://store.rerum.io/v1/client/request-new-access-token
PORT = 3005
OPEN_API_CORS = false
```

Now, you can run tests
```shell
npm run runtest
```

And start the app
```shell
npm start
```

Your TinyThings will attempt to run at `http://localhost:3005`. If port `3005` is taken, then update the .env value `PORT` to an open port and try to start it again.

To stop the application, kill or exit the process via your shell (<kbd>CTRL + C</kbd> or <kbd>CTRL + X</kbd>).

## 🎉 Ready to Start Contributing!

Excellent, way to get there. First, make a new branch through the GitHub Interface or through your shell. Make sure you 'checkout' that branch.

```shell
cd /code_folder/tiny_things
git checkout my_new_branch
```

Now you can make code changes and see them in real time by using `npm start`. When you are finished with the commits to your new branch, open a Pull Request that targets the `main` branch at [https://github.com/CenterForDigitalHumanities/TinyNode/tree/main/](https://github.com/CenterForDigitalHumanities/TinyNode/tree/main/).
Loading