MiniTube is a WPF application designed to provide a seamless experience for browsing, searching, and viewing videos. With features such as personalized content, search functionality, and a dedicated studio view, MiniTube aims to simplify video interaction while maintaining a user-friendly interface.
-
Main Entry Point:
- The application starts with the
App.xaml
andApp.xaml.cs
files, setting up the app's lifecycle and resources.
- The application starts with the
-
MiniTube App Core:
- The app includes modules for user interaction, video playback, and video management.
-
User Authentication:
- Log in to access personalized video recommendations.
-
Video Browsing:
- Explore a randomized list of videos on the main screen.
-
Search Functionality:
- Find videos by entering titles or keywords in the search bar.
-
Video Playback:
- Click on a video to open a dedicated playback screen with essential controls.
-
Studio View:
- Upload and manage your videos in the studio view.
CREATE TABLE [dbo].[Users] (
[UserID] INT IDENTITY(1, 1) NOT NULL,
[Username] VARCHAR(255) NOT NULL,
[Email] VARCHAR(255) NOT NULL,
[Password] VARCHAR(255) NOT NULL,
[Role] VARCHAR(50) NOT NULL,
PRIMARY KEY CLUSTERED ([UserID] ASC)
);
CREATE TABLE [dbo].[Videos] (
[VideoID] INT IDENTITY(1, 1) NOT NULL,
[UserID] INT NOT NULL,
[Title] VARCHAR(255) NOT NULL,
[Description] TEXT NULL,
[Thumbnail] VARBINARY(MAX) NULL,
[VideoFile] VARBINARY(MAX) NULL,
[Keyword1] VARCHAR(100) NULL,
[Keyword2] VARCHAR(100) NULL,
[Keyword3] VARCHAR(100) NULL,
[UploadDate] DATETIME DEFAULT GETDATE() NULL,
[CommentsCount] INT DEFAULT 0 NULL,
[LikesCount] INT DEFAULT 0 NULL,
PRIMARY KEY CLUSTERED ([VideoID] ASC),
FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([UserID]) ON DELETE CASCADE
);
CREATE TABLE [dbo].[Comments] (
[CommentID] INT IDENTITY(1, 1) NOT NULL,
[VideoID] INT NOT NULL,
[UserID] INT NOT NULL,
[CommentText] VARCHAR(MAX) NULL,
[CommentDate] DATETIME DEFAULT GETDATE() NULL,
PRIMARY KEY CLUSTERED ([CommentID] ASC),
FOREIGN KEY ([VideoID]) REFERENCES [dbo].[Videos] ([VideoID]) ON DELETE CASCADE,
FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([UserID]) ON DELETE NO ACTION
);
CREATE TABLE [dbo].[Likes] (
[LikeID] INT IDENTITY(1, 1) NOT NULL,
[UserID] INT NOT NULL,
[VideoID] INT NOT NULL,
[LikedDate] DATETIME DEFAULT GETDATE() NULL,
PRIMARY KEY CLUSTERED ([LikeID] ASC),
FOREIGN KEY ([VideoID]) REFERENCES [dbo].[Videos] ([VideoID]) ON DELETE CASCADE,
FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([UserID]) ON DELETE NO ACTION
);
CREATE TRIGGER trg_UpdateCommentsCount
ON dbo.Comments
AFTER INSERT
AS
BEGIN
-- Update the CommentsCount for the video associated with the newly inserted comment
DECLARE @VideoID INT;
-- Get the VideoID from the inserted comment
SELECT @VideoID = VideoID FROM inserted;
-- Update the CommentsCount for the specified VideoID
UPDATE dbo.Videos
SET CommentsCount = (SELECT COUNT(*) FROM dbo.Comments WHERE VideoID = @VideoID)
WHERE VideoID = @VideoID;
END;
CREATE TRIGGER trg_UpdateCommentsCountOnDelete
ON dbo.Comments
AFTER DELETE
AS
BEGIN
-- Update the CommentsCount for the video associated with the deleted comment
DECLARE @VideoID INT;
-- Get the VideoID from the deleted comment
SELECT @VideoID = VideoID FROM deleted;
-- Update the CommentsCount for the specified VideoID
UPDATE dbo.Videos
SET CommentsCount = (SELECT COUNT(*) FROM dbo.Comments WHERE VideoID = @VideoID)
WHERE VideoID = @VideoID;
END;
-
Database Setup:
Create the required database tables using the provided SQL scripts in the "Database Design" section.
-
Scaffold the Database Context:
Use the following command to scaffold the Entity Framework Core DbContext:
Scaffold-DbContext 'Server=YOUR_SERVER_NAME;Database=MiniTube;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force
Replace
YOUR_SERVER_NAME
with your SQL Server instance (e.g.,DESKTOP-I6UBJ5U\SQLEXPRESS
).
-
Clone the Repository:
git clone https://github.com/MalikShujaatAli/MiniTube.git
-
Open the Solution:
- Launch the project in Visual Studio.
-
Restore Dependencies:
- Use NuGet to restore all required packages.
-
Build the Solution:
- Ensure the solution builds without errors.
-
Run the Application:
- Start the app to explore its functionality.
-
Launch the Application:
- Open MiniTube and log in using your credentials.
-
Browse Video Content:
- Explore the home screen for a curated list of videos.
-
Search for Videos:
- Use the search bar to find specific videos by title or keyword.
-
Play Videos:
- Select a video to navigate to its playback screen.
-
Access the Studio View:
- Upload and manage your videos in the dedicated studio interface.
-
View:
- Contains WPF windows and user controls for UI presentation.
-
Model:
- Defines the data structure and manages interactions with the database context.
-
ViewModel:
- Acts as the bridge between the view and model, handling data binding and business logic.
Contributions are welcome! To contribute:
- Fork the Repository.
- Create a Feature Branch.
- Commit Your Changes.
- Push to Your Branch.
- Create a Pull Request.
- Thanks to the contributors and the community for their valuable feedback.
- Special thanks to the tools and frameworks that made this project possible.