This is a web application that allows users to transfer files either by sending them via email or generating a shareable link. The application is built with a React frontend and a Node.js backend.
- Upload files for transfer.
- Send files via email.
- Generate a shareable link to download the file.
- frontend: Contains the React code for the client-side interface.
- backend: Contains the Node.js code for handling file uploads, email, and link generation.
Before you begin, ensure you have the following installed:
- Node.js (v14.x or later)
- npm (v6.x or later)
git clone https://github.com/vinay-s36/FileTransfer.git
cd FileTransfer
Navigate to the frontend
folder and install the dependencies:
cd frontend
npm install
Navigate to the backend
folder and install the dependencies:
cd ../backend
npm install
The backend requires certain environment variables for sending emails and interacting with Pinata for file storage. You will need to create a .env file in the backend folder. A sample .env.example is provided as a reference.
Follow these steps to add the required environment variables:
- EMAIL_USER and EMAIL_PASS: These are required to authenticate your email service.
- To generate an app password for Gmail, visit Google App Passwords and follow the instructions. Set the generated email and app password in the .env file.
- PINATA_JWT and GATEWAY_URL: These interact with Pinata for file storage.
- Create an account on Pinata by visiting Pinata Cloud. After signing up, obtain the JWT (JSON Web Token) and the Gateway URL from your Pinata dashboard and add them to the .env file. Your .env file should look like this:
EMAIL_USER = [email protected]
EMAIL_PASS = your-app-password
PINATA_JWT = your-pinata-jwt
GATEWAY_URL = https://your-gateway-url
Note: Ensure that the .env file is added to .gitignore to keep your sensitive information secure.
To start the frontend, run the following command inside the frontend
folder:
npm run dev
To start the backend, run the following command inside the backend
folder:
npm start