DevStream is a full-featured video streaming platform inspired by YouTube. Users can upload, view, like, and comment on videos, subscribe to channels, and keep track of their favorite content creators.
- User Authentication: Secure sign-up and login functionality.
- Video Upload & Management: Users can upload videos, with thumbnail support, descriptions, and optional metadata.
- Subscriptions: Subscribe to channels to follow creators.
- Likes & Comments: Like videos and leave comments on them.
- Paginated Content: Videos, comments, and subscriptions are efficiently paginated.
- Dashboard: View detailed statistics for a channel including total views, total subscribers, and more.
- Real-time Interactions: Real-time like and comment toggles, using efficient API calls.
-
Backend:
- Node.js
- Express.js
- MongoDB with Mongoose (ORM)
- Multer
- TypeScript for static typing
- Cloudinary for media storage
- JWT for authentication
-
Frontend:
- React
- Tailwind CSS for UI
- Next.js (with App Router for SSR)
- ShadCN UI for component styling
- TypeScript for static typing
-
Other Tools:
- Jest & React Testing Library (for testing)
- Docker (for containerization)
- GitHub Actions (for CI/CD)
- Node.js v22+
- MongoDB (locally or a cloud service like MongoDB Atlas)
- AWS account for S3 video storage
- IPStack API key (for IP data retrieval)
-
Clone the repository:
git clone https://github.com/yourusername/devstream.git cd devstream
-
Install dependencies:
npm install
-
Environment Variables:
Create a
.env
file in the root directory and configure the following:PORT= DB_URL= CORS_ORIGIN= ##mention url cors origin url here once deployed, so that u wont be allowing other sites from accessing ur website ACCESS_TOKEN_SECRET= #you can keep secret like anything but for production we make use of standard formats unlike this ACCESS_TOKEN_EXPIRY= REFRESH_TOKEN_SECRET= REFRESH_TOKEN_EXPIRY= CLOUDINARY_CLOUD_NAME= CLOUDINARY_API_KEY= CLOUDINARY_API_SECRET=
-
Run the app:
npm run dev
-
Server will start at:
http://localhost:5000
Here are the key API endpoints for DevStream:
-
Auth Routes:
- `POST
/api/auth/register` - Register a new user
POST /api/auth/login
- Login a user
-
Video Routes:
POST /api/videos/upload
- Upload a new videoGET /api/videos/:videoId
- Get details of a specific videoDELETE /api/videos/:videoId
- Delete a video
-
Comment Routes:
POST /api/comments/:videoId
- Add a comment to a videoGET /api/comments/:videoId
- Get all comments for a videoPUT /api/comments/:commentId
- Update a commentDELETE /api/comments/:commentId
- Delete a comment
-
Like Routes:
POST /api/likes/:videoId
- Like a videoDELETE /api/likes/:videoId
- Unlike a video
-
Subscription Routes:
POST /api/subscriptions/:channelId
- Subscribe to a channelDELETE /api/subscriptions/:channelId
- Unsubscribe from a channel
-
Dashboard Routes:
GET /api/dashboard/stats/:channelId
- Get channel statisticsGET /api/dashboard/videos/:channelId
- Get all videos uploaded by a channel
- Navigate to the Upload section of the platform.
- Select a video file, provide a title, description, and thumbnail, and click Upload.
- The video will be stored in an S3 bucket and accessible through the platform.
- Like a video to show your appreciation.
- Comment on videos to share your thoughts or feedback.
- Subscribe to a channel to stay updated with new content.
- View total video views, total subscribers, and other statistics through the dashboard for channel owners.
devstream/
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── utils/
├── frontend/
│ ├── components/
│ ├── pages/
│ ├── styles/
├── tests/
│ ├── unit/
│ ├── integration/
└── README.md
We welcome contributions! Here's how you can get started:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.