Monday, March 26, 2018

Dot Net Core Project Running Instructions - authroportal-core.git


Git -- authroportal-core.git


Common commands to run dotnet core project:
1)      dotnet   --  General driver for running the command-line commands.
2)      dotnet restore    --   Restores the dependencies and tools of a project.
3)      dotnet compile   --   Compiles a .NET project
4)      dotnet publish  --   Packs the application and its dependencies into a folder for deployment to a hosting system.
5)      dotnet run  --   Runs source code without any explicit compile or launch commands.
6)      dotnet build  --  Builds a project and all of its dependencies.

To build the entire solution
Goto <working directory>\src\AuthorPortal.sln and run the following command:
a)       dotnet restore
b)      dotnet build AuthorPortal.sln
c)       After you build the project, goto bin\debug within AuthorPortal.DataGenerator and run the below
<WorkingDirectory>\src\AuthorPortal.DataGenerator\ dotnet run --add seeddata --storageprovider pgsql --hostname portal1.local --apppath " <working directory>\ src\ AuthorPortal.Site" (This is for seed data ingestion required to run the site)
<WorkingDirectory>\src\AuthorPortal.DataGenerator\ dotnet run --add subscribers --storageprovider pgsql --hostname portal1.local --apppath " <working directory>\ src\ AuthorPortal.Site" (This is for ingest organization and subscribers ingestion required to run the site)
Note:  User can add data to either sql server or postgres by passing `--storageprovider` param as either `mssql` or `pgsql` for data generator

 To run authorportal site
Goto <WorkingDirectory>\ src\AuthorPortal.Site and run the following command:
dotnet run






Following changes to be done for the respective services to run
A)    AuthorPortal.DataApi > appsettings.json
{
1
  "AppSettings": {   
    "storageProvider": "pgsql" ----
  },
2
  "ConnectionStrings": {   
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
3
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=secret;username=postgres"
  }
}
           1 -  Enter the storage provider value either mssql or pgsql
           2 -  enter the proper mssql user credentials to connect to the sqlserver
           3 – enter the proper pgsql user crendtials to connect to postgre db

