Enhance Development Environment with Docker Hot Reload and Update Contributing Guidelines
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.yamlfor 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.jsonmodifications in root oruidirectory 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!
Nice PR! This feature is much needed for the project
@ItzCrazyKns What do you think?
LGTM but do we really need Docker for development?
Yeah its helpful and would make it easier for new developers to make contributions
@ItzCrazyKns
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
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:
-
Resource Intensive: Running containers can be resource-intensive, especially when running multiple containers simultaneously. This can lead to slower performance due to RAM consumption
-
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.
-
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.
-
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.
-
Debugging Challenges: Debugging applications running inside containers can be more complex compared to running them directly on the host machine.
-
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.