Skip to content

💻Source code running locally-backend

Run the Microi back-end service in the local environment.


🎥Video tutorial


📦Download the source code and. NET environment


  1. Download and install VS Code
  2. Install the plug-ins: C Sharp, C# Dev Kit, . NET Install Tool
  3. Open/Microi.ServerDirectory, wait a few seconds and [Solution Explorer] will automatically appear, waiting for the NuGet library to be automatically restored.
  4. Must be configured/Microi.net.Api/appsettings.jsonFile
json
  "AppSettings": {
    "OsClient": "iTdos",//【必须】自定义SaaS引擎Key,与数据库【sys_osclient】表的【OsClient】字段值对应
    "OsClientType": "Product",//【必须】自定义程序运行环境,如:Product(正式环境)、Dev(测试环境)等
    "OsClientNetwork": "Internet",//【必须】自定义网络类型,如:Internet(公网)、Internal(内网)等
    "OsClientDbType": "MySql",//默认MySql,可选SqlServer、Oracle
    //【必须】数据库连接字符串,建议使用源码提供的MySql。同时支持SqlServer、Oracle
    "OsClientDbConn": "Data Source=192.168.31.1;Database=microi_empty;User Id=roo;Password=password123456;Port=3306;Convert Zero Datetime=True;Allow Zero Datetime=True;Charset=utf8mb4;Max Pool Size=500;Min Pool Size=5;Connection Lifetime=300;Connection Timeout=30;Pooling=true;sslmode=None;",
    //SqlServer连接字符串示例:Server=192.168.31.1,1434;Database=microi_empty;User Id=sa;Password=password123456;
    //Oracle连接字符串示例:User Id=MICROI;Password=password123456;Data Source=192.168.31.1:1521/xe;
    //Tips:若【OsClient + OsClientType + OsClientNetwork】在【sys_osclient】表中能匹配到数据,且数据中有Redis相关配置,则可以省略以下Redis配置
    "OsClientRedisHost" : "",//Redis Host,如:119.31.116.88
    "OsClientRedisPort" : "",//Redis端口,如:6379
    "OsClientRedisPwd" : "",//Redis密码,如:123456
    "OsClientRedisDataBase" : ""//Redis库,如:0、5
    //其余配置分布式存储(如阿里云OSS、MinIO)、MQ消息队列、ES搜索引擎等,均在平台【SaaS引擎】中动态配置
  },

Notes

  • After pulling the source code, please give priority'Microi.net.dll'Update to latest version
  • If the compilation fails due to the failure of NuGet automatic restore or the failure of loading the project, you can try to restart VS Code to reload the project and wait for NuGet to restore it.
  1. Right-clickMicroi.net.ApiProject → Debug → Start a new instance
  2. Access Address:https://localhost:7266(port in/Microi.net.Api/Properties/launchSettings.jsonconfiguration)

  1. Download and install Visual Studio 2022
  2. Double-click to open/Microi.net.sln, wait a moment, right clickMicroi.net.ApiProject → Regenerate
  3. If restoring the NuGet package fails, close VS2022 and reopen itMicroi.net.sln(Generally, it is a network problem. You can try hot spots on your mobile phone.)
  4. Must be configured/Microi.net.Api/appsettings.json, ibid.

⚙Configuration required parameters

minimum requirements

To make the project run, at least two environments of database Redis are required, one of which is indispensable.


📝Environment Configuration Notes

EnvironmentAffect function
No MongoDBUnable to use system log
No MinIO/Alibaba Cloud OSSUnable to upload using file/image
No RabbitMQUnable to use message queue
No ElasticsearchUnable to use search engine

🐳Locally compile and publish to a Docker image

  1. Install Docker Desktop
  2. InMicroi.net.ApiExecute under the project directory:
bash
dotnet clean && dotnet publish -c Release -o ./bin/Release/publish
  1. Enter./bin/Release/Table of Contents, Executepublish-demo.shScript (remember to modify the configuration inside first)

MIT License.