WatchWise is a YouTube video duration analyzer that allows users to paste a YouTube video link and view its duration at various playback speeds. It efficiently fetches video metadata and displays formatted durations in a user-friendly interface.
This project is deployed on Render
(backend) and Vercel
(frontend). Click here for live project.
- React
- Custom CSS
- Node.js + Express
- YouTube Data API
watchwise/
├── client/ # Frontend folder
│ ├── public/ # Static assets (favicon, etc.)
│ ├── src/ # React components and logic
│ ├── .env # Frontend environment variables
│ └── vite.config.js # Vite configuration
├── server.js # Main backend entry point
├── .env # Backend environment variables
├── package.json # Backend dependencies and scripts
└── README.md # Project documentation
Ensure the following software is installed on your machine:
- Node.js (v16+ recommended)
- npm (or yarn)
Clone the repository:
git clone https://github.com/your-username/watchwise.git
cd watchwise
Install dependencies:
# Backend dependencies
npm install
# Frontend dependencies
cd client
npm install
Create .env
files for both the backend and frontend based on the provided .env.sample
.
PORT=5000 (example)
YOUTUBE_API_KEY=""
VITE_API_BASE_URL=""
Start the backend server:
npm start
The backend will run on http://localhost:5000
.
Start the frontend development server:
cd client
npm run dev
The frontend will run on http://localhost:5173
.
To deploy the app:
- Build the frontend:
cd client npm run build
- Serve the frontend using the backend:
- Configure Express to serve the
client/dist
folder.
- Configure Express to serve the
Method | Endpoint | Description |
---|---|---|
GET |
/api/video-details?url= |
Fetch YouTube video details |
Example:
GET http://localhost:5000/api/video-details?url=https://www.youtube.com/watch?v=exampleID
- Invalid URL: Ensures that only valid YouTube URLs are processed.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Added feature-name"
- Push your branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See LICENSE
for more details.
If you have any queries mail me at manish.login01@gmail.com
or ping me on Twitter/X.