This project demonstrates a video upload system using React for the frontend and Node.js with Express for the backend. It allows users to upload large video files in chunks, improving upload speed and efficiency.
TheArtfulProgrammer
public/
: Contains static assets that are publicly accessible.src/
: Main source directory for the React application.components/
: Reusable React components, including the video upload form.App.css/
: CSS or styled-component files for styling the application.App.jsx
: The main React component that orchestrates the application.main.jsx
: Entry point for the React application.
index.html
: HTML template for the React app.package.json
: Defines frontend dependencies and scripts.vite.config.js
: Configuration file for Vite.
controllers/
: Contains logic for handling API requests, including video chunk processing.routes/
: Defines API routes for the application.middleware/
: Custom middleware, including Multer configuration for handling file uploads.models/
: Data models (if using a database to store video metadata).uploads/
: Temporary directory for storing uploaded video chunks (Note: in this implementation, chunks are processed in memory).package.json
: Defines backend dependencies and scripts.index.js
: Entry point for the Express server, starts the application.
- Upload large video files in chunks.
- Improved upload speed.
- In-memory chunk processing (instead of writing to disk).
- Uses Multer middleware for handling file uploads.
This project is an improvement on the code from this Medium article.
- Node.js (v14 or later recommended)
- npm or yarn
- Navigate to the server directory:
cd server
- Install dependencies:
npm install
- Start the server:
npm run dev
The server should now be running on http://localhost:8000
(or your configured port).
- Navigate to the client directory:
cd client
- Install dependencies:
npm install
- Start the server:
npm run dev
The client should now be accessible at http://localhost:5173
(or the port specified by Vite).
- Open the client application in your web browser.
- Fill in the video title and description.
- Select a video file to upload.
- Click the "Upload" button to start the chunked upload process.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.