Skip to content

chore(server): run API and WebSocket servers in parallel using concurrently#127

Open
Misterr-H wants to merge 1 commit intojoincalldotco:mainfrom
Misterr-H:ws-server-pnpm-dev
Open

chore(server): run API and WebSocket servers in parallel using concurrently#127
Misterr-H wants to merge 1 commit intojoincalldotco:mainfrom
Misterr-H:ws-server-pnpm-dev

Conversation

@Misterr-H
Copy link
Contributor

@Misterr-H Misterr-H commented Jul 25, 2025

Pull Request

Description

This PR updates the dev and start scripts in apps/server/package.json to use concurrently, allowing both the HTTP API server and the WebSocket (mediasoup) server to run in parallel. This ensures that both services are started together in both development and production environments, and their logs are visible in the terminal with clear process labels and colors.
Dependency added:
concurrently (as a devDependency)

Fixes: #[issue_number] (if applicable)


Checklist

  • I have tested my changes locally
  • I have added necessary documentation (if needed)
  • I have added/updated tests (if applicable)
  • I have run pnpm build or pnpm lint with no errors
  • This pull request is ready for review

Screenshots or UI Changes (if applicable)

Add screenshots, recordings, or before/after comparisons here.


Related Issues

Reference any related issues or PRs here.


Notes for Reviewer

  • Please ensure that both servers start and logs are visible as expected when running pnpm dev or pnpm start in the server package.
  • No changes to application logic; only process management/scripts were updated.

Summary by CodeRabbit

  • Chores
    • Updated development and start scripts to run multiple processes in parallel for improved workflow.
    • Added a new tool to handle concurrent process execution during development.

@vercel
Copy link
Contributor

vercel bot commented Jul 25, 2025

@Misterr-H is attempting to deploy a commit to the cloudec31-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Walkthrough

The package.json scripts in the server application were updated to use the concurrently package, enabling simultaneous execution of main and mediasoup server processes during development and production. The concurrently package was added as a development dependency to support this functionality.

Changes

File(s) Change Summary
apps/server/package.json Updated dev and start scripts to use concurrently for running two processes in parallel; added concurrently as a dev dependency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

Two servers now run side by side,
With colors and names, their logs coincide.
"Concurrently" hops in, a new friend to the show,
Making dev and start scripts ready to go!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/server/package.json (1)

6-6: Use single-quotes to avoid heavy escaping

The double-quote heavy string is harder to read & edit. Wrapping the sub-commands in single quotes removes the need for the escaping back-slashes:

-"dev": "concurrently -k -n api,ws -c green,blue \"nodemon --exec tsx src/index.ts\" \"tsx src/mediasoup-server.ts\"",
+"dev": "concurrently -k -n api,ws -c green,blue 'nodemon --exec tsx src/index.ts' 'tsx src/mediasoup-server.ts'",

Pure readability win; behaviour is unchanged.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 012ccc3 and 642740c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • apps/server/package.json (2 hunks)
🔇 Additional comments (1)
apps/server/package.json (1)

40-40: TypeScript 5.7 bump – confirm build & tooling compatibility

Jumping to typescript@^5.7.3 can surface stricter checks and deprecations. Ensure:

  1. pnpm build passes for every workspace package.
  2. Custom tsconfig options in @call/typescript-config remain valid.
  3. All @types/* versions are compatible.

Quick CI smoke-run should be enough, but worth double-checking.

Comment on lines +10 to 11
"start": "concurrently -k -n api,ws -c green,blue \"node dist/index.js\" \"node dist/mediasoup-server.js\"",
"ws": "tsx src/mediasoup-server.ts"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

start script depends on a dev-only package – production will fail

concurrently lives in devDependencies, yet the start script (used in production containers/hosts) invokes it.
Any production install executed with --production (or PNPM’s --prod) drops dev deps, so node dist/index.js & node dist/mediasoup-server.js will never start:

Error: Cannot find module 'concurrently'

Move the package to dependencies, or replace the script with a runtime process manager available in prod.

@@
   "dependencies": {
     …,
     "zod": "^3.25.67",
+    "concurrently": "^8.2.2"
   },
   "devDependencies": {
     …,
-    "concurrently": "^8.2.2"
   }

Also applies to: 41-41

🤖 Prompt for AI Agents
In apps/server/package.json around lines 10 to 11 and line 41, the "start"
script uses the "concurrently" package which is listed under devDependencies,
causing production installs with --production to fail due to missing this
package. To fix this, either move "concurrently" from devDependencies to
dependencies to ensure it is installed in production, or replace the "start"
script with a command that uses a runtime process manager available in
production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant