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
- π¦ 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:
- Type: Virtual Machine
- Size: VPS 1/1/10
- CPU: 1 vCore
- RAM: 1 GB
- Storage: 10 GB NVMe SSD
Development environment deployment is available at:
- Frontend: http://20.119.85.209/
- API Documentation: http://20.119.85.209: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.0
# Structure
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
# Example
feat(auth): implement multi-factor authentication
- Add SMS verification
- Implement authenticator app support
- Add backup codes generation
Closes #123
# Run API
cd src/Presentations/OnForkHub.Api
dotnet watch run
# Run WebUI
cd src/Presentations/OnForkHub.Web
dotnet watch run
After 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.Scripts
dtn <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
-p
command 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.