Skip to content

dezashibi/TodoExtractorBlazorWasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ TodoExtractor

Extract TODO:: items and markdown checklists from your source files β€” entirely in your browser. Nothing is uploaded to any server.

License .NET Blazor


✨ Features

  • πŸ“¦ Extract from ZIP β€” Upload a .zip archive and recursively find all TODO:: and [ ] / [x] patterns across every file inside
  • πŸ“„ Extract from Files β€” Select individual files directly
  • πŸ“‚ Load .todos Sessions β€” Load a previously saved session and continue working
  • ✨ Blank Canvas β€” Start fresh with custom groups and tasks
  • πŸ”„ Drag & Drop β€” Reorder tasks within and between groups
  • ✏️ Edit & Manage β€” Rename groups, add/remove/edit tasks, toggle completion
  • πŸ” Search/Filter β€” Quickly find tasks across all groups
  • πŸ’Ύ Save Sessions β€” Download your progress as a .todos JSON file for later
  • βœ… No Server Upload β€” All processing happens client-side via WebAssembly

πŸ–₯️ Screenshots

(Add screenshots here)

πŸ› οΈ Tech Stack

Technology Purpose
.NET 10 Runtime & SDK
Blazor WebAssembly Client-side SPA framework
C# 13 / .NET 10 Language & BCL
xUnit Unit testing
Bootstrap 5 CSS framework (grid only)

πŸš€ Getting Started

Prerequisites

  • .NET 10.0 SDK (or later)
  • A code editor (VS Code, Rider, Visual Studio 2022+)

Run Locally

# Clone the repository
git clone https://github.com/navidezashibi/TodoExtractor.git
cd TodoExtractor

# Restore dependencies
dotnet restore

# Run the app (opens at http://localhost:5251)
dotnet run --project src/TodoExtractor

Or use the Watch mode for hot reload during development:

dotnet watch --project src/TodoExtractor

Run Tests

dotnet test

πŸ“¦ Building for Production

# Publish the app in Release mode
dotnet publish src/TodoExtractor -c Release -o publish

The output will be in publish/wwwroot/ β€” a fully static site ready for deployment.

Build Output Overview

publish/wwwroot/
β”œβ”€β”€ _framework/          # .NET WebAssembly runtime & assemblies
β”œβ”€β”€ css/                 # Application styles
β”œβ”€β”€ lib/                 # Third-party libraries (Bootstrap)
β”œβ”€β”€ sample-data/         # Sample files
β”œβ”€β”€ index.html           # SPA entry point
β”œβ”€β”€ TodoExtractor.styles.css   # Scoped CSS
└── web.config           # IIS URL rewrite rules (for IIS hosts)

🌐 Deployment

Option 1: GitHub Pages

Deploying to GitHub Pages requires a few extra steps because Blazor WASM is a Single Page Application (SPA) served from a subpath.

Step 1: Configure Base HREF

For a repo at https://username.github.io/TodoExtractor/, the <base> tag in wwwroot/index.html must be updated to <base href="/TodoExtractor/" />.

The simplest way is to use the ghaction-rewrite-base-href action in your workflow β€” it automatically rewrites the base tag during CI.

Step 2: Add Required Files

  • .nojekyll β€” Create an empty file at the repo root. This tells GitHub Pages not to process the site with Jekyll (otherwise _framework/ is ignored).

  • .gitattributes β€” Add to repo root to prevent line-ending corruption of JavaScript/WebAssembly files:

    *.js   binary
    *.wasm binary
    

Step 3: Handle SPA Routing (404 Fallback)

GitHub Pages doesn't support server-side URL rewriting. Create a wwwroot/404.html with a redirect script, or use stevesandersonms/ghaction-rewrite-base-href which handles this automatically.

Step 4: GitHub Actions Workflow

Create .github/workflows/deploy.yml:

name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: "10.0.x"

      - name: Publish
        run: dotnet publish src/TodoExtractor -c Release -o release

      - name: Rewrite base href
        uses: SteveSandersonMS/ghaction-rewrite-base-href@v1.1.0
        with:
          html_path: release/wwwroot/index.html
          base_href: /TodoExtractor/

      - name: Deploy to GitHub Pages
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: release/wwwroot
          branch: gh-pages

