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

[feat] FTP Support #2136

Open
abose opened this issue Feb 17, 2025 · 2 comments
Open

[feat] FTP Support #2136

abose opened this issue Feb 17, 2025 · 2 comments
Labels
customer raised issues raised by end user/customer Feature Request Feature requests from customers

Comments

@abose
Copy link
Member

abose commented Feb 17, 2025

Describe the problem

FTP panel to sync with an FTP server.

Describe the solution you'd like

  1. sync to and from via a panel
  2. FTP auth
  3. UX needs to be identified

Alternatives considered

No response

Additional context

No response

@abose abose added Feature Request Feature requests from customers customer raised issues raised by end user/customer labels Feb 17, 2025
@a4jp-com
Copy link

Sorry for the late reply.

Currently, Phoenix Code Editor lacks built-in FTP support, which is essential for synchronizing local files with a remote server.

  1. Describe the Problem

As a web developer, I rely on FTP to upload and synchronize files between my local development environment and remote servers. The absence of FTP functionality in Phoenix Code Editor necessitates the use of external applications, disrupting workflow and reducing efficiency.

  1. Describe the Solution You'd Like

An integrated FTP Panel: A dedicated panel within the editor to manage FTP connections, allowing users to connect to multiple servers and navigate remote directories seamlessly.

Two-Way Synchronization: Enable synchronization of files and folders between local and remote directories, with options for manual and automatic sync to ensure consistency.

Authentication Support: Provide support for various authentication methods, including username/password and SSH keys, to accommodate different server configurations.

User Interface Considerations: Design an intuitive interface that integrates smoothly with the existing editor layout, possibly as a sidebar or modal window, ensuring minimal disruption to the user's workflow.

  1. Alternatives Considered

I've explored using external FTP clients alongside Phoenix Code Editor. However, this approach requires constant context switching between applications, leading to a fragmented workflow and increased potential for errors.

  1. Additional Context

Use Cases: Live editing of server files, quick updates to websites, managing multiple projects across different servers...

Image

@a4jp-com
Copy link

a4jp-com commented Feb 28, 2025

Ideas:

Integrating FTP functionality into the Phoenix Code Editor involves several steps, including selecting an appropriate FTP client library, integrating it into the existing codebase, and developing a user interface for seamless interaction.

  1. Selecting an FTP Client Library

Given that Phoenix Code Editor is built with web technologies, incorporating an FTP client library compatible with JavaScript/Node.js is essential. One such library is basic-ftp, a well-maintained and widely-used FTP client for Node.js. It supports FTPS over TLS, IPv6, and provides an asynchronous API, making it suitable for modern applications.
NPM

  1. Integrating the FTP Library into Phoenix Code Editor

To integrate basic-ftp into Phoenix Code Editor, follow these steps:

Install the Library: Add basic-ftp to the project's dependencies using [npm]

bash

npm install basic-ftp

Implement FTP Functions: Develop functions to handle FTP operations such as connecting to a server, uploading, downloading, and synchronizing files. Here's a basic example of how to establish a connection and list directories:

javascript

const ftp = require("basic-ftp")

async function listRemoteDirectory() {
const client = new ftp.Client()
client.ftp.verbose = true
try {
await client.access({
host: "ftp.example.com",
user: "username",
password: "password",
secure: true
})
console.log(await client.list())
}
catch(err) {
console.error(err)
}
client.close()
}

This function connects to an FTP server and lists the contents of the remote directory. Ensure to handle exceptions and errors appropriately to enhance reliability.

  1. Developing the User Interface

Creating an intuitive user interface within Phoenix Code Editor will enhance user experience. Consider the following components:

FTP Panel: Design a sidebar panel that allows users to manage FTP connections, navigate remote directories, and perform file operations.

Connection Manager: Provide a feature for users to save and manage multiple FTP server profiles, facilitating quick connections.

Synchronization Controls: Implement options for users to synchronize files between local and remote directories, with clear indicators of synchronization status.

  1. Testing and Validation

After implementation, thorough testing is crucial:

Unit Tests: Write tests to ensure that FTP functions behave as expected under various scenarios.

Integration Tests: Verify that the FTP features integrate seamlessly with existing functionalities of Phoenix Code Editor.

User Acceptance Testing: Gather feedback from users to identify any usability issues or bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer raised issues raised by end user/customer Feature Request Feature requests from customers
Projects
None yet
Development

No branches or pull requests

2 participants