Welcome to the WeTube video repository! This is a clone project inspired by YouTube, providing features such as user authentication, video upload, comments, and more. The project is built using Node.js, Express, MongoDB, and Pug for server-side rendering.
-
Clone the repository:
git clone https://github.com/minhosong88/wetube-video.git cd wetube-video
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following:DB_URL=your_mongodb_url COOKIE_SECRET=your_cookie_secret GH_CLIENT=your_github_client_id GH_SECRET=your_github_client_secret AWS_ID=your_aws_access_key_id AWS_SECRET=your_aws_secret_access_key NODE_ENV=development
-
Run the application:
npm run dev
- Open your browser and go to
http://localhost:4000
- Register a new user or log in with an existing account
- Upload videos, edit your profile, and explore other features
wetube-video/
├── .gitignore
├── README.md
├── babel.config.json
├── nodemon.json
├── package-lock.json
├── package.json
├── webpack.config.cjs
├── src/
│ ├── client/
│ │ ├── js/
│ │ │ ├── commentSection.js
│ │ │ ├── main.js
│ │ │ ├── recorder.js
│ │ │ └── videoPlayer.js
│ │ └── scss/
│ ├── controllers/
│ │ ├── userController.js
│ │ └── videoController.js
│ ├── models/
│ │ ├── Comment.js
│ │ ├── User.js
│ │ └── Video.js
│ ├── routers/
│ │ ├── apiRouter.js
│ │ ├── rootRouter.js
│ │ ├── userRouter.js
│ │ └── videoRouter.js
│ ├── views/
│ │ ├── mixins/
│ │ │ ├── message.pug
│ │ │ └── video.pug
│ │ ├── partials/
│ │ │ ├── footer.pug
│ │ │ ├── header.pug
│ │ │ └── social-login.pug
│ │ ├── user/
│ │ │ ├── change-password.pug
│ │ │ ├── edit-profile.pug
│ │ │ ├── join.pug
│ │ │ ├── login.pug
│ │ │ └── profile.pug
│ │ ├── video/
│ │ │ ├── edit.pug
│ │ │ ├── search.pug
│ │ │ ├── upload.pug
│ │ │ └── watch.pug
│ │ ├── base.pug
│ │ ├── home.pug
│ │ └── 404.pug
│ ├── db.js
│ ├── init.js
│ ├── middlewares.js
│ └── server.js
-
User Authentication:
- Sign up, log in, and log out functionality
- GitHub login integration
-
User Profile:
- Edit profile
- Change password
-
Video Management:
- Upload videos
- Edit and delete videos
- View video details and comments
- Video search functionality
-
Comments:
- Add and delete comments on videos
-
Responsive Design:
- Mobile-friendly interface
GET /join
: Display the sign-up pagePOST /join
: Handle sign-up form submissionGET /login
: Display the login pagePOST /login
: Handle login form submissionGET /users/logout
: Log out the current userGET /users/edit
: Display the edit profile pagePOST /users/edit
: Handle profile edit form submissionGET /users/change-password
: Display the change password pagePOST /users/change-password
: Handle change password form submissionGET /users/github/start
: Start GitHub login processGET /users/github/finish
: Complete GitHub login processGET /users/:id
: Display a user's profile
GET /
: Display the home page with all videosGET /videos/upload
: Display the video upload pagePOST /videos/upload
: Handle video upload form submissionGET /videos/:id
: Watch a videoGET /videos/:id/edit
: Display the edit video pagePOST /videos/:id/edit
: Handle video edit form submissionGET /videos/:id/delete
: Delete a videoGET /search
: Search for videos
- GET / - Home page.
- GET /join - Get the sign-up page.
- POST /join - Register a new user.
- GET /login - Get the login page.
- POST /login - Log in a user.
- GET /search - Search for videos.
POST /api/videos/:id/view
: Register a video viewPOST /api/videos/:id/comment
: Add a comment to a videoDELETE /api/videos/:id/delete
: Delete a comment from a video
This project underwent formal testing using two black-box testing techniques:
- Finite-State Machine (FSM) Testing – Used to verify state transitions between different modules, ensuring correct system behavior.
- Input Domain Partitioning and Boundary Testing – Applied to validate input handling by partitioning input spaces and checking boundary conditions.
The testing identified several defects, which were classified using the Orthogonal Defect Classification (ODC) framework. The findings led to improvements in error handling, input validation mechanisms, and logic modifications. A comprehensive retest confirmed the effectiveness of these fixes.
For more details, refer to the Formal Testing Report: Finite-State Machine and Input Domain Partitioning Testing for a Video-Sharing Platform.
For any inquiries or feedback, please feel free to contact me:
- Email: [email protected]
- GitHub: WeTube Repository