Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ jobs:

strategy:
matrix:
node-version: [22.10.0]
node-version: [22.18.0]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn test
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.14.0
- run: pnpm install
- run: pnpm test
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to Real Dev Squad API

- [Getting Started](#getting-started)
- [Yarn Command Reference](#yarn-command-reference)
- [pnpm Command Reference](#pnpm-command-reference)
- [Project Structure](#project-structure)
- [Generating Authentication Token](#generating-authentication-token)
- [Testing Guidelines](#testing-guidelines)
Expand All @@ -12,26 +12,26 @@

Instructions for initial setup can be found in the [README](README.md).

## Yarn Command Reference
## pnpm Command Reference

##### `yarn`
##### `pnpm install`

Installs all `dependencies` listed in the root `package.json`.

##### `yarn run test`
##### `pnpm test`

The script associated with `yarn run test` will run all tests that ensures that your commit does not break anything in the
The script associated with `pnpm test` will run all tests that ensures that your commit does not break anything in the
repository. This will run the lint, integration and unit tests.

##### `yarn run lint`
##### `pnpm lint`

Runs the lint checks in the project.

##### `yarn run generate-api-schema`
##### `pnpm generate-api-schema`

Generates the API schema in the file `public/apiSchema.json`.

##### `yarn run validate-setup`
##### `pnpm validate-setup`

Runs the test for checking local development setup is working properly or not.

Expand Down Expand Up @@ -146,8 +146,8 @@ export FIRESTORE_EMULATOR_HOST="localhost:<Firebase emulator PORT>"
## Running test scripts on Windows

- Git Bash is recommended for running test scripts on Windows.
- Run `yarn run test-integration` for running integration tests.
- Run `yarn run test-unit` for running unit tests.
- Run `pnpm test-integration` for running integration tests.
- Run `pnpm test-unit` for running unit tests.
- Make sure the server is not running.
- Make sure to close the emulator window after running the tests in order to avoid the blocking of the port for the next tests to run.
- For e.g - After running the integration tests, close the emulator window and then run the command for unit tests.
Expand All @@ -163,7 +163,7 @@ export FIRESTORE_EMULATOR_HOST="localhost:<Firebase emulator PORT>"
## Certain issues you may face while running the tests:

- Java version is not above 11
- When we run yarn test, it runs both the unit and integration tests (in this order). So after the unit tests are done, the java process is not killed automatically and when our integration test run it gives error.
- When we run pnpm test, it runs both the unit and integration tests (in this order). So after the unit tests are done, the java process is not killed automatically and when our integration test run it gives error.
- Error: connect ECONNREFUSED ::1:8081

## Possible solutions for above issues (in particular order):
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This Project serves the backend APIs required for [Real Dev Squad](https://reald

## Starting Local Development

Please install `yarn` and `volta`
Please install `pnpm` and `volta`

[Why Volta?](https://docs.volta.sh/guide/#why-volta)

Expand All @@ -39,12 +39,12 @@ To install Volta, please follow the [process](https://docs.volta.sh/guide/gettin
Install all the packages using the following command:

```shell
yarn
pnpm install
```
Now if one runs yarn install. The yarn.lock will be unexpectedly updated with an unknown future version of a dependency, potentially breaking the build in the future. To ensure that the yarn.lock file is not update, you will need to use the --frozen-lockfile flag.
Now if one runs pnpm install. The pnpm-lock.yaml will be unexpectedly updated with an unknown future version of a dependency, potentially breaking the build in the future. To ensure that the pnpm-lock.yaml file is not update, you will need to use the --frozen-lockfile flag.

```shell
yarn install --frozen-lockfile
pnpm install --frozen-lockfile
```

#### Confirm correct configuration setup
Expand All @@ -53,7 +53,7 @@ This command should be successful, before moving to development.


```shell
yarn validate-setup
pnpm validate-setup
```

#### TDD Local Development
Expand All @@ -65,27 +65,27 @@ Head over to [TDD Tests Files List](scripts/tests/tdd-files-list.txt), and add t
Run TDD in watch mode. Exiting this command will print the coverage report. Try to achieve 100% coverage.

```shell
yarn tdd:watch
pnpm tdd:watch
```

#### Running a server in Dev mode

```shell
yarn dev
pnpm dev
```

## What happens in production:

- Install packages

```
yarn
pnpm install
```

- Run tests

```
yarn run test
pnpm test
```

- Prune dev dependencies
Copy link
Contributor

@Suvidh-kaushik Suvidh-kaushik Aug 28, 2025

Choose a reason for hiding this comment

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

we do not need to prune dev dependencies we can directly install packages using pnpm install --prod in prod environment

Expand All @@ -97,7 +97,7 @@ npm prune --production
- Run start command (with port information)

```
yarn start
pnpm start
```

Note: These are handled automatically behind the scene when pushing to [Heroku](https://devcenter.heroku.com/)
Expand Down
84 changes: 44 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,93 @@
"name": "website-backend",
"version": "1.0.0",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"start": "node ./dist/server.js",
"tsc": "tsc",
"postinstall": "yarn run tsc",
"postinstall": "pnpm run tsc",
"dev": "cross-env NODE_ENV=development ts-node-dev server.js",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"validate-setup": "node scripts/validateSetup.js",
"test-integration": "sh scripts/tests/testIntegration.sh",
"test-unit": "sh scripts/tests/testUnit.sh",
"test": "yarn lint && yarn test-unit && yarn test-integration",
"test": "pnpm lint && pnpm test-unit && pnpm test-integration",
"tdd:watch": "sh scripts/tests/tdd.sh"
},
"dependencies": {
"@aws-sdk/client-identitystore": "^3.665.0",
"@types/nodemailer": "^6.4.15",
"axios": "1.7.4",
"cloudinary": "2.0.3",
"config": "3.3.7",
"cookie-parser": "1.4.6",
"@aws-sdk/client-identitystore": "^3.864.0",
"@google-cloud/firestore": "^7.11.3",
"axios": "^1.11.0",
"cloudinary": "^2.7.0",
"config": "4.1.1",
"cookie-parser": "^1.4.7",
"cors": "2.8.5",
"datauri": "4.1.0",
"debug": "4.3.5",
"debug": "^4.4.1",
"express": "~4.18.3",
"express-boom": "3.0.0",
"firebase-admin": "12.1.1",
"helmet": "7.1.0",
"firebase-admin": "13.4.0",
"helmet": "8.1.0",
"http-errors": "~2.0.0",
"joi": "17.12.2",
"jsdoc": "4.0.2",
"joi": "18.0.0",
"jsdoc": "4.0.4",
"jsonwebtoken": "^8.5.1",
"morgan": "1.10.0",
"multer": "1.4.5-lts.1",
"newrelic": "11.19.0",
"nodemailer": "^6.9.15",
"morgan": "^1.10.1",
"multer": "2.0.2",
"newrelic": "13.1.0",
"nodemailer": "^7.0.5",
"nodemailer-mock": "^2.0.6",
"passport": "0.7.0",
"passport-github2": "0.1.12",
"passport-google-oauth20": "^2.0.0",
"rate-limiter-flexible": "5.0.3",
"winston": "3.13.0"
"rate-limiter-flexible": "7.2.0",
"winston": "3.17.0"
},
"devDependencies": {
"@types/chai": "4.3.16",
"@types/config": "3.3.4",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/mocha": "10.0.6",
"@types/node": "20.11.24",
"@types/sinon": "17.0.3",
"@typescript-eslint/parser": "^7.1.1",
"chai": "4.4.1",
"@types/chai": "4.3.20",
"@types/config": "3.3.5",
"@types/nodemailer": "^7.0.0",
"@types/express": "5.0.3",
"@types/jest": "30.0.0",
"@types/lodash": "^4.17.20",
"@types/mocha": "10.0.10",
"@types/node": "24.3.0",
"@types/sinon": "17.0.4",
"@typescript-eslint/parser": "^8.39.1",
"chai": "4.5.0",
"chai-http": "4.4.0",
"cross-env": "7.0.3",
"cross-env": "10.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-mocha": "^10.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-security": "^1.7.1",
"firebase-tools": "13.4.0",
"mocha": "10.3.0",
"firebase-tools": "14.12.1",
"lodash": "^4.17.21",
"mocha": "11.7.1",
"nock": "13.2.9",
"nodemon": "3.1.3",
"nyc": "15.1.0",
"nodemon": "3.1.10",
"nyc": "17.1.0",
"pre-commit": "1.2.2",
"prettier": "^2.5.1",
"sinon": "18.0.0",
"prettier": "^2.8.8",
"sinon": "21.0.0",
"ts-node": "10.9.2",
"ts-node-dev": "2.0.0",
"typescript": "5.3.3"
"typescript": "5.9.2"
},
"engines": {
"node": "22.10.0"
"node": "22.18.0"
},
"pre-commit": [
"lint"
],
"volta": {
"node": "22.10.0",
"yarn": "1.22.21"
"node": "22.18.0",
"pnpm": "10.14.0"
}
}
Loading
Loading