SetUp your website with Net-Worked-Data
Instruction to setup your website with Net-Worked-Data, connect contact email, add social signs, etc.
Install Net-Worked-Data in your project!
In your ASP Core NET 6 project add these repositories :
- NWDWebRuntime (repository or NuGet)
- NWDFoundation (repository or NuGet)
- NWDRuntime (repository or NuGet)
- NWDStandardModels (repository or NuGet)
- NWDCustomModels (repository or NuGet)
- NWDWebEmailSender (repository or NuGet)
- NWDWebHookSlack (repository or NuGet)
- NWDWebStandard (repository or NuGet)
- BBOExtractTransformLoad (repository or NuGet)
- NWDWebWwwRoot (repository) to implement CSS and Images. You can use this project to create your owner Website Style!
Edit your Program.cs file.
In Program.cs file add these lines :
- using NWDWebRuntime.Configuration;
- using NWDWebEmailSender.Configuration;
- using NWDWebHookSlack.Configuration;
- using NWDWebStandard.Configuration;
- using BBOExtractTransformLoad.Configuration;
- NWDWebRuntime.LoadFromBuilder(builder);
- NWDWebEmailSender.LoadFromBuilder(builder);
- NWDWebHookSlack.LoadFromBuilder(builder);
- NWDWebStandard.LoadFromBuilder(builder);
- BBOExtractTransformLoad.LoadFromBuilder(builder);
- NWDWebRuntimeConfiguration.UseApp(app);
- app.UseStaticFiles();
- app.UseRouting();
- app.UseAuthorization();
Manage your cshtml file.
Delete /Views/Shared/_Layout.cshtml file in your project to force to use the NWDWebStandard _Layout.cshtml.
Program.cs
using NWDWebRuntime.Configuration;
using NWDWebEmailSender.Configuration;
using NWDWebHookSlack.Configuration;
using NWDWebStandard.Configuration;
using BBOExtractTransformLoad.Configuration;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
/*--- Add ---*/
NWDWebRuntime.LoadFromBuilder(builder);
NWDWebEmailSender.LoadFromBuilder(builder);
NWDWebHookSlack.LoadFromBuilder(builder);
NWDWebStandard.LoadFromBuilder(builder);
BBOExtractTransformLoad.LoadFromBuilder(builder);
/*--- --- ---*/
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
/*--- Add ---*/
NWDWebRuntimeConfiguration.UseApp(app);
/*--- --- ---*/
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
NWDWebRuntime 0.1.605
Parameter Net-Worked-Data with your project!
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
Inside this section add :
- ProjectIdentity (example : 62815052 )
- EnvironmentKind
- Dev : 0
- PlayTest : 1
- Qualification : 2
- PreProduction : 4
- Production : 5
- PostProduction : 6
- PrivateKey (example : rDhdlXgQeOGpJXCxxjJtdHHpsJXOhzeC )
- PublicKey (example : QqJRnAzxfYHJWxkNJDmFsKlplQdFGJbq )
- EditorToken (example : mIeOvsCqbfJnGKFzIrXCvfXnHiCUCGfh )
appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://localhost:4050"
},
"Https": {
"Url": "https://localhost:4051"
}
}
},
...
"NWDWebRuntimeConfiguration": {
"ProjectIdentity": "your-project-ProjectIdentity",
"EnvironmentKind": "5",
"PrivateKey": "your-project-PrivateKey",
"PublicKey": "your-project-PublicKey",
"EditorToken": "your-project-EditorToken",
...
},
...
}
NWDWebEmailSender 0.1.605
SETUP TO REDACT
NWDWebHookSlack 0.1.605
Parameter NWDWebHookSlack for your project!
In your Slack create an application "Incoming WebHooks" and copy "webhook URL".
In appsetting.json file add a section NWDWebHookSlackConfiguration.
Inside this section add :
Inside this section add :
- Hook (example : https://hooks.slack.com/services/JgRzFoOTpNaZ/yEPbZ7W4pDY3/SXSY2WfFCyrqGTBR5ecnSYYF )
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebHookSlackConfiguration": {
"Hook": "your webhook URL"
},
...
}
NWDWebStandard 0.1.605
Parameter Net-Worked-Data with your project!
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
Inside this section add :
- ProjectIdentity (example : 59822702 )
-
EnvironmentKind
- Dev : 0
- PlayTest : 1
- Qualification : 2
- PreProduction : 4
- Production : 5
- PostProduction : 6
- PrivateKey (example : dTpBsJCXOzShrdUuwSSsBUSZoiDAJeJz )
- PublicKey (example : qNpbZutsmReELCmCETvzZdgdkETMPtlx )
- EditorToken (example : QoEpAKCoCpyVBXesUnNxyciOxjMjlRxu )
appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://localhost:4050"
},
"Https": {
"Url": "https://localhost:4051"
}
}
},
...
"NWDWebRuntimeConfiguration": {
"ProjectIdentity": "your-project-ProjectIdentity",
"EnvironmentKind": "5",
"PrivateKey": "your-project-PrivateKey",
"PublicKey": "your-project-PublicKey",
"EditorToken": "your-project-EditorToken",
...
},
...
}
Add your website's information
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
Inside this section add :
- Dns (example : etl-proto.ooabab.com )
- Secure if use https (example : true )
- WebSiteName (example : ETL-Proto )
- WebSiteShortName (example : ETLP )
- WebSiteInitials (example : EP )
- SupportLanguage in standard country-language codes separated by commat , see ISO-639 and ISO-3166 code to generate the approprieted country-language code to use. (example : System.Collections.Generic.HashSet`1[System.String] )
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"Dns": "www.your-website.com",
"Secure": "true/false",
"WebSiteName": "your-website-WebSiteName",
"WebSiteShortName": "your-website-WebSiteShortName",
"WebSiteInitials": "your-website-WebSiteInitials",
"SupportLanguage": "your-website-SupportLanguage",
...
},
...
}
Add your gitlab information
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
Inside this section add :
- GitCommit (example : GITunknowCOMMIT )
- GitCommitShort (example : )
- PipelineDate (example : )
- PipelineJob (example : )
- GitCommit = GIT_COMMIT
- GitCommitShort = GIT_COMMIT_SHORT
- PipelineDate = PIPELINE_DATE
- PipelineJob = PIPELINE_JOB
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"GitCommit": "GIT_COMMIT",
"GitCommitShort": "GIT_COMMIT_SHORT",
"PipelineDate": "PIPELINE_DATE",
"PipelineJob": "PIPELINE_JOB",
...
},
...
}
Add EmailPassword authentification process
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddAccountSignEmailPassword with value to true
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddAccountSignEmailPassword": "true",
...
},
...
}
Add LoginPassword authentification process
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddAccountSignLoginPassword with value to true
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddAccountSignLoginPassword": "true",
...
},
...
}
Add LoginEmailPassword authentification process
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddAccountSignLoginPasswordEmail with value to true
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddAccountSignLoginPasswordEmail": "true",
...
},
...
}
Go to https://developer.facebook.com/apps/ and create a new application for this website.
Redirect URL is ~/NWDAccount/FacebookRedirect/
Redirect URL is ~/NWDAccount/FacebookRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddFacebookSign with value to true
- FacebookClientId and insert Facebook client ID
- FacebookClientSecret and insert Facebook client secret
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddFacebookSign": "true",
"FacebookClientId": "426494904391842",
"FacebookClientSecret": "E1xBp7rhxrIgpy0f1msmLFeJ9lTaoSgo",
...
},
...
}
Go to https://console.cloud.google.com/apis/credentials/ and create a new OAuth 2.0 Client IDs credential for this website.
Redirect URL is ~/NWDAccount/GoogleRedirect/
Redirect URL is ~/NWDAccount/GoogleRedirect/
-
Add in Authorized JavaScript origins :
- https://www.your-website.com
- https://localhost:4051
- http://localhost:4050
-
Add in Authorized redirect URIs :
- https://www.your-website.com/NWDAccount/GoogleRedirect/
- https://localhost:4051/NWDAccount/GoogleRedirect/
- http://localhost:4050/NWDAccount/GoogleRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddGoogleSign with value to true
- GoogleClientId and insert Google client ID
- GoogleClientSecret and insert Google client secret
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddGoogleSign": "true",
"GoogleClientId": "3679968306189403",
"GoogleClientSecret": "vCWOYLqBRwSHHN9xMwRsnQxe7M3yrhXK",
...
},
...
}
Go to https://www.linkedin.com/developers/apps and create a new App for this website.
Redirect URL is ~/NWDAccount/LinkedInRedirect/
Redirect URL is ~/NWDAccount/LinkedInRedirect/
-
Add in Authorized redirect URIs :
- https://www.your-website.com/NWDAccount/LinkedInRedirect/
- https://localhost:4051/NWDAccount/LinkedInRedirect/
- http://localhost:4050/NWDAccount/LinkedInRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddLinkedInSign with value to true
- LinkedInClientId and insert LinkedIn client ID
- LinkedInClientSecret and insert LinkedIn client secret
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddLinkedInSign": "true",
"LinkedInClientId": "8524642407351495",
"LinkedInClientSecret": "qcH87q4562ZKIdS7v0ckFKvXlqSuinf5",
...
},
...
}
Go to https://developer.twitter.com and create a new project for this website.
Redirect URL is ~/NWDAccount/TwitterRedirect/
Redirect URL is ~/NWDAccount/TwitterRedirect/
-
Add in Authorized redirect URIs :
- https://www.your-website.com/NWDAccount/TwitterRedirect/
- https://localhost:4051/NWDAccount/TwitterRedirect/
- http://localhost:4050/NWDAccount/TwitterRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddTwitterSign with value to true
- TwitterClientId and insert Twitter client ID
- TwitterClientSecret and insert Twitter client secret
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddTwitterSign": "true",
"TwitterClientId": "3563073965725730",
"TwitterClientSecret": "wTfHpziifi7i7SMpDt7fJqdQejQKAcSs",
...
},
...
}
Go to https://www.Apple.com/developers/apps and create a new App for this website.
Redirect URL is ~/NWDAccount/AppleRedirect/
Redirect URL is ~/NWDAccount/AppleRedirect/
Example of Key value :
AuthKey_OPGGFUOHRD.p8
-----BEGIN PRIVATE KEY-----
vzH01KX58MRHVda737Xn2XCtWxdktEIwCrEksXGdJHZ4DIF5GtxSZ3Z291OomdFO
acb34yl1nvWj0teZRd1GkGEJOrv1EROHna8IeP3B6qD46BjnA8drjyKSzgdnj7mC
G3QceqfFoQC851VzFForlBiP54X9bZ0rH3C9He7aFlHMCVWq7c1udyqF99UzuBYE
QkGOc5da
-----END PRIVATE KEY-----
-
Add in Authorized redirect URIs :
- https://www.your-website.com/NWDAccount/AppleRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddAppleSign with value to true
- AppleClientId and insert App client ID
- AppleTeamId and insert Apple Team ID
- AppleKeyId and insert the Key ID (in the name of AuthKey_OPGGFUOHRD.p8 file)
- AppleKeyValue and insert the value of the file, removing the
`-----BEGIN PRIVATE KEY-----`and`-----END PRIVATE KEY-----`prefix and suffix, and insert line by line in a string array.
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddAppleSign": "true",
"AppleClientId": "com.my-website.app",
"AppleTeamId": "8180630237",
"AppleKeyId": "OPGGFUOHRD",
"AppleKeyValue": [
"vzH01KX58MRHVda737Xn2XCtWxdktEIwCrEksXGdJHZ4DIF5GtxSZ3Z291OomdFO",
"acb34yl1nvWj0teZRd1GkGEJOrv1EROHna8IeP3B6qD46BjnA8drjyKSzgdnj7mC",
"G3QceqfFoQC851VzFForlBiP54X9bZ0rH3C9He7aFlHMCVWq7c1udyqF99UzuBYE",
"QkGOc5da",
],
...
},
...
}
Go to https://www.Microsoft.com/developers/apps and create a new App for this website.
Redirect URL is ~/NWDAccount/MicrosoftRedirect/
Redirect URL is ~/NWDAccount/MicrosoftRedirect/
-
Add in Authorized redirect URIs :
- https://www.your-website.com/NWDAccount/MicrosoftRedirect/
- https://localhost:4051/NWDAccount/MicrosoftRedirect/
- http://localhost:4050/NWDAccount/MicrosoftRedirect/
Change can take long time!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- AddMicrosoftSign with value to true
- MicrosoftClientId and insert Microsoft client ID
- MicrosoftClientSecret and insert Microsoft client secret
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"AddMicrosoftSign": "true",
"MicrosoftClientId": "4488428429780798",
"MicrosoftClientSecret": "429Xh7ABo8WqbI4c9xRmUDWL7BlIUQei",
...
},
...
}
Add your society's information!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- SocietyName and insert your society's name
- SocietyAddress and insert your society's postal address
- SocietyTown and insert your society's town
- SocietyZipCode and insert your society's zip code
- SocietyCountry and insert your society's country
- SocietySiret and insert your society's offical number
- SocietyApe and insert your society's offical code
- SocietyRcs and insert your society's offical office dependence
- SocietyTva and insert your society's international tax number
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebRuntimeConfiguration": {
...
"SocietyName": "idéMobi",
"SocietyAddress": "43, rue d'Atlanta",
"SocietyTown": "Marcq-En-Barœul",
"SocietyZipCode": "59700",
"SocietyCountry": "FRANCE",
"SocietySiret": "44424955100011",
"SocietyApe": "7722C",
"SocietyRcs": "LILLE",
"SocietyTva": "FR93444249551",
...
},
...
}
BBOExtractTransformLoad 0.0.001
Nothing to do to configure this package.
Create custom controller
You want create a controller and use NWDPageStandard and authorization by NWDAccountService !?
Just create a controller like this :
MyNewController.cs
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using NWDWebStandard;
namespace MyProject.Controllers;
public class MyNewController : NWDBasicController<MyNewController>
{
private readonly ILogger<MyNewController> _logger;
public HomeController(ILogger<MyNewController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public IActionResult MyAction()
{
return View();
}
}
Finish! ... You want to disable this page?!
In appsetting.json file in section NWDWebRuntimeConfiguration add :
- SetUpPage set to "false"
appsettings.json
{
...
"NWDWebRuntimeConfiguration": {
...
"SetUpPage": "false"
},
...
}