Skip to content

Commit

Permalink
chore(repo): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BrycensRanch committed Oct 2, 2023
1 parent 8fd7d93 commit a669eb5
Show file tree
Hide file tree
Showing 25 changed files with 3,934 additions and 4,470 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ jobs:
- name: 🤖 Build Project
run: |
pnpm build
# - name: 🐳 Build Docker Image
# run: |
# docker compose up --build
- name: 🐳 Build Docker Image
run: |
docker compose up --build
env:
NODE_ENV: production
- name: 🥳 Run Tests (project-wide)
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ COPY --chown=nodejs:nodejs frontend/healthCheck.js ./frontend/healthCheck.js
COPY --chown=nodejs:nodejs frontend/.env* ./frontend/
COPY --chown=nodejs:nodejs backend/*.json ./backend/
COPY --chown=nodejs:nodejs backend/.env* ./backend/
COPY --chown=nodejs:nodejs .env ./backend/
COPY --chown=nodejs:nodejs .env ./frontend/

# Technically, this file is already on the system, but this is just for consistency's sake
COPY --chown=nodejs:nodejs backend/pm2.config.js* ./backend

Expand All @@ -81,6 +84,7 @@ COPY --chown=nodejs:nodejs frontend/public /home/nodejs/app/frontend/public
COPY --chown=nodejs:nodejs frontend/__mocks__ /home/nodejs/app/frontend/__mocks__
COPY --chown=nodejs:nodejs frontend/.next /home/nodejs/app/frontend/.next
COPY --chown=nodejs:nodejs scripts /home/nodejs/app/scripts
COPY --chown=nodejs:nodejs ecosystem.config.js /home/nodejs/app/ecosystem.config.js


RUN node dockerBuildAndInstall.mjs
Expand Down Expand Up @@ -190,5 +194,7 @@ ENV BACKEND_PORT 8000

# ENV BACKEND_PORT 8000

CMD ["pnpm", "boot:pm2"]
# CMD ["pnpm", "pm2"]
# CMD ["pnpm", "boot:pm2"]
# CMD ["pnpm", "pm2"]
# Before starting the migration, run the following command
CMD ["pm2-runtime", "ecosystem.config.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<a aria-label="Open Depfu Status" href="https://depfu.com/github/BrycensRanch/AuthIsForMe">
<img src="https://img.shields.io/depfu/dependencies/github/BrycensRanch/AuthIsForMe?style=for-the-badge" alt="dependencies status" />
</a>
<a href="https://wakatime.com/badge/github/BrycensRanch/AuthIsForMe"><img src="https://wakatime.com/badge/github/BrycensRanch/AuthIsForMe.svg?style=for-the-badge" alt="wakatime"></a>
</p>

## Credits
Expand Down
10 changes: 5 additions & 5 deletions backend/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const jestConfig: JestConfigWithTsJest = {
],
coverageThreshold,
testMatch: ['**/*.test.ts'],
moduleNameMapper: {
// Handle module aliases (this will be automatically configured for you soon)
'^@/(.*)$': '<rootDir>/src/$1',
'^@/public/(.*)$': '<rootDir>/public/$1',
},
// moduleNameMapper: {
// // Handle module aliases (this will be automatically configured for you soon)
// '^@/(.*)$': '<rootDir>/src/$1',
// '^@/public/(.*)$': '<rootDir>/public/$1',
// },
transform: {
// ".(t|j)s$": "babel-jest",
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
Expand Down
165 changes: 83 additions & 82 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,127 +30,128 @@
"migrate:postgres": "dotenv -e ../.env -- npx prisma migrate dev"
},
"dependencies": {
"@fastify/accepts": "^4.1.0",
"@fastify/accepts": "^4.2.0",
"@fastify/accepts-serializer": "^5.2.0",
"@fastify/autoload": "^5.7.1",
"@fastify/cookie": "^8.3.0",
"@fastify/cors": "^8.2.1",
"@fastify/cookie": "^9.1.0",
"@fastify/cors": "^8.4.0",
"@fastify/etag": "^4.2.0",
"@fastify/formbody": "^7.4.0",
"@fastify/helmet": "^10.1.0",
"@fastify/jwt": "^6.7.1",
"@fastify/multipart": "^7.5.0",
"@fastify/helmet": "^11.1.1",
"@fastify/jwt": "^7.2.1",
"@fastify/multipart": "^8.0.0",
"@fastify/routes-stats": "^3.4.0",
"@fastify/secure-session": "^6.0.0",
"@fastify/sensible": "^5.2.0",
"@fastify/swagger": "^8.3.1",
"@fastify/swagger-ui": "^1.5.0",
"@fastify/view": "^7.4.1",
"@immobiliarelabs/fastify-sentry": "^5.0.2",
"@mgcrea/fastify-graceful-exit": "^1.0.0",
"@nestjs/common": "^9.3.12",
"@nestjs/config": "^2.3.1",
"@nestjs/core": "^9.3.12",
"@nestjs/platform-fastify": "^9.3.12",
"@ory/kratos-client": "^0.11.1",
"@prisma/client": "^4.12.0",
"cross-env": "^7.0.3",
"@fastify/secure-session": "^7.1.0",
"@fastify/sensible": "^5.3.0",
"@fastify/swagger": "^8.10.1",
"@fastify/swagger-ui": "^1.9.3",
"@fastify/view": "^8.2.0",
"@immobiliarelabs/fastify-sentry": "^7.1.1",
"@mgcrea/fastify-graceful-exit": "^1.1.1",
"@nestjs/common": "^10.2.6",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.6",
"@nestjs/platform-fastify": "^10.2.6",
"@npmcli/ci-detect": "^3.0.2",
"@ory/kratos-client": "^1.0.0",
"@prisma/client": "^5.3.1",
"chalk": "^5.3.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"cross-env": "^7.0.3",
"dotenv-defaults": "^5.0.2",
"dotenv-expand": "^10.0.0",
"dotenv-mono": "^1.3.10",
"eta": "^2.0.1",
"fast-xml-parser": "^4.1.3",
"fastify": "^4.15.0",
"fastify-204": "^4.0.1",
"eta": "^3.1.1",
"fast-xml-parser": "^4.3.1",
"fastify": "^4.23.2",
"fastify-204": "^4.0.2",
"fastify-allow": "^1.2.2",
"fastify-cli": "^5.7.1",
"fastify-cli": "^5.8.0",
"fastify-formidable": "^3.0.2",
"fastify-get-head": "^1.1.0",
"fastify-get-head": "^3.0.0",
"fastify-grant": "^5.4.8",
"fastify-impressions": "^1.0.5",
"fastify-ip": "^0.1.1",
"fastify-ip": "^0.2.0",
"fastify-json5": "^1.0.0",
"fastify-plugin": "^4.5.0",
"fastify-plugin": "^4.5.1",
"fastify-print-routes": "^2.1.0",
"fastify-qs": "^4.0.1",
"fastify-qs": "^4.0.2",
"fastify-request-timing": "^2.0.2",
"fastify-server-version": "^1.0.1",
"fastify-user-agent": "^1.0.1",
"fastify-xml-body-parser": "^2.2.0",
"fastify-zod-validate": "^0.2.0",
"ioredis": "^5.3.1",
"node-api-analytics": "^1.0.11",
"prisma-redis-middleware": "^4.6.1",
"prisma-zod-generator": "^0.8.11",
"rate-limiter-flexible": "^2.4.1",
"scan-env": "github:BrycensRanch/scan-env",
"typescript": "^5.0.2",
"useragent": "^2.3.0",
"yaml": "^2.2.1",
"zod": "^3.21.4",
"chalk": "^5.2.0",
"figlet": "^1.6.0",
"git-repo-info": "^2.1.1",
"ioredis": "^5.3.2",
"is-docker": "^3.0.0",
"figlet": "^1.5.2",
"@npmcli/ci-detect": "^3.0.2"
"node-api-analytics": "^1.1.3",
"prisma-redis-middleware": "^4.8.0",
"prisma-zod-generator": "^0.8.13",
"rate-limiter-flexible": "^3.0.0",
"redis-url-plus": "^1.1.0",
"scan-env": "github:BrycensRanch/scan-env",
"typescript": "^5.2.2",
"useragent": "^2.3.0",
"yaml": "^2.3.2",
"zod": "^3.22.2"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
"@babel/preset-env": "^7.21.4",
"@jest/globals": "^29.5.0",
"@nestjs/cli": "^9.3.0",
"@nestjs/schematics": "^9.0.4",
"@nestjs/testing": "^9.3.12",
"@types/dotenv-defaults": "^2.0.1",
"@types/figlet": "^1.5.5",
"@types/ioredis-mock": "^8.2.1",
"@types/jest": "^29.5.0",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.10",
"@types/useragent": "^2.3.1",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"babel-jest": "^29.5.0",
"babel-plugin-transform-import-meta": "^2.2.0",
"@babel/core": "^7.23.0",
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@babel/preset-env": "^7.22.20",
"@jest/globals": "^29.7.0",
"@nestjs/cli": "^10.1.18",
"@nestjs/schematics": "^10.0.2",
"@nestjs/testing": "^10.2.6",
"@types/dotenv-defaults": "^2.0.2",
"@types/figlet": "^1.5.6",
"@types/ioredis-mock": "^8.2.3",
"@types/jest": "^29.5.5",
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.0",
"@types/useragent": "^2.3.2",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"babel-jest": "^29.7.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"babel-plugin-transform-vite-meta-env": "^1.0.3",
"dotenv-cli": "^7.1.0",
"eslint": "^8.36.0",
"dotenv-cli": "^7.3.0",
"eslint": "^8.50.0",
"eslint-config-airbnb-base-typescript-prettier": "^5.1.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-no-one-time-vars": "^2.4.2",
"eslint-plugin-mocha": "^10.2.0",
"eslint-plugin-no-one-time-vars": "^2.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sonarjs": "^0.19.0",
"eslint-plugin-unicorn": "^46.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-sonarjs": "^0.21.0",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-plugin-unused-imports": "^3.0.0",
"fastify-tls-keygen": "^1.1.0",
"fix-esm": "^1.0.1",
"ioredis-mock": "^8.2.7",
"jest": "^29.5.0",
"jest-mock": "^29.5.0",
"ioredis-mock": "^8.9.0",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
"jest-ts-webcompat-resolver": "^1.0.0",
"mocha": "^10.2.0",
"node-dev": "^8.0.0",
"npm-run-all": "^4.1.5",
"pino-pretty": "^10.0.0",
"prettier": "^2.8.7",
"pino-pretty": "^10.2.0",
"prettier": "^3.0.3",
"prettier-eslint-cli": "^7.1.0",
"prisma": "^4.12.0",
"prisma-json-schema-generator": "^3.1.3",
"prisma": "^5.3.1",
"prisma-json-schema-generator": "^4.0.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.21",
"ts-jest": "^29.0.5",
"ts-jest-mock-import-meta": "^1.0.0",
"ts-jest": "^29.1.1",
"ts-jest-mock-import-meta": "^1.1.0",
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0"
},
Expand Down
15 changes: 15 additions & 0 deletions backend/pm2.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable camelcase */

module.exports = [
// Main Application
{
name: 'AuthBackend',
script: './dist/src/start.js',
instances: require('node:os').cpus().length,
exec_mode: 'cluster',
exp_backoff_restart_delay: 100,
kill_timeout: 3000,
wait_ready: true,
listen_timeout: 10_000,
},
];
20 changes: 0 additions & 20 deletions backend/pm2.config.js

This file was deleted.

Loading

0 comments on commit a669eb5

Please sign in to comment.