Skip to content
Merged
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
102 changes: 0 additions & 102 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Run unit tests
if: steps.check-skip-ci.outputs.result == 'false'
run: |
yarn test
NX_DAEMON=false yarn test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable Nx caching for CI/CD. The pipelines always run in fully isolated, fresh installations of the app, so caching provides no benefit.


- name: SonarCloud Scan On PR
if: steps.check-skip-ci.outputs.result == 'false' && github.event.pull_request.head.repo.fork == false
Expand Down
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ignore techdocs output folder
generated-docs/

backend/node_modules/*
frontend/node_modules/*
**/node_modules/*

backend/.env
backend/dist/*
**/.env
dist/
**/dist/

lib-cov
*.seed
Expand Down Expand Up @@ -52,3 +52,11 @@ build

vcr.yml
.scannerwork/

.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
vite.config.*.timestamp*
vitest.config.*.timestamp*
*.tsbuildinfo
7 changes: 4 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

# Exit on error and unset variables
set -eu

# skip on CI or if deps aren't installed yet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change prevents Husky from running in CI or when dependencies are not installed.

[ -n "${CI:-}" ] && exit 0

# Run your quality checks
yarn --silent quality-check
21 changes: 14 additions & 7 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# some individual files
.eslintrc.cjs
*.json
*.md
# Generated or irrelevant files
*.d.ts
*.log

# Documentation [todo]: We should be able to use prettier for this to ensure consistent formatting
*.md

# some directories
*/dist/
*/node_modules/
# Build and dependency folders
dist/
node_modules/
coverage/
.nx/
.turbo/

# Public compiled assets
public/js/

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ This application provides features for common conferencing use cases, such as:

## Project Architecture

The project uses an Nx workspace to manage the frontend and backend applications.

![Vonage Video API Reference App Architecture Diagram](./docs/assets/project-architecture.svg)

## Platforms Supported
Expand Down
13 changes: 13 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from 'globals';
import baseConfig from '../eslint.config.mjs';

export default [
{
...baseConfig,

files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
globals: globals.node,
},
},
];
14 changes: 2 additions & 12 deletions backend/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ const loadConfig = (): Config => {
throw new Error('Missing config values for Vonage');
}

return {
...feedbackConfig,
applicationId,
privateKey,
provider: 'vonage',
};
return { ...feedbackConfig, applicationId, privateKey, provider: 'vonage' };
}
if (provider === 'opentok') {
const apiKey = process.env.OT_API_KEY ?? '';
Expand All @@ -41,12 +36,7 @@ const loadConfig = (): Config => {
throw new Error('Missing config values for OpenTok');
}

return {
...feedbackConfig,
apiKey,
apiSecret,
provider: 'opentok',
};
return { ...feedbackConfig, apiKey, apiSecret, provider: 'opentok' };
}
throw new Error('Unknown video service provider');
};
Expand Down
40 changes: 1 addition & 39 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,7 @@
"description": "Express-based backend with authenticated routes.",
"main": "index.js",
"type": "module",
"scripts": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts are moved to project.json

"dev": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --import tsx index.ts'\"",
"start": "node --import tsx index.ts",
"debug": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --inspect --import tsx index.ts'\"",
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage",
"test:watch": "yarn test --watch",
"ts-check": "tsc --noEmit -p tsconfig.json --pretty true"
},
"author": "",
"license": "MIT",
"dependencies": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependencies are now centralize... only one version of each package for the whole project.

"@vonage/auth": "^1.11.0",
"@vonage/server-sdk": "^3.16.0",
"@vonage/vcr-sdk": "^1.3.0",
"@vonage/video": "^1.23.2",
"axios": "^1.12.0",
"body-parser": "^1.20.3",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.21.2",
"form-data": "^4.0.4",
"opentok": "^2.16.0",
"opentok-jwt": "^0.1.5",
"tsx": "^4.10.5",
"validator": "13.15.15"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/body-parser": "^1.19.2",
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@types/opentok": "^2.14.0",
"@types/supertest": "^6.0.2",
"@types/validator": "^13.15.2",
"jest": "^29.7.0",
"nodemon": "^3.1.10",
"supertest": "^7.0.0",
"ts-jest": "^29.1.2"
}
"private": true
}
59 changes: 59 additions & 0 deletions backend/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "../node_modules/nx/schemas/project-schema.json",
"name": "backend",
"projectType": "application",
"root": "backend",
"sourceRoot": "backend",
"targets": {
"serve": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'tsc --noEmit -p tsconfig.json --pretty true && node --import tsx index.ts'\""
}
},
"start": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "node --import tsx index.ts"
}
},
"debug": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'tsc --noEmit -p tsconfig.json --pretty true && node --inspect --import tsx index.ts'\""
}
},
"test": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage"
},
"configurations": {
"watch": {
"command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage --watch"
}
},
"inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }]
},
"test:debug": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "NODE_OPTIONS=\"--experimental-vm-modules --inspect-brk\" jest --runInBand --detectOpenHandles --verbose"
},
"inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }]
},
"ts-check": {
"executor": "nx:run-commands",
"options": {
"cwd": "backend",
"command": "tsc --noEmit -p tsconfig.json --pretty true"
}
}
},
"tags": []
}
4 changes: 4 additions & 0 deletions backend/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "index.ts", "scripts"]
}
Loading
Loading