This project is a simple SFTP file uploader built with React for the frontend and Node.js for the backend. It allows users to upload files to a specified SFTP server.
The backend is built with Node.js and Express. It uses the ssh2-sftp-client package to handle SFTP connections and file transfers. The endpoint for file uploads is /upload, which accepts a POST request with the SFTP server details and the files to be uploaded.
The server details required are:
host: The hostname or IP address of the SFTP server.port: The port number of the SFTP server (default is 22).username: The username for the SFTP server.password: The password for the SFTP server.
The files are uploaded to the /media_source_uploads/ directory on the SFTP server.
The frontend is built with React. It provides a form for users to enter the SFTP server details and select the files to be uploaded. The form data is sent to the backend when the form is submitted.
The frontend also supports dark mode, which can be toggled on and off. The dark mode setting is saved in local storage, so it persists across page reloads.
To run the project, you need to have Node.js and npm installed. Then, you can follow these steps:
- Clone the repository.
- Install the dependencies for the backend and frontend with
npm install. - Start the backend server with
node backend/index.js. - Start the frontend server with
npm run devin thefrontenddirectory. - Open a web browser and navigate to
http://localhost:5173to use the application.
Please note that you need to have an SFTP server available to test the file upload functionality.