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 :
- NWDFoundation (repository or NuGet)
- NWDRuntime (repository or NuGet)
- NWDStandardModels (repository or NuGet)
- NWDCustomModels (repository or NuGet)
- NWDWebRuntime (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.763
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 : 24819254 )
- EnvironmentKind
- Dev : 0
- PlayTest : 1
- Qualification : 2
- PreProduction : 4
- Production : 5
- PostProduction : 6
- PrivateKey (example : cPjYSzHmzBnYicxqWeaWvoVzhJITyyFj )
- PublicKey (example : pWTjgQbFAESruuBINoPHVaZSYnOsxtUC )
- EditorToken (example : byhKQaQFhbqIjXWtkeaqElfALgIWLjIM )
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.763
SETUP TO REDACT
NWDWebHookSlack 0.1.763
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/acxVduOnlBce/SQ0bEOiJTgSw/cOEZ4mW0SCRzNzwQvwWhOVnn )
appsettings.json
{
"Logging": {...},
"AllowedHosts": "*",
"Kestrel": {...},
...
"NWDWebHookSlackConfiguration": {
"Hook": "your webhook URL"
},
...
}
NWDWebStandard 0.1.763
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 : 6694545 )
-
EnvironmentKind
- Dev : 0
- PlayTest : 1
- Qualification : 2
- PreProduction : 4
- Production : 5
- PostProduction : 6
- PrivateKey (example : VJOjytNkzOGENFkaPBDWIeCBXksfSunl )
- PublicKey (example : sEZRaStgbYLNyjHPPqmuCGjNYgRgReCK )
- EditorToken (example : amdDVgZjjYJyymWcSClXiyAbGAKCgxRo )
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-game.ooabab.com )
- Secure if use https (example : true )
- WebSiteName (example : ETL-Game )
- WebSiteShortName (example : ETLG )
- WebSiteInitials (example : EG )
- 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": "3257214363182015",
"FacebookClientSecret": "aarW7Ouzd33R6kjeop5kc1AJ6VOVJ04R",
...
},
...
}
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": "2650408941144867",
"GoogleClientSecret": "Ytihpu6cMvaFIuHu5gSsaMMhqn1RJJKg",
...
},
...
}
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": "1118516184998163",
"LinkedInClientSecret": "dPIJKD3s2u2mkomjYHjX84t9CDgFCUCe",
...
},
...
}
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": "4904659143612115",
"TwitterClientSecret": "lnQSgq5bN34WCod4eM12a3rEKOyFSOJP",
...
},
...
}
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_TJWCQEWOPC.p8
-----BEGIN PRIVATE KEY-----
TNamooHtQ0p7vEAXxdrVm7sgZgssVZ3vb0k1EkJLNfERIJcNqR7xBp5Gr2xyfbql
dgsa42YaaIegtcdXHBdkddvu1fr7XuSLvJyBsEi3ad4pDOOzsClgONH09YeL2wXP
uzJRwDQxQqnKE59TVIqZR1mD7CZmWlT56g5SpUjb8ucD5Lou02kmMx5yL5a7VnCP
i5w5bHkI
-----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_TJWCQEWOPC.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": "5184430452",
"AppleKeyId": "TJWCQEWOPC",
"AppleKeyValue": [
"TNamooHtQ0p7vEAXxdrVm7sgZgssVZ3vb0k1EkJLNfERIJcNqR7xBp5Gr2xyfbql",
"dgsa42YaaIegtcdXHBdkddvu1fr7XuSLvJyBsEi3ad4pDOOzsClgONH09YeL2wXP",
"uzJRwDQxQqnKE59TVIqZR1mD7CZmWlT56g5SpUjb8ucD5Lou02kmMx5yL5a7VnCP",
"i5w5bHkI",
],
...
},
...
}
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": "6005573151117907",
"MicrosoftClientSecret": "02o9fU6oGrtTnk5lILfxVs0NYGMX311x",
...
},
...
}
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"
},
...
}