- 1. Setup
- 2. Development
- 3. Publish
- 4. Run for Production
- 5. Deployment
- 6. Postman
- 7. Bundle analysis
- 8. Troubleshooting
Create folder C:\SettleChat\SqlVolume
where subfolders for container volumes will be mapped
.\Installation\01_Database\01_RunDockerSqlServer.cmd
[Extra] Command for removal of docker SQL Server (in case needed to restart with clean DB)**
.\Installation\01_Database\__01_RemoveDockerSqlServer.cmd
This will create:
- login
- database
- user
.\Installation\01_Database\02_PrepareDB.cmd
There are 2 options:
- Using SQL scripts (using source codes)
- Executing SettleChat.exe with argument (no source codes needed - usefull for migrations in CI/CD)
Make sure latests schema is generated by executing
.\Development\GenerateSchemaCreateScript.cmd
Then execute creation of schema in DB
.\Installation\01_Database\03_CreateDBSchema.cmd
Take a look how to migrate DB schema to latest at Deployment section
Host: localhost,1433
Login: SettleAdmin
Password: mUtLw5i4YL/oo/S4JnzNPP0ImZ7K5fx5grTC+dXMjZA=
Create empty folder for persisting Seq data: C:\SettleChatSecrets\seq
.\Installation\02_Logging\01_RunDockerSeq.cmd
Go to http://127.0.0.1:5340 and enable authentication under Settings -> USERS
Update Sentry DSN in .\SettleChat\ClientApp\src\index.tsx
- Create
OAuth 2.0 Client IDs
(https://console.developers.google.com/apis/credentials) - Enter following URIs under
Authorized redirect URIs
section:- https://localhost:44328/signin-google
- https://localhost:44328/authentication/login-callback
C:\SettleChatSecrets\appsettings.json
(optional, can contain common secret settings)C:\SettleChatSecrets\appsettings.Development.json
(optional, can contain secret settings for development)C:\SettleChatSecrets\appsettings.Production.json
(optional, can contain secret settings for production)
Content of appsettings.Production.json
:
{
"IdentityServer": {
"Key": {
"Type": "File",
"FilePath": "C:\\SettleChatSecrets\\MyIdentityServerCert.pfx",
"Password": "<password used by .pfx>"
}
},
"GoogleOAuth:ClientId":"<client id from google developer console>",
"GoogleOAuth:ClientSecret":"<client secret from google developer console>"
}
Note: Certificate configuration for IdentityServer is read by
AddSigningCredentials()
inside ofAddApiAuthorization()
C:\SettleChatSecrets\MyIdentityServerCert.pfx
(optional - needed for IdentityServer for production - google how to create certificate for .NET Core app, e.g. https://benjii.me/2017/06/creating-self-signed-certificate-identity-server-azure/)
Make sure Typescript 4.2 for Visual Studio is installed
Typescript 4.2 is referenced in .csproj in order to make tsconfig.json setting "--jsx":"react-jsx" (which is forced by Create-React-App
npm run start
command) work in Visual Studio
Install JavaScript Prettier VS extension
[Optional] set it to format on save
- when model changed, create migration by executing in VS Package Manager Console
Add-Migration <MigrationName>
- propagate changes to DB>
- in VS Package Manager Console select Default project SettleChat.Migrations
-
Update-Database
Publish using VisualStudio publish profile called FolderProfile
(when published using FolderProfile
Visual Studio publish profile)
.\SettleChat\bin\Release\netcoreapp3.1\publish\RunProduction.bat
Make sure latest SettleChat.exe is built
[Extra] It's possible to check if there are pending DB migrations to be applied by running
.\Deployment\DBMigrationPendingCheck.cmd
Then execute
.\Deployment\DBMigration.cmd
Exported Postman configuration is here: .\SettleChat local development.postman_collection.json
-
Build
npm run build
-
Analyze
npm run analyze
Execute on SQL Server
USE [SettleChat]
ALTER USER [SettleAdmin] WITH LOGIN = SettleAdmin
GO