From 22f49b962c170eacfd180f45c8aa57f5013a0862 Mon Sep 17 00:00:00 2001 From: Jason Wong Date: Tue, 14 Sep 2021 01:04:20 -0700 Subject: [PATCH] added dockerized MongoDb with seed data --- backend/src/app.js | 2 + backend/src/config/database.config.js | 7 +- backend/src/employees/getAll.js | 12 + backend/src/employees/index.js | 9 + backend/src/employees/models/employee.js | 31 +++ .../employees/services/employee.service.js | 25 ++ docker-compose.yml | 25 +- mongo/Dockerfile.dev | 4 + mongo/README.md | 38 +++ mongo/data/employees.json | 12 + mongo/data/locations.json | 3 + mongo/init.sh | 3 + mongo/package.json | 17 ++ mongo/scripts/employees.js | 33 +++ mongo/scripts/index.js | 36 +++ mongo/yarn.lock | 231 ++++++++++++++++++ package.json | 1 + 17 files changed, 486 insertions(+), 3 deletions(-) create mode 100644 backend/src/employees/getAll.js create mode 100644 backend/src/employees/index.js create mode 100644 backend/src/employees/models/employee.js create mode 100644 backend/src/employees/services/employee.service.js create mode 100644 mongo/Dockerfile.dev create mode 100644 mongo/README.md create mode 100644 mongo/data/employees.json create mode 100644 mongo/data/locations.json create mode 100644 mongo/init.sh create mode 100644 mongo/package.json create mode 100644 mongo/scripts/employees.js create mode 100644 mongo/scripts/index.js create mode 100644 mongo/yarn.lock diff --git a/backend/src/app.js b/backend/src/app.js index d7f2481d..c2d12b70 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -49,9 +49,11 @@ app.use(morgan("dev")); const errorhandler = require('./middleware/errorhandler.middleware'); // ROUTES +const employeesRouter = require('./employees'); const locationsRouter = require('./routers/locations.router'); const healthCheckRouter = require('./routers/healthCheck.router'); +app.use('/api/employees', employeesRouter); app.use('/api/locations', locationsRouter); app.use('/api/healthcheck', healthCheckRouter); diff --git a/backend/src/config/database.config.js b/backend/src/config/database.config.js index 8c48bdbd..2e1e454a 100644 --- a/backend/src/config/database.config.js +++ b/backend/src/config/database.config.js @@ -1,2 +1,7 @@ exports.PORT = process.env.BACKEND_PORT; -exports.DATABASE_URL = process.env.DATABASE_URL; + +const DbHost = process.env.DATABASE_HOST; +const DbUrl = DbHost ? `mongodb://${DbHost}:27017` + : process.env.DATABASE_URL; + +exports.DATABASE_URL = DbUrl; diff --git a/backend/src/employees/getAll.js b/backend/src/employees/getAll.js new file mode 100644 index 00000000..440a711a --- /dev/null +++ b/backend/src/employees/getAll.js @@ -0,0 +1,12 @@ +const { EmployeeService } = require("./services/employee.service"); + +const getAll = async (_, res, next) => { + await EmployeeService + .all() + .then(locations => res.status(200).json(locations)) + .catch(next); +} + +module.exports = { + getAll +}; diff --git a/backend/src/employees/index.js b/backend/src/employees/index.js new file mode 100644 index 00000000..f3dd22a7 --- /dev/null +++ b/backend/src/employees/index.js @@ -0,0 +1,9 @@ +const express = require("express"); +const router = express.Router(); + +const { getAll } = require("./getAll"); + +// return all records +router.get('/', getAll); + +module.exports = router; \ No newline at end of file diff --git a/backend/src/employees/models/employee.js b/backend/src/employees/models/employee.js new file mode 100644 index 00000000..6410a2aa --- /dev/null +++ b/backend/src/employees/models/employee.js @@ -0,0 +1,31 @@ +const mongoose = require('mongoose'); +mongoose.Promise = global.Promise; + +/* This is a temp model - used for testing local MongoDB and data generation scripts. */ +/* { + "name":"Marcus Hirthe", + "title":"Senior Functionality Designer", + "department":"Operations Management", + "joined":"2020-12-19T14:06:29.007Z" + } */ + +const employeeSchema = mongoose.Schema({ + name: { type: String }, + title: { type: String }, + department: { type: String }, + joined: { type: Date } +}); + +employeeSchema.methods.serialize = function () { + return { + id: this._id, + name: this.name, + title: this.title, + department: this.department, + joined: this.joined + }; +}; + +const Employee = mongoose.model('Employee', employeeSchema); + +module.exports = Employee; diff --git a/backend/src/employees/services/employee.service.js b/backend/src/employees/services/employee.service.js new file mode 100644 index 00000000..46a94dea --- /dev/null +++ b/backend/src/employees/services/employee.service.js @@ -0,0 +1,25 @@ +/* eslint-disable func-names */ +const Employee = require('../models/employee'); +const DatabaseError = require("../../errors/database.error"); + +const EmployeeService = {}; + +EmployeeService.all = async function () { + try { + const result = await Employee.find(); + return result; + } catch (error) { + throw new DatabaseError(error.message); + } +}; + +EmployeeService.getByName = async function (name) { + try { + const result = await UserProfile.find({ name }); + return result; + } catch (error) { + throw new DatabaseError(error.message); + } +}; + +module.exports.EmployeeService = EmployeeService; diff --git a/docker-compose.yml b/docker-compose.yml index 304f53ff..04e30a8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,25 @@ version: "3.8" services: + mongo: + image: "mongo:latest" + expose: + - "27017" + ports: + - "27017:27017" + networks: + - gateway + dbseed: + build: + context: ./mongo + dockerfile: Dockerfile.dev + volumes: + - ./mongo:/srv/mongo + depends_on: + - mongo + networks: + - gateway + backend: build: context: ./backend @@ -10,12 +29,14 @@ services: volumes: - ./backend:/srv/backend - backend_node_modules:/srv/backend/node_modules + environment: + DATABASE_HOST: mongo expose: - "4000" - - "27017" ports: - "4000:4000" - - "27017:27017" + depends_on: + - mongo restart: on-failure networks: - gateway diff --git a/mongo/Dockerfile.dev b/mongo/Dockerfile.dev new file mode 100644 index 00000000..2f0fdd6b --- /dev/null +++ b/mongo/Dockerfile.dev @@ -0,0 +1,4 @@ +FROM mongo:latest +COPY . . +RUN ["chmod", "+x", "init.sh"] +CMD ./init.sh \ No newline at end of file diff --git a/mongo/README.md b/mongo/README.md new file mode 100644 index 00000000..026d1737 --- /dev/null +++ b/mongo/README.md @@ -0,0 +1,38 @@ +# Summary +This module generates a series of JSON documents that are then treated as seed data for the Mongo database. + +It provides an `index.js` script that exposes a command with two parameters: + +- **type**: the document type to create +- **amount**: the number of records to create + +This command is used to generate test data files that are stored in the `/data` directory. +We generate these files at compile time rather than at runtime to ensure that the same test data is added to all user's environments. + +## Workflow for adding a new collection of data + +1. Review the [documentation](http://marak.github.io/faker.js/) for the `faker` project. +1. Duplicate the `/scripts/employees.js` file and modify for the new data model. +1. Add the new data model script to the `/scripts/index.js` file. + - Specify the `type` parameter value to associate with the data model. +1. Add a new script to the `package.json` for generating test data for the new model (e.g. `generate:employees`). +1. Run the newly created script to generate the test data file in the `/data` directory. +1. update the `init.sh` file to load the newly created test data file into the relevant database collection. +1. Run the `npm run rebuild` script defined in the `package.json` file to update the docker image. + +## Workflow for updating a collection of data +Do this after regenerating test data using the provided script or via manual entry. + +1. Run the `npm run rebuild` script defined in the `package.json` file to update the docker image. + +# Other Notes +The included `employees` collection is provided as example of how to generate test data. +It is not specified for use in the VRMS project. + +## Source Material + +- [faker documentation](http://marak.github.io/faker.js/) +- [MongoDB documentation](https://docs.mongodb.com/database-tools/mongoimport/) +- [Running MongoDB in Docker](https://www.bmc.com/blogs/mongodb-docker-container/) + +- [Seeding data for MongoDB](https://valenciandigital.com/blog/seeding-data-into-mongodb-using-docker) \ No newline at end of file diff --git a/mongo/data/employees.json b/mongo/data/employees.json new file mode 100644 index 00000000..52b3f884 --- /dev/null +++ b/mongo/data/employees.json @@ -0,0 +1,12 @@ +[ + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7112"},"name":"Austin Wolf","title":"National Implementation Technician","department":"IT","joined":"2020-12-29T16:19:13.798Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7113"},"name":"Mr. Rebecca Prohaska","title":"Legacy Division Representative","department":"Human Resources","joined":"2021-01-28T00:51:24.407Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7114"},"name":"Jerome Yundt","title":"Dynamic Directives Technician","department":"IT","joined":"2021-02-17T10:28:35.191Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7115"},"name":"Billy Rice","title":"Human Response Executive","department":"Marketing","joined":"2020-10-24T01:38:01.527Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7116"},"name":"Billie Dickinson","title":"Corporate Tactics Strategist","department":"IT","joined":"2020-12-11T22:05:23.764Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7117"},"name":"Israel Runolfsdottir","title":"International Program Facilitator","department":"IT","joined":"2021-01-17T17:18:52.826Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7118"},"name":"Beverly Fay","title":"Corporate Security Representative","department":"IT","joined":"2021-04-07T08:25:48.972Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f7119"},"name":"Alexander Lueilwitz PhD","title":"Product Quality Architect","department":"Human Resources","joined":"2020-11-10T07:42:02.373Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f711a"},"name":"Nettie Ankunding","title":"Future Assurance Executive","department":"Human Resources","joined":"2021-02-26T12:43:50.059Z"}, + {"_id":{"$oid":"61404aad5dfe7a2d2c8f711b"},"name":"Edmond Ritchie Jr.","title":"International Implementation Orchestrator","department":"IT","joined":"2020-11-26T11:47:20.252Z"} +] \ No newline at end of file diff --git a/mongo/data/locations.json b/mongo/data/locations.json new file mode 100644 index 00000000..f9c8feb8 --- /dev/null +++ b/mongo/data/locations.json @@ -0,0 +1,3 @@ +[ + {"_id":{"$oid":"5143afc66d44e1ceb372121e"},"locations":["Los Angeles", "Santa Monica", "Test"]} +] \ No newline at end of file diff --git a/mongo/init.sh b/mongo/init.sh new file mode 100644 index 00000000..a06def79 --- /dev/null +++ b/mongo/init.sh @@ -0,0 +1,3 @@ +#!/bin/sh +mongoimport --collection employees --file ./data/employees.json --jsonArray --uri "mongodb://mongo:27017" +mongoimport --collection locations --file ./data/locations.json --jsonArray --uri "mongodb://mongo:27017" \ No newline at end of file diff --git a/mongo/package.json b/mongo/package.json new file mode 100644 index 00000000..ac1a62e1 --- /dev/null +++ b/mongo/package.json @@ -0,0 +1,17 @@ +{ + "name": "vrms-mongo-setup", + "version": "0.1.0", + "description": "VRMS Database Seed Scripts", + "license": "AGPL-3.0", + "author": "HackForLA", + "main": "./scripts/index.js", + "scripts": { + "rebuild": "cd ../ && docker-compose build dbseed", + "generate:employees": "node ./scripts/index.js --type employee --amount 10" + }, + "devDependencies": { + "faker": "^5.5.3", + "mongodb": "^3.x.x", + "yargs": "^17.1.1" + } +} diff --git a/mongo/scripts/employees.js b/mongo/scripts/employees.js new file mode 100644 index 00000000..059e4be8 --- /dev/null +++ b/mongo/scripts/employees.js @@ -0,0 +1,33 @@ +const faker = require("faker"); +const { ObjectID } = require("mongodb"); + +const generateEmployees = (amount) => { + let employees = []; + for (x = 0; x < amount; x++) { + employees.push(createEmployee()); + } + return employees; +}; +const createEmployee = () => { + const companyDepartments = [ + "Marketing", + "Finance", + "Operations Management", + "Human Resources", + "IT", + ]; + const employeeDepartment = companyDepartments[Math.floor(Math.random() * companyDepartments.length)]; + const employee = { + "_id": {"$oid":new ObjectID()}, + name: faker.name.findName(), + title: faker.name.jobTitle(), + department: employeeDepartment, + joined: faker.date.past(), + }; + + return employee; +}; + +module.exports = { + generateEmployees, +}; \ No newline at end of file diff --git a/mongo/scripts/index.js b/mongo/scripts/index.js new file mode 100644 index 00000000..9a9f2711 --- /dev/null +++ b/mongo/scripts/index.js @@ -0,0 +1,36 @@ +const yargs = require("yargs"); +const fs = require("fs"); +const { generateEmployees } = require("./employees.js"); + +// Define Command +const argv = yargs.command("amount", "Decides the number of records to generate", { + type: { + description: "the type of record to generate", + alias: "t", + type: "string" + }, + amount: { + description: "The amount to generate", + alias: "a", + type: "number" + }, + }) + .help() + .alias("help", "h").argv; + +if(!argv.hasOwnProperty("type")) throw new Error("Document type not specified."); +if(!argv.hasOwnProperty("amount") || argv.amount < 1) throw new Error("Amount of records to create not specified."); + +const type = argv.type.toLowerCase(); +const amount = argv.amount; + +// Generate Employee data +if (type === "employee") { + const employees = generateEmployees(amount); + const json = JSON.stringify(employees); + fs.writeFileSync("./data/employees.json", json); + return; +} + +// Handle non-supported document types +throw new Error(`Document type: '${type}' not supported.`); diff --git a/mongo/yarn.lock b/mongo/yarn.lock new file mode 100644 index 00000000..4f555c28 --- /dev/null +++ b/mongo/yarn.lock @@ -0,0 +1,231 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +bl@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5" + integrity sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +bson@^1.1.4: + version "1.1.6" + resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.6.tgz#fb819be9a60cd677e0853aee4ca712a785d6618a" + integrity sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +denque@^1.4.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf" + integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +faker@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/faker/-/faker-5.5.3.tgz#c57974ee484431b25205c2c8dc09fda861e51e0e" + integrity sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +memory-pager@^1.0.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" + integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== + +mongodb@^3.x.x: + version "3.7.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.7.0.tgz#a2e1d086b72e06f9af685d9ac863aeb3e80a41b8" + integrity sha512-JOAYjT9WYeRFkIP6XtDidAr3qvpfLRJhT2iokRWWH0tgqCQr9kmSfOJBZ3Ry0E5A3EqKxVPVhN3MV8Gn03o7pA== + dependencies: + bl "^2.2.1" + bson "^1.1.4" + denque "^1.4.1" + optional-require "^1.0.3" + safe-buffer "^5.1.2" + optionalDependencies: + saslprep "^1.0.0" + +optional-require@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/optional-require/-/optional-require-1.1.7.tgz#9ab5b254f59534108d4b2201d9ae96a063abc015" + integrity sha512-cIeRZocXsZnZYn+SevbtSqNlLbeoS4mLzuNn4fvXRMDRNhTGg0sxuKXl0FnZCtnew85LorNxIbZp5OeliILhMw== + dependencies: + require-at "^1.0.6" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +readable-stream@^2.3.5: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +require-at@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/require-at/-/require-at-1.0.6.tgz#9eb7e3c5e00727f5a4744070a7f560d4de4f6e6a" + integrity sha512-7i1auJbMUrXEAZCOQ0VNJgmcT2VOKPRl2YGJwgpHpC9CE91Mv4/4UYIUm4chGJaI381ZDq1JUicFii64Hapd8g== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +saslprep@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" + integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== + dependencies: + sparse-bitfield "^3.0.3" + +sparse-bitfield@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11" + integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE= + dependencies: + memory-pager "^1.0.2" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs@^17.1.1: + version "17.1.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.1.1.tgz#c2a8091564bdb196f7c0a67c1d12e5b85b8067ba" + integrity sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" diff --git a/package.json b/package.json index 095ceff9..bb9a6534 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "VRMS Server", "scripts": { "start": "docker-compose up", + "start:rebuild": "docker-compose up --build", "start:local": "concurrently \"cd backend && npm run dev\" \"cd client && npm run start\"", "test:backend": "cd backend && npm run test", "test:client": "cd client && npm run test"