|
2 | 2 |
|
3 | 3 | This guide will help you set up your local development environment for working on the Essential C# Web project. |
4 | 4 |
|
5 | | -## What You Will Need |
| 5 | +## Prerequisites |
6 | 6 |
|
7 | 7 | - [Visual Studio](https://visualstudio.microsoft.com/) (or your preferred IDE) |
8 | | -- [.NET 10.0 SDK](https://dotnet.microsoft.com/download) |
9 | | - - If you already have .NET installed you can check the version by typing `dotnet --info` into cmd to make sure you have the right version |
| 8 | +- [.NET 10.0 SDK](https://dotnet.microsoft.com/download) — verify with `dotnet --info` |
10 | 9 |
|
11 | | -## Startup Steps |
| 10 | +## Minimal Local Setup |
12 | 11 |
|
13 | | -To get the site that is seen at [essentialcsharp.com](https://essentialcsharp.com/): |
| 12 | +For basic browsing and UI development, no secrets are needed. The database connection and HCaptcha test keys are already configured in `appsettings.Development.json`. |
14 | 13 |
|
15 | | -1. Clone Repository locally. |
16 | | -2. Set any needed secrets |
17 | | -3. If you have do not have access to the private nuget feed, change the line `<AccessToNugetFeed>true</AccessToNugetFeed>` to `<AccessToNugetFeed>false</AccessToNugetFeed>` in [Directory.Packages.props](https://github.com/IntelliTect/EssentialCSharp.Web/blob/main/Directory.Packages.props). |
| 14 | +1. Clone the repository. |
| 15 | +2. If you have access to the private NuGet feed, set `<AccessToNugetFeed>true</AccessToNugetFeed>` in [Directory.Packages.props](../Directory.Packages.props). |
| 16 | +3. Run the project. |
18 | 17 |
|
19 | | -## Environment Prerequisites |
| 18 | +> **Tip:** Use the [dotnet secret manager](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets#set-a-secret) for any secrets below: |
| 19 | +> `dotnet user-secrets set "<Key>" "<Value>" --project EssentialCSharp.Web` |
20 | 20 |
|
21 | | -Make sure the following secrets are set: |
22 | | -In local development this ideally should be done using the dotnet secret manager. Additional information can be found at the [documentation](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets#set-a-secret) |
| 21 | +## Optional Features |
23 | 22 |
|
24 | | -AuthMessageSender:SendFromName = "Hello World Team" |
25 | | -AuthMessageSender:SendFromEmail = "no-reply@email.com" |
26 | | -AuthMessageSender:SecretKey = alongstringofsecretsauce |
27 | | -AuthMessageSender:APIKey = anapikey |
28 | | -Authentication:Microsoft:ClientSecret = anotherimportantsecret |
29 | | -Authentication:Microsoft:ClientId = anotherimportantclient |
30 | | -Authentication:github:clientSecret = anotherimportantclientsecret |
31 | | -Authentication:github:clientId = anotherimportantclientid |
32 | | -HCaptcha:SiteKey = captchaSiteKey |
33 | | -HCaptcha:SecretKey = captchaSecretKey |
34 | | -APPLICATIONINSIGHTS_CONNECTION_STRING = "InstrumentationKey=your-instrumentation-key-here;IngestionEndpoint=https://region.in.applicationinsights.azure.com/;LiveEndpoint=https://region.livediagnostics.monitor.azure.com/" |
| 23 | +These features are disabled or use safe defaults in Development unless explicitly configured. |
35 | 24 |
|
36 | | -### Testing Secret Values |
| 25 | +### AI Chat |
37 | 26 |
|
38 | | -Some Value Secrets for Testing/Development Purposes: |
39 | | -HCaptcha: https://docs.hcaptcha.com/#integration-testing-test-keys |
| 27 | +Required to enable the chat widget. Skipped entirely in Development if not configured. |
| 28 | + |
| 29 | +``` |
| 30 | +AIOptions:Endpoint = https://<your-azure-openai-resource>.openai.azure.com/ |
| 31 | +AIOptions:VectorGenerationDeploymentName = text-embedding-3-large-v1 |
| 32 | +AIOptions:ChatDeploymentName = gpt-4o |
| 33 | +ConnectionStrings:PostgresVectorStore = <postgres-connection-string> |
| 34 | +``` |
| 35 | + |
| 36 | +### MCP Server |
| 37 | + |
| 38 | +The MCP endpoint (`/mcp`) is always running. To generate tokens via the Account > MCP Access page, no additional config is needed — tokens are stored in the local database. |
| 39 | + |
| 40 | +### TryDotNet Integration |
| 41 | + |
| 42 | +``` |
| 43 | +TryDotNet:Origin = https://<trydotnet-origin> |
| 44 | +``` |
| 45 | + |
| 46 | +### Telemetry |
| 47 | + |
| 48 | +Use one of these — not both simultaneously (they conflict). |
| 49 | + |
| 50 | +``` |
| 51 | +# Azure Monitor (Application Insights): |
| 52 | +APPLICATIONINSIGHTS_CONNECTION_STRING = InstrumentationKey=... |
| 53 | +
|
| 54 | +# Local Aspire dashboard (OTLP): |
| 55 | +OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317 |
| 56 | +``` |
| 57 | + |
| 58 | +## Production / Staging Secrets |
| 59 | + |
| 60 | +These are only required outside of Development. The app throws at startup if they are missing in non-Development environments. |
| 61 | + |
| 62 | +### Email Sending |
| 63 | + |
| 64 | +``` |
| 65 | +AuthMessageSender:SendFromName = Hello World Team |
| 66 | +AuthMessageSender:SendFromEmail = no-reply@email.com |
| 67 | +AuthMessageSender:SecretKey = <mailjet-secret-key> |
| 68 | +AuthMessageSender:APIKey = <mailjet-api-key> |
| 69 | +``` |
| 70 | + |
| 71 | +### Social Login |
| 72 | + |
| 73 | +``` |
| 74 | +Authentication:Microsoft:ClientId = <client-id> |
| 75 | +Authentication:Microsoft:ClientSecret = <client-secret> |
| 76 | +Authentication:github:clientId = <client-id> |
| 77 | +Authentication:github:clientSecret = <client-secret> |
| 78 | +``` |
| 79 | + |
| 80 | +### HCaptcha |
| 81 | + |
| 82 | +Development uses [hCaptcha test keys](https://docs.hcaptcha.com/#integration-testing-test-keys) by default. Override for production: |
| 83 | + |
| 84 | +``` |
| 85 | +HCaptcha:SiteKey = <site-key> |
| 86 | +HCaptcha:SecretKey = <secret-key> |
| 87 | +``` |
0 commit comments