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 :
Edit your Program.cs file.
In Program.cs file add these lines :
  • using NWDWebRuntime.Configuration;
  • using NWDWebStandard.Configuration;
  • using NWDWebDownloader.Configuration;
  • using NWDWebUploader.Configuration;
  • using NWDWebTreat.Configuration;
  • using NWDHub.Configuration;
  • NWDWebRuntime.LoadFromBuilder(builder);
  • NWDWebStandard.LoadFromBuilder(builder);
  • NWDWebDownloader.LoadFromBuilder(builder);
  • NWDWebUploader.LoadFromBuilder(builder);
  • NWDWebTreat.LoadFromBuilder(builder);
  • NWDHub.LoadFromBuilder(builder);
  • NWDWebRuntimeConfiguration.UseApp(app);
In Program.cs verify these lines :
  • 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 NWDWebStandard.Configuration;
                using NWDWebDownloader.Configuration;
                using NWDWebUploader.Configuration;
                using NWDWebTreat.Configuration;
                using NWDHub.Configuration;
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllersWithViews();
/*--- Add ---*/
            NWDWebRuntime.LoadFromBuilder(builder);
            NWDWebStandard.LoadFromBuilder(builder);
            NWDWebDownloader.LoadFromBuilder(builder);
            NWDWebUploader.LoadFromBuilder(builder);
            NWDWebTreat.LoadFromBuilder(builder);
            NWDHub.LoadFromBuilder(builder);
/*--- --- ---*/

var app = builder.Build();

app.UseStaticFiles();

app.UseRouting();

/*--- Add ---*/
NWDWebRuntimeConfiguration.UseApp(app);
/*--- --- ---*/

app.UseAuthorization();

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();

                        
NWDWebRuntime 1.1.134
Parameter Net-Worked-Data with your project!
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
  • MyProjectId (example : 78200443 )
  • MyEnvironment
    • Dev : 0
    • PlayTest : 1
    • Qualification : 2
    • PreProduction : 3
    • Production : 4
    • PostProduction : 5
  • MyProjectKey (example : VLtyAoczAdAqzJbMKxlmOnkxvztNoYyA )
  • MySecretKey (example : CEtRISCyeaUphneQLnictKsJAGxIEpOo )
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": {
         "MyProjectId": "your-project-MyProjectId",
         "MyEnvironment": "5",
         "MyProjectKey": "your-project-MyProjectKey",
         "MySecretKey": "your-project-MySecretKey",
        ...
    },
    ...
}
                        
NWDWebStandard 1.1.134
Parameter Net-Worked-Data with your project!
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
  • MyProjectId (example : 28424217 )
  • MyEnvironment
    • Dev : 0
    • PlayTest : 1
    • Qualification : 2
    • PreProduction : 3
    • Production : 4
    • PostProduction : 5
  • MyProjectKey (example : jLWxhhbGwOsAjUjwCwcQnBGRawrfIAaw )
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": {
         "MyProjectId": "your-project-MyProjectId",
         "MyEnvironment": "5",
         "MyProjectKey": "your-project-MyProjectKey",
        ...
    },
    ...
}
                        
Add your website's information
In appsetting.json file add a section NWDWebRuntimeConfiguration.
Inside this section add :
  • Dns (example : member.ooabab.com )
  • Secure if use https (example : true )
  • WebSiteName (example : BBOMember )
  • WebSiteShortName (example : BBOMember )
  • WebSiteInitials (example : BBOM )
  • 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 :
  • GitCommit (example : 435b2d71b23efc477a81088b33bab58ca4026161 )
  • GitCommitShort (example : 435b2d71 )
  • PipelineDate (example : 2023-06-28 15:38:46 )
  • PipelineJob (example : 25727 )
Or add these keys to replace them by YAML script from CICD workflow:
  • 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 NWDWebStandardConfiguration add :
  • AddAccountSignEmailPassword with value to true
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddAccountSignEmailPassword": "true",
        ...
    },
    ...
}
                        
Add LoginPassword authentification process
In appsetting.json file in section NWDWebStandardConfiguration add :
  • AddAccountSignLoginPassword with value to true
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddAccountSignLoginPassword": "true",
        ...
    },
    ...
}
                        
