Skip to content

Commit e4bdbe5

Browse files
author
szjanikowski
committed
Updated 'Getting Started' section after going through the whole tutorial on Grandnode2
1 parent 0ab2bd5 commit e4bdbe5

4 files changed

Lines changed: 81 additions & 55 deletions

File tree

docs/quick-start.md

Lines changed: 81 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 1
33
---
44

5-
# Quick Start
5+
# Getting Started
66

77
This practical tutorial will walk you through configuring Noesis step by step. After completing it, you'll be able to **see** - "See how your system REALLY works" 🙂
88

@@ -154,7 +154,9 @@ namespace NoesisConfig
154154
}
155155
```
156156

157-
Play with the DSL if you want. You should be able additional versions of methods e.g. allowing to specify repository branch (which might be useful if your primary branch is not `main`). Check if the project correctly compiles
157+
Play with the DSL if you want. You should be able additional versions of methods e.g. allowing to specify repository branch (which might be useful if your primary branch is not `main`). You may add multiple configuration files - they will be recognized by Noesis as separate systems to scan.
158+
159+
Check if the project correctly compiles - otherwise Noeis won't be able to work with it.
158160

159161
``` bash
160162
dotnet build
@@ -204,7 +206,9 @@ docker run \
204206
[10:05:15 INF] Full analysis for system DDD Starter Dotnet finished in 62.92s.
205207
```
206208
3. Go back to the main page and click "Basic mode" to view the scan results. Choose your result.
207-
4. Click **Modules** view - you should see modules created from your project's namespaces in the tree on the left, after you expand it
209+
4. Click **Modules** view - you should see modules created from your project's namespaces in the tree on the left, after you expand it. Here's how it may look like:
210+
211+
![Modules tree view](/img/modules.png)
208212
209213
210214
@@ -214,46 +218,55 @@ docker run \
214218
215219
Now we'll add entry points configuration - entry points to your system's business logic. These often correspond to REST API endpoints or command handling methods.
216220
221+
:::info
222+
From now on, it might be worth knowing that **the architecture conventions examples presented in the code-snippets below were created according to the architecture of an opensource project [Grandnode2](https://github.com/grandnode/grandnode2)**. This information might help you compare what is the exact application code corresponding to the presented usages of Noesis DSL. In addition you can find a full configuration for this projects in our examples repository on [Github](https://github.com/NoesisVision)
223+
:::
224+
217225
### 5.1: Add Entry Points Configuration
218226
219227
Update `ArchitectureConventions.cs`, adding entry points configuration. The configuration depends on your project patterns, but if you use typical `CommandHandlers` with method `Handle` it may look like that:
220228
221229
```csharp
222-
using Noesis.Parser;
230+
using Noesis.Parser.CodeParsing.Configuration;
231+
using Noesis.Parser.Configuration;
232+
using Noesis.Tags;
223233
224234
namespace NoesisConfig
225235
{
226-
[FullAnalysisConfig]
227-
public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
228-
.System("My System")
229-
.Repositories(repositories => repositories
230-
.UseLocal("Main", "../my-system-repo"))
231-
.Conventions(conventions => conventions
232-
.ForDomainModules(convention => convention
233-
.UseNamespaceHierarchy())
234-
// Add Entry Points configuration
235-
.ForDomainBehaviors(NoesisTags.Domain.EntryPoint, convention => convention
236-
.UseMethods() // Analyze individual methods
237-
.FromTypes(types => types
238-
.OfKind(TypeKind.Class) // Only classes
236+
public static class Grandnode2Config
237+
{
238+
[FullAnalysisConfigAttribute]
239+
public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
240+
.System("My System") // System name in documentation
241+
.Repositories(repositories => repositories
242+
.UseLocal("Main", "my-system-repo")) // Path to your repository relative to externalSources dir
243+
.Conventions(conventions => conventions
244+
.ForDomainModules(convention => convention
245+
.UseNamespaceHierarchy())
246+
// Add Entry Points configuration
247+
.ForDomainBehaviors(NoesisTags.Domain.EntryPoint, convention => convention
248+
.UseMethods() // Analyze individual methods
249+
.FromTypes(types => types
250+
.OfKind(TypeKind.Class) // Only classes
239251
.WithNameEndingWith("CommandHandler")) // Handler naming convention
240252
.WithName("Handle") // Method must be named "Handle"
241253
.SetName(method =>
242-
$"{method.ContainingType.Name.Replace("CommandHandler", string.Empty)}"
243-
.Humanize(LetterCasing.Title))) // Create readable behavior name
244-
.Build();
254+
$"{method.ContainingType.Name.Replace("CommandHandler", string.Empty)}") // Create readable behavior name
255+
)) // Creates modules from namespaces
256+
.Build();
257+
}
245258
}
246259
```
247-
For more options on how to configure entry point detection please refer to the [Conventions Documentation](configure.md#entry-points-configuration)
260+
For more options on how to configure entry point detection please refer to the [Conventions Documentation](configure.md#entry-points-configuration). You may also check available
248261

249262
### 5.2: Run with Entry Points Configuration
250263

251-
Run the container again with updated configuration.
264+
At the moment, you need to restart container after every configuration change (we are plan to improve it in the near future).
252265

253266
```bash
254267
docker run \
255-
-v ../noesis-config:/externalConfig:ro \
256-
-v ../my-system-repo:/externalSources:ro \
268+
-v $(pwd)/../git-repos/noesis-config:/externalConfig:ro \
269+
-v $(pwd)/../git-repos:/externalSources:ro \
257270
-v ./data:/data \
258271
-v ./license.jwt:/license.jwt:ro \
259272
-p 8088:8080 \
@@ -263,9 +276,13 @@ docker run \
263276

264277
### 5.3: Verify Entry Points
265278

266-
1. Run a new scan
267-
2. Go to the **Entry Points** section - you should see Handle methods inside modules in the tree on the left
268-
3. Check if entry points are assigned to appropriate modules
279+
1. Open `http://localhost:8088`
280+
2. Click "Analyze" an run a scan of your repository - the scanning may take a while - check logs for details and potential errors.
281+
3. Go back to the main page and click "Basic mode" to view the scan results. Choose your result.
282+
4. Click **Entry Points** view - you should see entry points organizsed in modules in the tree on the left, after you expand it.
283+
284+
Here's how it may look like:
285+
![Entry points view](/img/entry-points.png)
269286

270287
🎉 **Third Success!** Noesis recognized entry points to your system and shows them in appropriate modules.
271288

@@ -278,34 +295,40 @@ Finally, we'll add services configuration - business components used by entry po
278295
Update `ArchitectureConventions.cs`, adding services configuration:
279296

280297
```csharp
281-
using Noesis.Parser;
298+
using Noesis.Parser.CodeParsing.Configuration;
299+
using Noesis.Parser.Configuration;
300+
using Noesis.Tags;
282301

283302
namespace NoesisConfig
284303
{
285-
[FullAnalysisConfig]
286-
public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
287-
.System("My System")
288-
.Repositories(repositories => repositories
289-
.UseLocal("Main", "../my-system-repo"))
290-
.Conventions(conventions => conventions
291-
.ForDomainModules(convention => convention
292-
.UseNamespaceHierarchy())
293-
.ForDomainBehaviors(NoesisTags.Domain.EntryPoint, convention => convention
294-
.UseMethods() // Analyze individual methods
295-
.FromTypes(types => types
296-
.OfKind(TypeKind.Class) // Only classes
304+
public static class Grandnode2Config
305+
{
306+
[FullAnalysisConfigAttribute]
307+
public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
308+
.System("My System") // System name in documentation
309+
.Repositories(repositories => repositories
310+
.UseLocal("Main", "my-system-repo")) // Path to your repository relative to externalSources dir
311+
.Conventions(conventions => conventions
312+
.ForDomainModules(convention => convention
313+
.UseNamespaceHierarchy())
314+
// Add Entry Points configuration
315+
.ForDomainBehaviors(NoesisTags.Domain.EntryPoint, convention => convention
316+
.UseMethods() // Analyze individual methods
317+
.FromTypes(types => types
318+
.OfKind(TypeKind.Class) // Only classes
297319
.WithNameEndingWith("CommandHandler")) // Handler naming convention
298-
.WithName("Handle") // Method must be named "Handle"
299-
.SetName(method =>
300-
$"{method.ContainingType.Name.Replace("CommandHandler", string.Empty)}"
301-
.Humanize(LetterCasing.Title))) // Create readable behavior name
302-
// Add Services configuration
303-
.ForDomainObjects(NoesisTags.Domain.Service, convention => convention
304-
.UseTypes() // Analyze types
305-
.WithNameEndingWith("Service") // Interfaces ending with "Service"
306-
.SetName(type => type.Name[1..]))) // Remove "I" prefix
307-
.Build();
320+
.WithName("Handle") // Method must be named "Handle"
321+
.SetName(method =>
322+
$"{method.ContainingType.Name.Replace("CommandHandler", string.Empty)}"))
323+
// Add Services configuration
324+
.ForDomainObjects(NoesisTags.Domain.Service, convention => convention
325+
.UseTypes() // Analyze types
326+
.WithNameEndingWith("Service") // Interfaces ending with "Service"
327+
.SetName(type => type.Name[1..]))) // Remove "I" prefix
328+
.Build();
329+
}
308330
}
331+
309332
```
310333

311334
### 6.2: Run with Full Configuration
@@ -314,8 +337,8 @@ Run the container with complete configuration:
314337

315338
```bash
316339
docker run \
317-
-v ../noesis-config:/externalConfig:ro \
318-
-v ../my-system-repo:/externalSources:ro \
340+
-v $(pwd)/../git-repos/noesis-config:/externalConfig:ro \
341+
-v $(pwd)/../git-repos:/externalSources:ro \
319342
-v ./data:/data \
320343
-v ./license.jwt:/license.jwt:ro \
321344
-p 8088:8080 \
@@ -325,10 +348,12 @@ docker run \
325348

326349
### 6.3: Verify Complete Visualization
327350

328-
1. Run final scan
351+
1. Run the final scan
329352
2. Go to the **Entry Points** section in the newest scan result and click a plus icon of the entry points - you should see services from your system used by this entry point.
330353
3. Add another entry point from the list which potentially share some services with the first one. You should see what are the common services
331354

355+
![Services view](/img/services.png)
356+
332357
🎉 **Great Success!** You now have completed a first basic visualization of your system!
333358

334359
## What You've Achieved
@@ -361,7 +386,8 @@ Now that you have basic visualization, you can:
361386

362387
## Need Help?
363388

389+
- Get instant help on our [Discord server](https://discord.gg/QF5PMX4Dqg)
364390
- Check the [full installation guide](/docs/setup)
365391
- Review [configuration examples](/docs/configure)
366-
- Visit our [GitHub repository](https://github.com/noesisvision/noesis)
367-
- Join our [Discord community](https://discord.gg/QF5PMX4Dqg)
392+
- Visit our [GitHub repository](https://github.com/noesisvision)
393+

static/img/entry-points.png

215 KB
Loading

static/img/modules.png

127 KB
Loading

static/img/services.png

680 KB
Loading

0 commit comments

Comments
 (0)