Perplexica icon indicating copy to clipboard operation
Perplexica copied to clipboard

Enhance Development Environment with Docker Hot Reload and Update Contributing Guidelines

Open Am0stafa opened this issue 1 year ago • 7 comments

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!

Am0stafa avatar Jul 23 '24 21:07 Am0stafa

Nice PR! This feature is much needed for the project

marawan1805 avatar Jul 24 '24 11:07 marawan1805

@ItzCrazyKns What do you think?

Am0stafa avatar Jul 25 '24 15:07 Am0stafa

LGTM but do we really need Docker for development?

ItzCrazyKns avatar Jul 26 '24 15:07 ItzCrazyKns

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

Am0stafa avatar Jul 26 '24 15:07 Am0stafa

@ItzCrazyKns

Am0stafa avatar Jul 29 '24 11:07 Am0stafa

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

nnWhisperer avatar Aug 26 '24 22:08 nnWhisperer

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.

Am0stafa avatar Aug 28 '24 16:08 Am0stafa