B)    AuthorPortal.DataGenerator > appsettings.json
{
  "AppSettings": {
  },
1
  "ConnectionStrings": {
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
2
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
         1 - enter the proper mssql user credentials to connect to the sqlserver
         2 - enter the proper pgsql user crendtials to connect to postgre db
C)    AuthorPortal.Ef.Npgsql > appsettings.json
{
  "ConnectionStrings": {
1
    "authorportal": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
        1 - enter the proper mssql user credentials to connect to the sqlserver
D)   AuthorPortal.Ef.SqlServer > appsettings.json
{
1
  "ConnectionStrings": {
    "authorportal": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;"
  }
}
        1 - enter the proper mssql user credentials to connect to the sqlserver
E)     AuthorPortal.EmailDistributionWorker > appsettings.json
{
  "ConnectionStrings": {
1
    "rmq": "host=localhost",
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
2
    "authorportal_pgsql": "host=localhost; database=authorportal_core;password=Welcome@2015;username=postgres"
  },
  "EmailWorkerService": {
3
    "workerSettings": {
4
      "serviceName": "authorportalcore.emaildistributionworkerservice",
      "serviceDisplayName": "AuthorPortalCore Email Distribution Worker Service",
5
      "subscriptionId": "authorportalcore_email_distribution_worker",
      "topicCode": "authorportalcore.email",
6
      "storageProvider": "pgsql"
    },
    "emailSettings": {
      "subject": "Recent Research",
      "bodyHeader": "Recent Research",
      "disclaimer": "",
      "mailService": {
        "baseUrl": "http://localhost:5000/v2/",
        "apiKey": "test",
        "appDNSName": "staging.author-research.com",
        "fromAddressDisplayName": "AuthorPortal",
        "testMode": "true"
      },
      "smtp": {
        "fromAddress": "authorportal-no-reply@author-research.com",
        "deliveryMethod": 0, //Network = 0, SpecifiedPickupDirectory = 1, PickupDirectoryFromIis = 2
        "host": "127.0.0.1",
        "port": 25,
        "userName": "",
        "password": ""
      }
    }
  }
}
1         -  Enter the proper mssql user credentials to connect to the sqlserver
2         -  Enter the proper pgsql user crendtials to connect to postgre db
3         -  Enter the email distribution service name, user can change this name upon his wish. This name should be in sync with authorportal.site> appsettings.json file.
4         -  Enter the email distribution display name, user can change this name upon his wish.
5         -  Enter the respective email distribution topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.publishworker >appsettings.json files.
6         - Enter the storage provider value either mssql or pgsql


F)     AuthorPortal.PublishEnqueueService > appsettings.json
{
1
  "AppSettings": {   
2
    "serviceName": "authorportalcore.publishenqueservice",
3
    "serviceDisplayName": "AuthorPortalCore Publish Enqueue Service",
    "publishWorkerTopicCode": "authorportalcore.publish",
4
    "publishOrgName": "Author Research",
5
    "tenantName": "portal2.local",
    "storageProvider": "pgsql"
  },
  "ConnectionStrings": {
6
    "rmq": "host=localhost",
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
7
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
1         -  Enter the publish enqueue service name, user can change this name upon his wish. This name should be in sync with authorportal.site> appsettings.json file.
2         -  Enter the publish enqueue display name , user can change this name upon his wish.
3         -  Enter the respective publish worker topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.publishworker >appsettings.json files.
4         - Enter the respective Tenant Name value
5         - Enter the storage provider value either mssql or pgsql
6         - Enter the proper mssql user credentials to connect to the sqlserver
7         - Enter the proper pgsql user credentials to connect to the postgre

G)     AuthorPortal.PublishWorker > appsettings.json
{
1
  "AppSettings": {
    "serviceName": "authorportalcore.publishworkerservice",
2
    "serviceDisplayName": "AuthorPortalCore Publish Worker Service",
3
    "subscriptionId": "authorportalcore__publish_worker",
4
    "publishWorkerTopicCode": "authorportalcore.publish",
5
    "emailWorkerTopicCode": "authorportal.email",
6
    "vendorWorkerTopicCode": "authorportal.vendor",
    "authorPortalAppPath": "E:\\work\\Authorcore\\authorportal-core\\src\\AuthorPortal.Site",
7
    "authoringAppPath": "E:\\work\\AuthoringExibitutility\\authorng\\source\\DevSource\\SEDemo\\SEDemo.Web\\",
    "imageServiceDocImagesPath": "docImages",
    "imageServiceImagesPath": "images",
8
    "imageServiceRepositoryPath": "repository\\assets\\",
    "storageProvider": "pgsql"
  },
  "ConnectionStrings": {
9
    "rmq": "host=localhost",
    "trasliteConnectionString": "Data Source=.\\SQLExpress;Initial Catalog=AuthorDB_SEDemo;User Id=SEDemodbuser;Password=c0mp0$e;",
100000
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
11
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
1         - Enter the publish worker service name, user can change this name upon his wish. This name should be in sync with authorportal.site> appsettings.json file.
2         - Enter the publish worker display name , user can change this name upon his wish.
3         - Enter the respective publish worker topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.publishworker >appsettings.json files.
4         - Enter the respective email worker topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.emaildistributionworker >appsettings.json files
5         - Enter the respective vendor worker topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.vendordistributionworker >appsettings.json files
6         - Enter the respective ‘Authorportal Site App’ path details
7         - Enter the respective ‘Authroing App’ path details
8          - Enter the storage provider value either mssql or pgsql
9          - Enter the proper connection string details of the authoring
10      - Enter the proper mssql user credentials to connect to the sqlserver
11      - Enter the proper pgsql user credentials to connect to the postgre

H)   AuthorPortal.Site > appsettings.json
{
  "AppSettings": {
1
    "_storageProviderComment": "mssql or pgsql",
    "storageProvider": "pgsql",
2
    "rmqConnectionString": "host=localhost",
3
    "emailDistributionTopicCode": "authorportalcore.email",
    "vendorDistributionTopicCode": "authorportalcore.vendor",
    "VimeoBaseUrl":"https://player.vimeo.com/video/"
  },
4
  "ConnectionStrings": {
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
5
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
1          - Enter the storage provider value either mssql or pgsql
2          - Enter the respective email distribution topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.emaildistributionworker >appsettings.json files
3          - Enter the respective vendor worker topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.vendordistributionworker >appsettings.json files
4          - Enter the proper mssql user credentials to connect to the sqlserver
5          - Enter the proper pgsql user credentials to connect to the postgre

I)       AuthorPortal.VendorDistributionWorker > appsettings.json
{
1
  "AppSettings": {
2
    "serviceName": "authorportalcore.vendordistributionworkerservice",
    "serviceDisplayName": "AuthorPortalCore Vendor Distribution Worker Service",
3
    "subscriptionId": "authorportalcore_vendor_distribution_worker",
4
    "topicCode": "authorportalcore.vendor",
5
    "siteAppPath": "E:\\work\\Authorcore\\authorportal-core\\src\\AuthorPortal.Site",
    "storageProvider": "pgsql"
  },
  "ConnectionStrings": {
6
    "rmq": "host=localhost",
    "authorportal_mssql": "data source=.\\SQLExpress;initial catalog=authorportal_core;Integrated Security=true;",
7
    "authorportal_pgsql": "host=localhost;database=authorportal_core;password=Welcome@2015;username=postgres"
  }
}
1         - Enter the vendor distribution worker service name, user can change this name upon his wish. This name should be in sync with authorportal.site> appsettings.json file.
2         - Enter the vendor distribution worker display name, user can change this name upon his wish.
3         - Enter the respective authorportal vendor topic code which should have the same value in authorportal.site> appsettings.json file & authorportal.publishworker >appsettings.json files.
4         - Enter the respective topic code for vendor distribution worker
5         - Enter the authorportal site path
6         - Enter the storage provider value either mssql or pgsql
7         - Enter the proper mssql user credentials to connect to the sqlserver
8         - Enter the proper pgsql user credentials to connect to the postgre