81 lines
2.2 KiB
Markdown
81 lines
2.2 KiB
Markdown
# Tech Stack & Build
|
|
|
|
## WebAPI (Main Forum API) — `server/webapi/LiveForum/`
|
|
- .NET 8 Web API
|
|
- ORM: FreeSql (SQL Server)
|
|
- DI: Autofac (assembly scanning + property injection)
|
|
- Cache: Redis (StackExchange.Redis)
|
|
- Background Jobs: Hangfire (SQL Server storage)
|
|
- Config: AgileConfig (remote config center with hot reload)
|
|
- Logging: Serilog (console + file)
|
|
- Auth: JWT tokens (Redis-backed token management, validated against DB)
|
|
- WeChat SDK: SKIT.FlurlHttpClient.Wechat.Api
|
|
- File Storage: Tencent COS
|
|
- JSON: Newtonsoft.Json (camelCase, custom converters)
|
|
- Testing: xUnit + FsCheck (property-based testing) + Moq
|
|
- System Cache: Custom field-level and system-level caching layer (SystemCache/)
|
|
- Domain Events: Event-driven async processing for likes, views, flowers, messages
|
|
|
|
## Admin Panel — `server/admin/ZrAdminNetCore/`
|
|
- .NET 8 (ZrAdminNetCore framework)
|
|
- ORM: SqlSugar
|
|
- Mapping: Mapster
|
|
- Logging: NLog
|
|
- Frontend: Vue 3 + Vite + Element Plus + Pinia (in `ZR.Vue/`)
|
|
|
|
## Frontend (Mini Program) — `前端/live-forum/`
|
|
- uni-app (Vue 3, targets WeChat Mini Program)
|
|
- UI: uview-plus
|
|
- Date: dayjs
|
|
- Styling: SCSS
|
|
|
|
## Crawlers — `server/crawler/`
|
|
- Python with Playwright for browser automation
|
|
- Separate modules for commerce and entertainment data
|
|
- CLI via `main.py` (login, fetch, daemon modes)
|
|
|
|
## Load Testing — `server/k6/`
|
|
- k6 scripts for API performance testing
|
|
|
|
## Databases
|
|
- SQL Server (primary, for both WebAPI and Admin)
|
|
- Redis (caching, message queues, batch sync buffers, JWT token store)
|
|
|
|
## Common Commands
|
|
|
|
### WebAPI
|
|
```bash
|
|
cd server/webapi/LiveForum
|
|
dotnet restore LiveForum.sln
|
|
dotnet build LiveForum.sln
|
|
dotnet run --project LiveForum.WebApi
|
|
dotnet test LiveForum.Tests # Run tests
|
|
```
|
|
|
|
### Admin Backend
|
|
```bash
|
|
cd server/admin/ZrAdminNetCore
|
|
dotnet restore ZRAdmin.sln
|
|
dotnet build ZRAdmin.sln
|
|
dotnet run --project ZR.Admin.WebApi
|
|
```
|
|
|
|
### Admin Frontend
|
|
```bash
|
|
cd server/admin/ZrAdminNetCore/ZR.Vue
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
### Crawlers
|
|
```bash
|
|
cd server/crawler/commerce # or entertainment
|
|
pip install -r requirements.txt
|
|
playwright install chromium
|
|
python main.py login # Manual browser login
|
|
python main.py daemon # Scheduled crawling
|
|
```
|
|
|
|
## API Documentation
|
|
- Swagger UI available at `/swagger` when running the WebAPI
|