A modern, distributed file uploader with chunked uploads, integrity verification, and beautiful UI.
- Chunked File Upload: Large files split into chunks for reliable upload
- Beautiful UI: Modern glassmorphism design with smooth animations
- File Type Icons: Visual indicators for different file types
- Real-time Progress: Live upload speed, ETA, and progress tracking
- Toast Notifications: User-friendly notifications for all actions
- Upload Resume/Retry: Resume failed or incomplete uploads
- File Management: View, download, and delete uploads
- Dark Mode: Full dark mode support
- Security: Rate limiting, file validation, integrity checks
- Node.js >= 18.x
- npm or yarn
- PostgreSQL >= 12.x
-
Install PostgreSQL (if not already installed)
- Windows: Download from postgresql.org
- Mac:
brew install postgresql@14 - Linux:
sudo apt-get install postgresql postgresql-contrib
-
Create Database
# Connect to PostgreSQL psql -U postgres # Create database CREATE DATABASE fileupload; # Exit \q
-
Configure Backend Environment
cd backend cp .env.example .env # Edit .env with your PostgreSQL credentials
# Install all dependencies (root, backend, and frontend)
npm run install:all
# Or manually:
npm install
cd backend && npm install
cd ../frontend && npm install# Run both frontend and backend concurrently
npm run dev
# Or run separately:
npm run dev:backend # Backend on http://localhost:4000
npm run dev:frontend # Frontend on http://localhost:5173npm run build # Builds both backend and frontend
npm run start:backend # Start production backend
npm run start:frontend # Preview production frontendfile-upload-app/
├── backend/ # Express backend
│ ├── src/
│ │ ├── index.ts # Server entry point
│ │ ├── config/
│ │ │ └── constants.ts # Configuration
│ │ ├── controllers/
│ │ │ ├── file.controller.ts
│ │ │ └── upload.controller.ts
│ │ ├── database/
│ │ │ ├── db.ts # Database setup
│ │ │ └── models.ts # TypeScript types
│ │ ├── middleware/
│ │ │ └── rateLimit.ts # Rate limiting
│ │ ├── routes/
│ │ │ ├── file.routes.ts
│ │ │ └── upload.routes.ts
│ │ └── utils/
│ │ ├── fileUtils.ts # File operations
│ │ └── hashUtils.ts # Hash calculations
│ ├── chunks/ # Temporary chunk storage
│ ├── uploads/ # Completed files
│ └── .env # PostgreSQL configuration
│
└── frontend/ # React frontend
├── src/
│ ├── components/
│ │ ├── FileUploader.tsx # Upload component
│ │ ├── UploadsList.tsx # History component
│ │ └── ui/ # UI components
│ ├── contexts/
│ │ └── ThemeContext.tsx # Dark mode
│ ├── lib/
│ │ └── fileIcons.ts # File type icons
│ └── config.ts # Frontend config
└── dist/ # Production build
POST /api/upload/init- Initialize upload sessionPOST /api/upload/chunk- Upload individual chunkGET /api/upload/status/:uploadId- Get upload statusPOST /api/upload/resume- Resume failed uploadGET /api/upload/resume/:uploadId- Get missing chunks
GET /api/uploads- List all uploadsGET /api/download/:uploadId- Download fileDELETE /api/upload/:uploadId- Delete upload
VITE_API_BASE_URL=http://localhost:4000/api
VITE_MAX_FILE_SIZE=10737418240 # 10GB
VITE_CHUNK_SIZE=5242880 # 5MBDB_HOST=localhost
DB_PORT=5432
DB_NAME=fileupload
DB_USER=postgres
DB_PASSWORD=postgresPORT: 4000
MAX_FILE_SIZE: 10GB
MAX_CHUNK_SIZE: 10MB
RATE_LIMIT_MAX_UPLOADS: 50 per 15 minutes- Rate Limiting: 50 uploads per 15 min per IP
- File Validation: Whitelist of allowed file types
- Size Limits: Configurable max file/chunk sizes
- Filename Sanitization: Prevents path traversal
- Integrity Verification: SHA-256 hash checks
- CORS Protection: Configurable origins
- Documents: PDF, DOC, DOCX, TXT, XLS, XLSX, PPT, PPTX
- Images: JPG, PNG, GIF, BMP, SVG, WEBP
- Videos: MP4, AVI, MKV, MOV, WMV, WEBM
- Audio: MP3, WAV, FLAC, AAC, OGG
- Archives: ZIP, RAR, 7Z, TAR, GZ
- Code: JS, TS, PY, JAVA, JSON, XML, CSV
- React 19 + TypeScript
- Vite (build tool)
- Tailwind CSS (styling)
- Axios (HTTP client)
- Lucide React (icons)
- Node.js + Express
- TypeScript
- PostgreSQL (database)
- Multer (file upload)
- fs-extra (file operations)
# Root commands
npm run dev # Run both frontend & backend
npm run build # Build both
npm run install:all # Install all dependencies
# Backend only
npm run dev:backend # Start dev server
npm run build:backend # Build TypeScript
npm run start:backend # Run production
# Frontend only
npm run dev:frontend # Start dev server
npm run build:frontend # Build for production
npm run start:frontend # Preview production build- Add user authentication
- Integrate cloud storage (AWS S3)
- Add WebSocket for real-time updates
- Implement file encryption
- Add compression before upload
- Create admin dashboard
- Add unit & integration tests
MIT