# studydome **Repository Path**: one996/studydome ## Basic Information - **Project Name**: studydome - **Description**: 代码学习,技术分享,菜鸟进步 - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 15 - **Forks**: 3 - **Created**: 2022-02-03 - **Last Updated**: 2026-02-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Project README ## Project Overview This project is a comprehensive solution containing multiple modules, primarily covering the following technical areas: - **Avalonia UI Examples**: Provides cross-platform UI application examples based on the Avalonia framework. - **Halcon Image Processing**: Integrates the Halcon image processing library for industrial vision, image recognition, and other scenarios. - **Database and ORM Operations**: Uses SqlSugar for database operations, including user management, article management, and logging functions. - **JWT Authentication**: Implements JWT-based authentication and access control. - **WPF Desktop Applications**: Provides desktop applications built with WPF, including event bus, password cracking simulation, file decompression, and more. - **Service Installation and Deployment**: Offers encapsulation for Windows service installation, startup, and shutdown operations. - **Network Communication**: Includes examples of various communication methods such as MQTT, Socket, Web API, etc. ## Project Structure ### Main Modules | Module Name | Description | |-------------|-------------| | `AvaloniaDemo` | Avalonia UI example program demonstrating basic UI construction and data binding. | | `HalconDemo` | Halcon image processing example, including template matching and graphic drawing functions. | | `Like.BLL` | Business logic layer encapsulating core business logic for users, articles, permissions, etc. | | `Like.DAL` | Data access layer implementing database operations based on SqlSugar. | | `Like.Model` | Data model definitions including entity classes for users, roles, permissions, logs, etc. | | `Like.Common` | Common utility classes including JWT, encryption, configuration reading, logging, and other general functions. | | `Like.ServiceInstaller` | Windows service installer supporting service installation, uninstallation, startup, and shutdown operations. | | `WPF-DEMO` | WPF desktop application demonstrating event bus, password cracking simulation, file decompression, and other functions. | | `Study.Demo` | Learning example module containing programming practices for tasks, events, Socket, MQTT, etc. | | `StudyDome` | Web API example project demonstrating JWT authentication, weather forecast interface, etc. | ## Technology Stack - **Languages**: C# - **Frameworks**: - Avalonia UI - WPF - ASP.NET Core - **ORM**: SqlSugar - **Image Processing**: Halcon - **Authentication**: JWT - **Communication Protocols**: MQTT, Socket, HTTP API - **Logging**: Serilog - **Dependency Injection**: Microsoft.Extensions.DependencyInjection ## Quick Start ### Development Environment Requirements - .NET 6 SDK or higher - Visual Studio 2022 or Rider - Halcon installation package (required to run image processing modules) ### Launching the Avalonia Example 1. Open the `AvaloniaDemo` project. 2. Build and run the project. 3. View the main window interface and test button click events. ### Launching the WPF Example 1. Open the `WPF-DEMO` project. 2. Build and run the project. 3. Test functions such as password cracking simulation and file decompression. ### Launching the Web API Example 1. Open the `StudyDome` project. 2. Build and run the project. 3. Use Postman or Swagger to test the `/weatherforecast` endpoint. 4. Obtain a Token via the JWT login endpoint and access protected resources. ### Launching the Service Installer 1. Open the `Like.ServiceInstaller` project. 2. Build to generate the `.exe` file. 3. Run with administrator privileges to install and start the service. ## Usage Instructions ### JWT Authentication - Login endpoint: `POST /api/account/login` - Request body: ```json { "username": "admin", "password": "123456" } ``` - After obtaining the Token, add the following header to requests: ``` Authorization: Bearer ``` ### Database Configuration Configure the database connection string in `appsettings.json`: ```json { "ConnectionStrings": { "DefaultConnection": "Server=.;Database=LikeDB;Trusted_Connection=True;" } } ``` ### Logging Serilog is used for logging. The default log path is the `logs` folder, with filenames in the format `yyyyMMdd.log`. ## Contribution Guidelines PRs and Issues are welcome. Please follow these guidelines: - Ensure code compiles before submitting. - Add necessary comments and documentation. - Follow the project's coding style. ## License This project uses the MIT License. Please see the [LICENSE](LICENSE) file for details.