A modern file upload application built with Angular frontend and Node.js backend, featuring automatic duplicate detection and a beautiful user interface.
- Modern UI: Beautiful, responsive design with drag & drop functionality
- Duplicate Detection: Automatic detection and prevention of duplicate file uploads
- File Management: Upload, view, and delete files with ease
- Progress Tracking: Real-time upload progress indication
- File Descriptions: Add optional descriptions to uploaded files
- Size Validation: 10MB file size limit with client-side validation
file-upload-project/
├── backend/ # Node.js Express server
│ ├── server.js # Main server file
│ ├── package.json # Backend dependencies
│ ├── uploads/ # Uploaded files storage
│ └── data/ # File metadata storage
├── frontend/ # Angular application
│ └── file-upload-app/ # Angular project
│ ├── src/
│ │ ├── app/
│ │ │ ├── components/
│ │ │ │ ├── file-upload/ # File upload component
│ │ │ │ └── file-list/ # File list component
│ │ │ ├── services/
│ │ │ │ └── file.ts # File service
│ │ │ └── models/
│ │ │ └── file.ts # File interface
│ │ └── ...
│ └── package.json
└── package.json # Root package.json with scripts
- Node.js - Runtime environment
- Express.js - Web framework
- Multer - File upload middleware
- CORS - Cross-origin resource sharing
- fs-extra - Enhanced file system operations
- Angular 17 - Modern frontend framework
- TypeScript - Type-safe JavaScript
- SCSS - Advanced CSS preprocessing
- RxJS - Reactive programming
- Node.js (v18 or higher)
- npm (v9 or higher)
-
Clone the repository
git clone <repository-url> cd file-upload-project
-
Install all dependencies
npm run install-all
npm run devThis will start both the backend server (port 3000) and the Angular development server (port 4200).
npm start- Backend only:
npm run start:backend - Frontend only:
npm run start:frontend
- Frontend: http://localhost:4200
- Backend API: http://localhost:3000/api
GET /api/health- Check API status
GET /api/files- Get all uploaded filesGET /api/files/:id- Get specific file metadataPOST /api/upload- Upload a new fileDELETE /api/files/:id- Delete a file
The backend server runs on port 3000 by default. You can change this by setting the PORT environment variable:
PORT=4000 npm run start:backendThe Angular application runs on port 4200 by default. The API URL is configured in frontend/file-upload-app/src/app/services/file.ts.
npm run buildThis will create a production build of the Angular application in the frontend/file-upload-app/dist/ directory.
npm test- Drag & Drop: Users can drag files directly onto the upload area
- File Selection: Click the upload area to browse and select files
- Validation: Client-side validation checks file size (10MB limit)
- Upload: Files are uploaded with progress indication
- Duplicate Check: Server checks for duplicate files using SHA256 hash
- Storage: Files are stored in the
backend/uploads/directory - Metadata: File information is stored in
backend/data/items.json
- File Size Limits: 10MB maximum file size
- Duplicate Prevention: SHA256 hash-based duplicate detection
- CORS Configuration: Properly configured for development
- Input Validation: Client and server-side validation
- Responsive Design: Works on desktop and mobile devices
- Drag & Drop: Intuitive file upload interface
- Progress Indicators: Real-time upload progress
- Status Messages: Success and error notifications
- Modern Styling: Beautiful gradient design with smooth animations
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues or have questions, please open an issue in the repository.