lixinyang123 / CoreHome

A blog system based on .NET 🏠

Home Page:https://www.lllxy.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CoreHome

build

An open source blog system based on .NET and Alibaba Cloud.

Current personal website,

Features

  • Personal information management.
  • Homepage project management.
  • Theme management (background, light and dark themes, BGM).
  • Blog management (classification, tagging, archiving, comments).
  • Feedback alerts.
  • Network status detection.

Screenshot

Build from source

Install pre-requisites

  • Visual Studio 2022 / Visual Studio Code
  • .NET 8.0 SDK
  • Libman (VS Extension)
  • Bundler & Minifier (VS Extension)
  • Mysql
  • Docker(WSL2 is recommended)

If you use Visual Studio (Not Visual Studio Code), you don't need to install Libman CLI and Entity Framework CLI.

Install Libman CLI:

dotnet tool install -g Microsoft.Web.LibraryManager.Cli

Install Entity Framework Core CLI

dotnet tool install -g dotnet-ef

Clone source code

git clone https://github.com/lixinyang123/CoreHome.git

Configuration

You can refer to this blog to configure.

  • CoreHome
    • CoreHome.HomePage
      • appsettings.json
      • wwwroot/SiteMap.txt
      • wwwroot/favicon.ico
    • CoreHome.Admin
      • appsettings.json
      • wwwroot/favicon.ico
    • CoreHome.ReverseProxy
      • appsettings.json

The content of appsettings.json in CoreHome.HomePage and CoreHome.Admin is exactly the same, just copy and paste.

Configure database:

Both CoreHome.HomePage and CoreHome.Admin's application.json files should be configured.

  "CoreHome": "server=[host];user id=[user];password=[password];database=corehome"

Dependencies

  • Visual Studio

    • Backend:Click Restore Nuget Packages in Solution Explorer.
      • CoreHome.Infrastructure
      • CoreHome.Data
      • CoreHome.HomePage
      • CoreHome.Admin
      • CoreHome.ReverseProxy
    • Frontend:Click Restore Client Libraries in Solution Explorer.
      • CoreHome.HomePage/libman.json
      • CoreHome.Admin/libman.json
  • Visual Studio Code or CLI

    • Backend:Execute dotnet restore in the following directory.
      • CoreHome.HomePage
      • CoreHome.Admin
    • Frontend:Execute libman restore in the following directory.
      • CoreHome.HomePage
      • CoreHome.Admin

Migrate Database

  • Visual Studio

Tools -> Nuget Package Manager -> Package Manager Console

Update-Database
  • Visual Studio Code or CLI

Execute the following commands in the CoreHome.HomePage and CoreHome.Admin directory.

dotnet-ef database update -p ..\CoreHome.Data

Startup

  • Visual Studio or Visual Studio Code

Click Startup in Solution Explorer or Ctrl+F5.

  • CLI

Execute the following commands in the CoreHome.HomePage and CoreHome.Admin directory.

dotnet run

Build Dockerfile

  • Visual Studio

Click Build Dockerfile in Solution Explorer.

  • Visual Studio Code or CLI

Execute the following command in the project root directory.

docker build --file ./CoreHome.Admin/Dockerfile --tag lixinyang/corehome-admin:latest .
docker build --file ./CoreHome.HomePage/Dockerfile --tag lixinyang/corehome-homepage:latest .
docker build --file ./CoreHome.ReverseProxy/Dockerfile --tag lixinyang/corehome-reverseproxy:latest .

Deploy

You can use DockerHome to deploy CoreHome.

ReadMe Card

You can use DockerHome to deploy CoreHome, or you can deploy it manually.

You can refer to this blog to use DockerHome.

About

A blog system based on .NET 🏠

https://www.lllxy.net

License:MIT License


Languages

Language:C# 54.1%Language:HTML 31.9%Language:JavaScript 7.4%Language:CSS 5.7%Language:Dockerfile 1.1%