Skip to content

petabridge/DrawTogether.NET

Repository files navigation

DrawTogether.NET

DrawTogether Logo

A collaborative browser-based drawing program written in .NET. Think of it like "multi-player MS paint."

Architecture and Motivation

Want to understand how DrawTogether was built and how it works? Please see our videos on the subject:

Running Locally

First things first, you will need to launch the dependencies for DrawTogether.NET - make sure you have docker installed locally - the easiest way to do this is with .NET Aspire:

dotnet run --project src/DrawTogether.AppHost/DrawTogether.AppHost.csproj

This will:

  • Start the SQL Server database
  • Run the migration service to initialize the database
  • Launch the DrawTogether web application
  • Open the Aspire dashboard in your browser

The Aspire dashboard will show you all running services with their statuses and endpoints.

Deployment

Out of the box DrawTogether.NET supports Kubernetes deployments, however, if you want to run it locally you'll need to make sure that you have Nginx Ingress enabled.

This is how to deploy the most recent version of Nginx Ingress on Docker Desktop at the time of writing this:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/deploy/static/provider/cloud/deploy.yaml

Next, you will need to build the Docker images for both the application and migration service:

dotnet publish --os linux --arch x64 -c Release -t:PublishContainer

This will tag local Docker images with the following labels:

  • drawtogether:latest and drawtogether:{VERSION}
  • drawtogether-migrationservice:latest and drawtogether-migrationservice:{VERSION}

The version number is pulled from Directory.Build.props and automatically applied during deployment.

Kustomize Deployment

The K8s manifests use Kustomize for configuration management:

  • Base configuration (k8s/base/): Contains all core Kubernetes manifests without version tags
  • Environment overlays:
    • k8s/overlays/local/: StatefulSet deployment with stable pod names
    • k8s/overlays/deployment/: Deployment-based configuration with reduced rebalancing overhead

Deployment Scripts

Deploy or Update Services

To deploy or update all services to your local Kubernetes cluster:

# Deploy with StatefulSet (default)
./k8s/deploy.ps1

# Deploy with Deployment strategy (reduced rebalancing during updates)
./k8s/deploy.ps1 -Strategy deployment

This script will:

  1. Extract the version from Directory.Build.props
  2. Build Docker images if they don't exist for the current version
  3. Update the Kustomize overlay with the current version
  4. Create the drawtogether namespace if needed
  5. Apply all Kubernetes manifests using Kustomize
  6. Wait for the rollout to complete (with zero-downtime rolling updates)

Deployment Strategies:

  • statefulset (default): Stable pod names, predictable scaling, more rebalancing during updates
  • deployment: Dynamic pod names, surge updates, less rebalancing overhead

This script is idempotent - run it for both initial deployment and updates. Kubernetes automatically performs zero-downtime rolling updates when you change the image version.

DrawTogether will be available at http://drawtogether.localdev.me

Destroy All Services

To remove all DrawTogether resources from Kubernetes:

./k8s/destroyAll.ps1

This deletes the entire drawtogether namespace and all resources within it.

Contributing

We welcome contributions! If you'd like to contribute to DrawTogether.NET, please see our Contributing Guide for information on:

  • Setting up your development environment
  • Working with Entity Framework migrations
  • Configuring optional features (email, etc.)
  • Running tests
  • Submitting pull requests

For questions or issues, please check the existing issues or create a new one.

About

Multi-player MS Paint application. Built with Akka.NET, Blazor, and .NET Aspire.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors 6