Skip to content

Auto-Start Development Servers Module #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

MAVRICK-1
Copy link

@MAVRICK-1 MAVRICK-1 commented Aug 9, 2025

Auto-Start Development Servers Module

Summary

/claim #204

Implements automatic detection and startup of development servers based on project detection as requested in #204.

  • Multi-language support: Node.js, Rails, Django, Flask, Spring Boot, Go, PHP, Rust, .NET
  • Background execution: Servers start automatically without user intervention
  • Devcontainer.json integration: Uses custom start commands when available
  • Smart fallback: Creates sample project when no existing projects found
  • Comprehensive logging: Full activity logs for troubleshooting
Screencast.from.2025-08-10.01-45-41.mp4

Addresses GitHub Issue

Closes #204 - "Auto-start development servers based on project detection"

@MAVRICK-1
Copy link
Author

@DevelopmentCats can you please review this PR

@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@DevelopmentCats
Copy link
Contributor

I am also wondering if it would be worth having the module output something that could be used by a coder_app resource to provide a dynamic live preview based on the detected project type.

@MAVRICK-1
Copy link
Author

I am also wondering if it would be worth having the module output something that could be used by a coder_app resource to provide a dynamic live preview based on the detected project type.

@DevelopmentCats so whats on your mind

@MAVRICK-1
Copy link
Author

image fixed the formatting issue

@DevelopmentCats
Copy link
Contributor

I am also wondering if it would be worth having the module output something that could be used by a coder_app resource to provide a dynamic live preview based on the detected project type.

@DevelopmentCats so whats on your mind

You already have a check for verifying that there is a running app as a result of the module running at the end of run.sh

I think what you should do is take this and set the project port to a local which you could then use in a coder app resource to set a preview app for this module.

You could also set a variable to disable this feature in the module if you would like, but I think this would fit perfectly in this module with this logic.

IE..

resource "coder_app" "preview" {
  count        = var.enable_preview_app ? 1 : 0
  agent_id     = coder_agent.dev.id
  display_name = "Live Preview"
  url          = "http://localhost:${local.detected_port}"
  # other configuration...
}

@MAVRICK-1
Copy link
Author

Screencast.from.2025-08-13.22-41-52.mp4

@DevelopmentCats

@DevelopmentCats
Copy link
Contributor

DevelopmentCats commented Aug 13, 2025

Screencast.from.2025-08-13.22-41-52.mp4
@DevelopmentCats

This looks great! the only thing you might want to point the coder app icon to an actual existing icon or emoji in coder.
@MAVRICK-1

MAVRICK-1 and others added 2 commits August 14, 2025 01:04
Co-authored-by: DevCats <chris@dualriver.com>
@MAVRICK-1
Copy link
Author

@DevelopmentCats thankyou very much for your help

@DevelopmentCats
Copy link
Contributor

@DevelopmentCats thankyou very much for your help

No Problemo.

Sorry but can you run bun run fmt one last time? @MAVRICK-1

@MAVRICK-1
Copy link
Author

Okay 👍

@MAVRICK-1
Copy link
Author

image

@DevelopmentCats all lint test arre passing

@DevelopmentCats
Copy link
Contributor

@MAVRICK-1 This is shaping up really well! One thing I’d recommend is to prioritize running development scripts like npm run dev over npm start when both are available, since the module’s purpose is to auto-start development servers and most developers expect “dev” scripts to provide a better dev experience.

Also, with monorepos or projects that have both frontend and backend apps, right now the preview app is created for the first detected server, which could easily end up being a backend or something other than the main UI. It might be worth considering using smarter detection so that the preview defaults to the most likely frontend service. I think these tweaks could make the experience even smoother for people working with multi-app or monorepo setups!

@MAVRICK-1
Copy link
Author

on it

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

Successfully merging this pull request may close these issues.

Auto-start development servers based on project detection
2 participants