Add LoginEmailPassword authentification process
In appsetting.json file in section NWDWebStandardConfiguration add :
  • AddAccountSignLoginPasswordEmail with value to true
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddAccountSignLoginPasswordEmail": "true",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Facebook application
Go to https://developer.facebook.com/apps/ and create a new application for this website.
Redirect URL is ~/NWDAccount/FacebookRedirect/

Change can take long time!

In appsetting.json file in section NWDWebStandardConfiguration add :
  • AddFacebookSign with value to true
  • FacebookClientId and insert Facebook client ID
  • FacebookClientSecret and insert Facebook client secret
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddFacebookSign": "true",
         "FacebookClientId": "9796049344919191",
         "FacebookClientSecret": "JfOPBjuK7sJkLmZxIcN0nqNKosY0fYai",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Discord application
Go to https://discord.com/developers/applications/ and create a new application for this website.
Redirect URL is ~/NWDAccount/FacebookRedirect/

Change can take long time!

In appsetting.json file in section NWDWebStandardConfiguration add :
  • AddDiscordSign with value to true
  • DiscordClientId and insert Discord client ID
  • DiscordClientSecret and insert Discord client secret
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddDiscordSign": "true",
         "DiscordClientId": "207257797251806",
         "DiscordClientSecret": "6RVodjmZgi4NmfyN7fTgxMdFYlovBUkT",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Google application
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/
  • 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 NWDWebStandardConfiguration add :
  • AddGoogleSign with value to true
  • GoogleClientId and insert Google client ID
  • GoogleClientSecret and insert Google client secret
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddGoogleSign": "true",
         "GoogleClientId": "5926493492518436",
         "GoogleClientSecret": "ipTl6NzYyaVz0TsvuIZ7A2icKzhNjRVi",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from LinkedIn application
Go to https://www.linkedin.com/developers/apps and create a new App for this website.
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 NWDWebStandardConfiguration add :
  • AddLinkedInSign with value to true
  • LinkedInClientId and insert LinkedIn client ID
  • LinkedInClientSecret and insert LinkedIn client secret
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddLinkedInSign": "true",
         "LinkedInClientId": "4250017926405347",
         "LinkedInClientSecret": "h5JIT41q7knOT8msTBAU45gM0hJmEAF2",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Twitter application
Go to https://developer.twitter.com and create a new project for this website.
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 NWDWebStandardConfiguration 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": "2866270590532444",
         "TwitterClientSecret": "uQisdZSqx86w2TAZ5PjzuPdINdNUt00P",
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Apple application
Go to https://www.Apple.com/developers/apps and create a new App for this website.
  • Go to Certificates, Identifiers & Profiles > Identifiers and click on the + sign in the upper left next to “Identifiers”
  • Select App IDs and hit continue.
  • Here enter any Description and a Bundle ID (Apple recommends using a reverse-domain name style string ex: com.domainname.appname). Scroll down the Capabilities and make sure to tick on Sign In with Apple. And finally, click continue and in the next page verify the details and click Register.
  • Now we need to obtain a Services Id. This will also serve as the AppleServiceId
  • Again go to Certificates, Identifiers & Profiles > Identifiers and click on the + sign in the upper left next to “Identifiers”.
  • This time select Services IDs and hit continue.
  • Here enter any Description and an Identifier (Apple recommends using a reverse-domain name style string ex: com.domainname.appname). Make sure to tick on Sign In with Apple. Here you will have to click on the Configure button next to “Sign In with Apple”.
  • Clicking the Configure button from the previous step will display a screen with Web Authentication Configuration. Make sure the App ID we obtained previously is selected as the Primary App ID. Next, you will have to add the Web Domain you will be using this service in (however I did not have to verify the domain to try out Sign In with Apple, but its best if you can get this done). I used example-app.com. Finally, add the Return URLs (you can add multiple) which will be the valid URLs to redirect the user after the user authenticates with Sign In with Apple (https://www.your-website.com/NWDAccount/AppleRedirect/). Click Save.
  • Click on Continue and in the next page verify the details and click Register.
  • Go to Certificates, Identifiers & Profiles > Keys and click on the + sign in the upper left next to “Keys”.
  • Give a Key Name and make sure to tick Sign In with Apple. Here also we will have to click on Configure. And in the screen that appears next(Configure Key) select the same App Id we used previously under Choose a Primary App ID and click Save.
  • Click on Continue and in the next page verify the details and click Register.
  • Download the key and keep it in a safe place as you will never be able to download it again. Click on Done after downloading the key.
  • AppleKeyId is in the name of AuthKey_HCAOTVPPRI.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.
  • Now you need generate secret key by JWT

Redirect URL is ~/NWDAccount/AppleRedirect/
Example of Key value :
AuthKey_HCAOTVPPRI.p8

-----BEGIN PRIVATE KEY-----
oW698JsPVkJUjuAkxa9eteN6ga8Vq64Bh7lAEBLJdoBXoxS6W7FZx0VVdJfMx1xX
s7cxJKkVPWpyxIz4Vdkw7X1lDTGR4O7nGgeeIqqMqi33FddzJSHS5DDJNhE6XZSb
ZDzV2uiKj9KEiBR68Bu8x8Pj3mQrbrLBFSHGrnQVUQGvkq8drdp9oc050Xfk9sZc
x7DfIVeJ
-----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 NWDWebStandardConfiguration add :
  • AddAppleSign with value to true
  • AppleServiceId and insert App client ID
  • AppleTeamId and insert Apple Team ID
  • AppleKeyId and insert the Key ID (in the name of AuthKey_HCAOTVPPRI.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": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddAppleSign": "true",
         "AppleServiceId": "com.my-website.app",
         "AppleTeamId": "32941528",
         "AppleKeyId": "HCAOTVPPRI",
         "AppleKeyValue": [
            "oW698JsPVkJUjuAkxa9eteN6ga8Vq64Bh7lAEBLJdoBXoxS6W7FZx0VVdJfMx1xX",
            "s7cxJKkVPWpyxIz4Vdkw7X1lDTGR4O7nGgeeIqqMqi33FddzJSHS5DDJNhE6XZSb",
            "ZDzV2uiKj9KEiBR68Bu8x8Pj3mQrbrLBFSHGrnQVUQGvkq8drdp9oc050Xfk9sZc",
            "x7DfIVeJ",
        ],
        ...
    },
    ...
}
                        
