Record a selected area with presets, hotkeys, and live stats.
The repository now separates the codebase into two main parts:
website/– ASP.NET Core web application.extension/– Chrome extension files. The solution fileMyWebApp.slnresides inwebsite/.
After cloning the repository, execute the setup script to restore all dependencies:
./setup.sh
# On Windows you can run ./setup.ps1 insteadThe script runs dotnet restore website/MyWebApp.sln followed by
libman restore in website/MyWebApp to download the client-side
libraries, including the Quill editor used on the admin content pages.
All submitted HTML is sanitized on the server using the HtmlSanitizer
library before being stored.
appsettings.json contains the default connection string and the provider
selection used by the application:
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=MyWebAppDb;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"DatabaseProvider": "SqlServer"You can override these values in several ways:
- Create an
appsettings.{Environment}.jsonfile (for exampleappsettings.Production.json) containing a differentDefaultConnection. - Set the environment variable
ConnectionStrings__DefaultConnection. - Pass a command‑line argument
--ConnectionStrings:DefaultConnection="<your connection string>". - Set
DatabaseProvider(SqlServer,PostgreSQLorSqlite) using the same methods above.
Specify DatabaseProvider when switching providers; Program.cs will pick the correct Use* method automatically.
Connection strings built with ConnectionHelper add provider-specific optimizations. PostgreSQL enables pooling and prepared statements, SQLite uses a shared cache and enables WAL mode at startup, and SQL Server configures retries with a 60 second command timeout.
The schema is created automatically when the application starts using
EnsureCreated. Configure your connection string and provider as described
above and run:
cd website/MyWebApp
dotnet runOn first launch the database will be created and indexes added for the selected
provider. The /Setup page lets you test connections or switch providers and
will recreate the schema if necessary.
Unit tests live in the MyWebApp.Tests project inside the website folder.
To execute them locally run:
cd website
dotnet test MyWebApp.slnThis will build the solution and run all tests.
Reusable page blocks can be managed under the Blocks section of the admin
panel. Each block stores a fragment of HTML that can be inserted while editing a
page. When working in the page editor click inside a section so the Quill editor
is focused, then choose a block from the "Insert template" dropdown. The HTML is
loaded from /AdminBlockTemplate/Html/{id} and placed directly into the active
editor.
The extension source resides in the extension/ folder. Load this folder in
Chrome's extensions page when running the extension locally or packaging it.
- Navigate to the web application project and start the development server:
cd website/MyWebApp
dotnet run-
With the site running, open your browser to
/Setupto confirm the database connection can be established. The schema is created automatically at startup throughEnsureCreated()when a connection is available. -
For a quick reminder on how to import data manually, visit
/Setup/Importwhile the site is running. The page shows the shell commands used to run the project and seed sample data. -
Restart the application (or open
/Setup) after updating to ensure database upgrades like the navigation token are applied.