What is in this solution?
Map. Every project is a zone. Lines between zones show which project uses which, and how often. Open a zone to see its namespaces and types.
Sightline reads your code and draws how it fits together: projects, dependency injection, endpoints, and the path each request takes down to the database. Change the code and the map changes with it.
dnx Co.Revington.Sightline
Run it in a folder with a .sln and the map opens. Nothing gets installed. Needs the .NET 10 SDK. Version 0.2.0 on NuGet, free and open source under the MIT license.
This is the real interface, running in your browser on a recording of the sample shop solution from the repository.
Loading the demo. Open it full screen
Map. Every project is a zone. Lines between zones show which project uses which, and how often. Open a zone to see its namespaces and types.
Flow. Pick an endpoint and read the request as numbered steps: handler, services, repositories, then the database or an outbound HTTP call. A call on an interface continues in the class registered for it.
Focus. One type in the middle, between everything that uses it and everything it uses. That includes callers that only reach it through an interface.
The map uses one line style per kind of relationship. This is the legend, and also the list of what Sightline detects.
Send or Publish reaches the handler for that message, MediatR style.HttpClient.Type in the code panel and the map updates before you save. The unsaved text is analyzed in memory, and nothing touches your file until you choose Save file.
Prefer your own editor? Keep it. Save a file in Visual Studio, Rider or VS Code and the map follows. With auto-save on, it follows as you type.
A strip at the bottom of the page reports what each edit changed. For example:
GetOrder.cs + GetOrderHandler.Handle calls IOrderRepository.SaveAsync
On the sample solution an edit reaches the map in well under a tenth of a second. Larger solutions have not been measured yet.
Do it once in your repository. Everyone who clones it then gets the same version and the same settings, with nothing to install by hand.
dnx Co.Revington.Sightline init
Run it in the folder with your .sln. It pins Sightline in dotnet-tools.json, writes sightline.json, and adds a VS Code task when the folder uses VS Code.
dotnet sightline
Works from any folder in the repository. Packages are restored first when needed. Press / in the map to find a class, method or endpoint.
Commit dotnet-tools.json and sightline.json. Teammates run dotnet tool restore once, then dotnet sightline.
sightline.json names the solution to open and the projects to leave off the map, such as tests or samples that would crowd it. Editors that read JSON schemas suggest the settings as you type.
Just for yourself? dotnet tool install --global Co.Revington.Sightline, then run sightline in any solution folder.
sightline.json{
"$schema": "https://sightline.revington.co/sightline.schema.json",
"solution": "Shop.sln",
"exclude": ["*.Tests", "samples"]
}
Sightline runs locally and sends nothing anywhere. Its page is served on localhost only, every request needs a token created at start, and only files that belong to the loaded solution can be read or saved.