This project is a bootstrap for a React and Node.js application that allows users to upload files and analyze their file types. By. Fernado Cabal 02 April 2025
-
Clone the repository:
git clone <repository_url> cd my-reactnodejs-bootstrap
-
Install server dependencies:
cd server npm install express multer cors dotenv file-type -
Install client dependencies:
cd ../client npx create-react-app . npm install axios react-bootstrap bootstrap react-spinners
-
Create a
.envfile in theserverdirectory and add:PORT=5000
-
Start the Node.js server:
cd server node server.js -
Start the React development server:
cd ../client npm start -
Open your browser at
http://localhost:3000 -
Select a file using the file input and click "Upload".
-
The application will display the upload progress, file type, and other relevant information.
- File size is limited to 5MB to prevent large uploads.
file-typelibrary is used for reliable file type detection.- The server only returns the filename and the file type, it does not store the files persistently.
- File type validation is performed on the server-side to ensure only allowed file types (images, PDFs, and text files) are processed.
- Multer error handling is implemented to provide informative error messages for file size limits and other upload issues.
- File upload with progress tracking.
- File type detection and analysis.
- Modern UI using React Bootstrap.
- Error handling and validation.
- File size limit (5MB).
- Add database integration to store file metadata.
- Implement more robust error handling.
- Add unit and integration tests.
- Deployment documentation.
- Add more security features.
- Convert to typescript.