KnowledgeSpace is a open source project for everyone. Every member can create new knowledge base record (KB) and share to community. For each KB, user can vote it and comment to below KB.
- Add-Migration Initial -OutputDir Data/Migrations
#Technology Stack
- ASP.NET Core 3.1
- Angular 8
- Identity Server 4
- SQL Server 2019
- Clone this source code from Repository
- Build solution to restore all Nuget Packages
- Set startup project is KnowledgeSpace.BackendServer
- Run Update-Database to generate database
- Set startup project to multiple projects include: KnowledgeSpace.BackendServer and KnowledgeSpace.WebPortal
-
https://medium.com/@matthew.bajorek/configuring-serilog-in-asp-net-core-2-2-web-api-5e0f4d89749c
-
https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.1
- NPM (https://nodejs.org/en/)
- https://git-scm.com/downloads
- npm install -g @angular/cli
- Visual Studio Code (https://code.visualstudio.com/)
- Run command: git clone https://github.com/start-angular/SB-Admin-BS4-Angular-8.git admin-app
CREATE TABLE [dbo].[CacheTable](
[Id] [nvarchar](449) NOT NULL,
[Value] [varbinary](max) NOT NULL,
[ExpiresAtTime] [datetimeoffset](7) NOT NULL,
[SlidingExpirationInSeconds] [bigint] NULL,
[AbsoluteExpiration] [datetimeoffset](7) NULL,
CONSTRAINT [pk_Id] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE NONCLUSTERED INDEX [Index_ExpiresAtTime] ON [dbo].[CacheTable]
(
[ExpiresAtTime] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF,
ONLINE = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- Publish source code to package (BackendServer, WebPortal, Admin App)
- Install server environment (SQL Server, .NET Core Runtime, ASP.NET Core Runtime)
- Copy artifacts to Server
- Install IIS (Internet information service)
- Create IIS Web App (Configure Pool IIS No managed)
- Config connection string appsettings.Production.json
- Install Certificate for IIS (friendly name)
- Setup security IIS_IUSR permission for web app, enable 32 bit in pool, enable stdout log in webconfig.
- Instal rewrite URL Module for IIS (https://www.iis.net/downloads/microsoft/url-rewrite)
- Create webconfig
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- Check url in setting
- The Angular Compiler requires TypeScript >=3.6.4 and <3.8.0 but 3.8.2 was found instead --> Open admin-app and run command prompt: npm install typescript@3.7.5