Add authentification by OAuth2.0 from Microsoft application
Go to https://www.Microsoft.com/developers/apps and create a new App for this website.
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 NWDWebStandardConfiguration add :
  • AddMicrosoftSign with value to true
  • MicrosoftClientId and insert Microsoft client ID
  • MicrosoftClientSecret and insert Microsoft client secret
appsettings.json

{
    "Logging": {...},
    "AllowedHosts": "*",
    "Kestrel": {...},
    ...
    "NWDWebStandardConfiguration": {
        ...
         "AddMicrosoftSign": "true",
         "MicrosoftClientId": "5429799870850413",
         "MicrosoftClientSecret": "iv88S8yArw45cI8sPcUTjdQ4erQ74umj",
        ...
    },
    ...
}
                        
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",
        ...
    },
    ...
}
                        
NWDWebDownloader 1.1.134
Parameter NWDWebDownloader for your project!
In appsetting.json file add a section NWDWebDownloaderConfiguration.
Inside this section add :
  • Downloads
  • And add a list of NWDDownloadConfig
  • NWDDownloadConfig
  • PageName (example : my pag of apps)
  • RootPath (example : ../../DirectoryName)
  • BuildListSize (example : 10)
appsettings.json

        {
            "Logging": {...},
            "AllowedHosts": "*",
            "Kestrel": {...},
            ...
            "NWDWebDownloaderConfiguration": {
                "Downloads":[
                        {
                            "PageName": "your webhook URL",
                            "RootPath": "../NWDWebDownloader/Test/Test2",
                            "BuildListSize": "8",
                        },
                        ...
                ]
            }
NWDWebUploader 1.1.134
Parameter NWDWebUploader for your project!
This package use NWDWebDownloader and you must be admin to use it!
Nothing to do to configure this package. This package is an extension of features for NWDWebDownloader. See NWDWebDownloader to configure options.
NWDWebTreat 1.1.134
Nothing to do to configure this package.
NWDHub 1.1.134
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"
    },
    ...
}
                        
Settings

Set your own customized style

Color Scheme

Choose the perfect color mode for your app.


RTL Mode

Switch your language direction


Fluid Layout

Toggle container layout system


Sidebar Style

Switch between styles for your vertical sidebar

customize