OnForkHub is a cutting-edge video-sharing platform that combines traditional CDN delivery with P2P distribution through WebTorrent. Supporting videos up to 2 minutes, it offers:
- 🚀 Hybrid content delivery (CDN + P2P)
- 📱 Responsive web interface
- 🔒 Secure authentication
- 🎬 Automatic video transcoding
- 📊 Analytics and monitoring
- 🎯 Backend: .NET 9 with ASP.NET Core
- 🌐 Frontend: Blazor WebAssembly
- 💾 Databases: RavenDB, CosmosDB, SQL Server
- 📦 Storage: Azure Blob Storage/AWS S3
- 🔄 P2P: WebTorrent
- 🐳 Containers: Docker
- 📝 IDE: Visual Studio 2022/VS Code
- 🔨 Version Control: Git + Git Flow
- 🎨 Code Style: CSharpier
- 🐶 Git Hooks: Husky
- 🔍 CI/CD: GitHub Actions
-
Visual Studio
- GitFlow for Visual Studio 2022
- CSharpier
-
VS Code
- C# Dev Kit
- GitLens
- Git Flow
- CSharpier
The project has been successfully deployed and tested on a minimal VPS configuration from Azure free tier:
Development environment deployment is available at:
- Frontend: http://172.245.152.43/
- API Documentation: http://172.245.152.43:9000/swagger/index.html
The deployment uses Docker with a reverse proxy configuration:
- Frontend accessible on port 80
- API accessible on port 9000
proxy.yml: Nginx reverse proxy setupcustom.conf: Nginx configurationservices.yml: Application services configuration
- Install and Configure GitHub CLI
# Download and install GitHub CLI from https://cli.github.com/
# Then configure:
gh auth login
gh auth status # Verify authentication- Clone and Setup Repository
# Clone using GitHub CLI
gh repo clone RondineleG/OnForkHub
cd OnForkHub
# Build and configure project (includes .NET tools and Husky setup)
dotnet build && dotnet husky run- Setup Local Environment
# Install dependencies
dotnet build && dotnet husky run
# Build solution
dotnet build
# Setup development certificates
dotnet dev-certs https --trust-
If you are using Dev Container extension for VS Code or Visual Studio, just reopen the folder inside the container
-
If you aren't using Dev Container extension:
./.devcontainer/devcontainer_setup.sh
OR
docker build -t on-fork-hub -f .devcontainer/Dockerfile .
docker run --rm -it -v $(pwd):/app -w /app on-fork-hub bash
# inside the container
./.devcontainer/post_created_commands.sh
OR
dotnet dev-certs https --trust
dotnet tool restore
dotnet husky install
dotnet restore
dotnet build
dotnet husky run
We follow Git Flow with kebab-case naming convention for all branches (using lowercase letters and hyphens). This ensures:
- Better readability in URLs and command line
- Compatibility across different operating systems
- Consistency with Git Flow conventions
- Avoidance of case-sensitivity issues
# Branch Types and Naming Convention
main # Production branch
dev # Development branch
feature/ # New features (e.g., feature/add-user-auth)
hotfix/ # Production fixes (e.g., hotfix/fix-login-bug)
release/ # Release preparation (e.g., release/v1.2.0)
bugfix/ # Non-urgent fixes (e.g., bugfix/improve-error-handling)
# Start new feature
git flow feature start add-user-auth
# Publish feature
git flow feature publish add-user-auth
# Complete feature and create an automatic Pull Request
git flow feature finish add-user-auth
# Start hotfix
git flow hotfix start fix-login-bug
# Start release
git flow release start v1.2.0git config --global commit.template .\gitmessage.md# Structure
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
# Example
# feat – new features
feat(auth): implement multi-factor authentication
- Add SMS verification
- Implement authenticator app support
- Add backup codes generation
Closes #123
# fix – Bug fixes
fix(api): correct null pointer exception on login
- Added null checks for user data
- Improved error response format
Fixes #410
# refactor – Code improvements without changes in behavior
refactor(core): simplify validation logic
- Replaced nested conditions with early returns
git commit -m "feat(auth): implement passwordless login"
git commit -m "fix(api): correct null pointer exception"
git commit -m "docs(readme): add setup instructions for Windows"# Run API
cd src/Presentations/OnForkHub.Api
dotnet watch run
# Run WebUI
cd src/Presentations/OnForkHub.Web
dotnet watch runAfter setting up the project, you will have access to convenient Git aliases. They become available after restarting your terminal or running . $PROFILE in your terminal:
# Git Aliases Quick Reference
gs # git status -sb (shows clean branch status)
ga # git add --all (stages all changes)
gc -m "message" # git commit with message
gps # git push
gpl # git pull
gf # git fetch
# Branch Management
gb # git branch
gco # git checkout
# Log & History
gl -n # git log with nice formatting (e.g. gl -20 for last 20 commits)
gt -n # git tree view (e.g. gt -10 for last 10 commits)
gd # git diff (shows uncommitted changes)
gr # git remote -v (shows remote repositories)The dtn CLI tool is a development utility for OnForkHub that helps with package management and pull request creation.
The CLI tool is automatically installed when you build the project. To manually install or update:
cd src/Shared/OnForkHub.Scripts
dotnet pack
dotnet tool update -g --add-source ./nupkg OnForkHub.Scriptsdtn <command> [options]-
Package Management
# Install package directly dtn -i <package> [-v version] # Example: dtn -i Serilog -v 3.* # Search and install packages interactively dtn -s [searchTerm] # Example: dtn -s Newtonsoft
-
Pull Requests
# Create pull request dtn -p # Creates PR from current feature branch to dev
-
Help
# Show help dtn -h # Display available commands and examples
# Install specific package version
dtn -i Microsoft.EntityFrameworkCore -v 9.0.0
# Search for logging packages
dtn -s Serilog
# Interactive package selection example:
Found packages:
[INFO] 0: Serilog (Latest: 4.1.0)
[INFO] 1: Serilog.Sinks.File (Latest: 6.0.0)
# Enter selection: 0 4.*, 1 6.*
# Create pull request for current feature branch
dtn -p- Package installations are always targeted to
src/Shared/OnForkHub.Dependencies/OnForkHub.Dependencies.csproj - The
-pcommand requires a clean git working tree - Version patterns (like
3.*) are supported for package installation
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git flow feature start FeatureName) - Commit your changes using Conventional Commits
- Push to the branch (
git flow feature publish FeatureName) - Open a Pull Request in GitHub manually, or use (
git flow feature finish FeatureName) to create an automatic Pull Request
# Reset authentication
gh auth logout
gh auth login
# Verify status
gh auth status# Reinitialize Git Flow
git flow init -f
# Check configuration
git config --list | findstr "gitflow"# Clean solution
dotnet clean
# Clear NuGet cache
dotnet nuget locals all --clear
# Rebuild
dotnet build --no-incremental- 📧 Email: rondineleg@gmail.com
- 💬 Telegram: Join Our Server
- 🐛 Issues: GitHub Issues
Copyright © 2024 OnForkHub - Released under the MIT License.