Skip to content
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

Enhance Development Environment with Docker Hot Reload and Update Contributing Guidelines #280

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Am0stafa
Copy link

Overview

This pull request introduces a significant improvement to the Perplexica project's development environment and contribution process. It addresses and closes issue #277 by implementing a Docker-based development setup with hot reloading capabilities, making it easier for contributors to get started and work efficiently.

Closes #277

Key Changes

Docker Development Environment

  • Created docker-compose.dev.yaml for a consistent and easy-to-setup development environment
  • Implemented hot reloading for both frontend and backend:
    • Frontend (Next.js) changes are immediately reflected in the browser
    • Backend changes trigger automatic service restart
    • package.json modifications in root or ui directory prompt container rebuilds

Updated CONTRIBUTING.md

  • Added a comprehensive Table of Contents for improved navigation
  • Provided detailed instructions for setting up the development environment:
    • Docker method (recommended)
    • Non-Docker method
  • Included step-by-step guide for the development workflow
  • Enhanced coding standards and contribution practices sections
  • Improved guidelines for reporting issues and seeking support

Additional Improvements

  • Updated project documentation to reflect the new development setup
  • Ensured consistency between README.md and CONTRIBUTING.md
  • Added more detailed explanations of project structure and component interactions

Benefits

  • Significantly reduces the barrier to entry for new contributors
  • Ensures a consistent development environment across all contributors
  • Speeds up the development process with hot reloading capabilities
  • Provides clear and comprehensive guidelines for making contributions

Next Steps

  • Consider integrating this development setup into CI/CD pipelines

I'm excited to contribute to Perplexica and hope these changes will make it easier for others to join in and improve this fantastic project. I'm open to any feedback or suggestions for further enhancements.

Thank you for considering this contribution!

@marawan1805
Copy link

Nice PR! This feature is much needed for the project

@Am0stafa
Copy link
Author

@ItzCrazyKns What do you think?

@ItzCrazyKns
Copy link
Owner

LGTM but do we really need Docker for development?

@Am0stafa
Copy link
Author

Yeah its helpful and would make it easier for new developers to make contributions

@Am0stafa
Copy link
Author

@ItzCrazyKns

@nnWhisperer
Copy link

Hello, if there is to be a dev environment config, I think it must be in devcontainer format. It's easy to create, easy to use and is becoming the standard. https://code.visualstudio.com/docs/devcontainers/containers

@Am0stafa
Copy link
Author

Am0stafa commented Aug 28, 2024

Hello,

Thank you for the feedback regarding the use of Dev Containers. While I understand the benefits of using Dev Containers, there are several disadvantages that I personally face as I work remotely from multiple devices:

  1. Resource Intensive: Running containers can be resource-intensive, especially when running multiple containers simultaneously. This can lead to slower performance due to RAM consumption

  2. Limited Support for Windows Containers: Dev Containers primarily support Linux-based containers. While there is some support for Windows containers, it is not as robust, and many extensions and tools may not work as expected.

  3. Network and Proxy Issues: Working with containers can introduce network configuration issues, especially when dealing with corporate proxies or complex network setups. Local proxy settings are not reused inside the container, which can prevent extensions from working unless the appropriate proxy information is configured.

  4. Extension Compatibility: Not all VS Code extensions are fully compatible with Dev Containers. Some extensions may not work as expected or may require additional configuration.

  5. Debugging Challenges: Debugging applications running inside containers can be more complex compared to running them directly on the host machine.

  6. File System Performance: On Windows and macOS, bind mounts can introduce performance overhead due to the way file systems are handled between the host and the container. This can lead to slower file operations and build times.

Given these considerations, I believe it is beneficial to support both Docker Development Environment and Dev Containers by default. This approach provides flexibility for contributors to choose the setup that best fits their needs and working conditions. What do you think @nnWhisperer

@ItzCrazyKns, I work remotely from multiple machines and I want to make a lot of contributions to this project as I use it almost daily. Having support for both Docker Development Environment and Dev Containers by default would be amazing and would greatly enhance my ability to contribute effectively. Thanks for the amazing project @ItzCrazyKns !

So consider merging this pull request to provide a more flexible and inclusive development environment for all contributors.

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.

How to Keep Docker Installation Up-to-Date
4 participants