Note: Replace TodoExtractor with your actual repository name in the base_href above.

Option 2: Shared Hosting (cPanel, Plesk, FTP)

Blazor WASM produces a static site β€” no server-side runtime is needed. Simply upload the compiled files.

Quick Steps

  1. Publish the app:

    dotnet publish src/TodoExtractor -c Release -o publish
  2. Upload the contents of publish/wwwroot/ to your web root (e.g., public_html/, httpdocs/, or /var/www/html/).

  3. Configure SPA fallback (required for direct URL navigation / page refresh to work):

    IIS / Windows Hosting

    The publish process generates a web.config with URL Rewrite rules. Ensure the URL Rewrite Module is installed on your IIS server. If it's not, contact your hosting provider.

    The generated web.config contains:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="SPA Fallback" stopProcessing="true">
              <match url=".*" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              </conditions>
              <action type="Rewrite" url="/" />
            </rule>
          </rules>
        </rewrite>
        <staticContent>
          <mimeMap fileExtension=".wasm" mimeType="application/wasm" />
          <mimeMap fileExtension=".br" mimeType="application/brotli" />
        </staticContent>
      </system.webServer>
    </configuration>
    Apache / Linux Hosting

    Remove the auto-generated web.config and create an .htaccess file in your web root:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.html [L]
    
    # MIME types for Blazor WASM
    AddType application/wasm .wasm
    AddType application/brotli .br
    Nginx
    location / {
        try_files $uri $uri/ /index.html =404;
    }
    
    location ~ \.wasm$ {
        add_header Content-Type application/wasm;
    }
  4. Verify MIME types β€” Ensure your server serves .wasm files with Content-Type: application/wasm. Check the browser's Network tab if the app fails to load.

Common Pitfalls

Problem Likely Cause Fix
Blank page, no errors Missing .wasm MIME type Add application/wasm to server config
404 on page refresh No SPA fallback rule Add URL rewrite rule (see above)
_framework failing to load Jekyll processing (GitHub Pages) Add .nojekyll file
Integrity check failure Git changed line endings of .js files Add *.js binary to .gitattributes

πŸ“ Project Structure

TodoExtractor/
β”œβ”€β”€ docs/
β”‚   └── Intro.md              # Original project documentation
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ edge-cases/           # Edge case test data
β”‚   β”œβ”€β”€ languages/            # Language-specific examples
β”‚   β”œβ”€β”€ mixed/                # Mixed format examples
β”‚   β”œβ”€β”€ project-structure/    # Full project example with TODOs
β”‚   β”œβ”€β”€ simple/               # Simple test data
β”‚   └── todos-output/         # Sample .todos output file
β”œβ”€β”€ src/
β”‚   └── TodoExtractor/        # Blazor WebAssembly app
β”‚       β”œβ”€β”€ Layout/           # App layout (MainLayout)
β”‚       β”œβ”€β”€ Models/           # Data models (TodoTask, TaskGroup, etc.)
β”‚       β”œβ”€β”€ Pages/            # Razor pages (Home, Board)
β”‚       β”œβ”€β”€ Services/         # Application services
β”‚       β”œβ”€β”€ wwwroot/          # Static assets
β”‚       └── Program.cs        # Entry point
β”œβ”€β”€ tests/
β”‚   └── TodoExtractor.Tests/  # xUnit unit tests
β”œβ”€β”€ .gitignore
β”œβ”€β”€ TodoExtractor.slnx        # Solution file
└── README.md                 # This file

πŸ§ͺ Testing

The project uses xUnit with 41+ tests covering:

  • Task extraction from text (TODO:: and checklist patterns)
  • File parsing and grouping
  • Session serialization/deserialization round-trip
  • Group CRUD operations (create, rename, delete, uniqueness)
  • Session lifecycle management

Run tests:

dotnet test

πŸ§‘β€πŸ’» Author

Navid Dezashibi

πŸ“„ License

Copyright (c) 2026 Navid Dezashibi

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

Portfolio project for todo extraction service via WASM blazor app

Topics

Resources

License

Stars

Watchers

Forks

Contributors