6.4 KiB
6.4 KiB
Project Structure
/
├── server/
│ ├── webapi/LiveForum/ # Main forum API (.NET 8)
│ │ ├── LiveForum.WebApi/ # Entry point, controllers, background services
│ │ │ ├── Controllers/ # API endpoints (Auth, Posts, Comments, CDK, RealName, Config, etc.)
│ │ │ ├── BackgroundServices/ # Redis consumers, batch sync services (likes, views, flowers, messages)
│ │ │ └── Program.cs # App bootstrap, DI, middleware pipeline
│ │ ├── LiveForum.Service/ # Business logic (organized by domain)
│ │ │ ├── Auth/ # Login, WeChat auth
│ │ │ ├── Cdk/ # CDK activation logic
│ │ │ ├── Flowers/ # Flower gifting
│ │ │ ├── Home/ # Banners, popups
│ │ │ ├── Messages/ # Push notifications
│ │ │ ├── Others/ # WeChat Mini Program, file upload, etc.
│ │ │ ├── Permission/ # Identity group & certification permission checks
│ │ │ ├── Posts/ # Posts, comments, likes, categories
│ │ │ ├── RealName/ # Real-name verification
│ │ │ ├── ScheduledJobs/ # Hangfire jobs (flower reset, etc.)
│ │ │ ├── SensitiveWord/ # Content filtering
│ │ │ ├── Streamers/ # Streamer profiles
│ │ │ └── Users/ # User profiles, follows, certifications
│ │ ├── LiveForum.IService/ # Service interfaces (mirrors Service structure)
│ │ ├── LiveForum.Model/ # DTOs, entities, enums, events
│ │ │ ├── Dto/ # Data transfer objects (by domain)
│ │ │ ├── Model/ # Database entities (T_ prefix)
│ │ │ ├── Enum/ # Enumerations (PermissionType, LoginType, etc.)
│ │ │ └── Events/ # Domain events (flower, like, view, message)
│ │ ├── LiveForum.Code/ # Infrastructure & cross-cutting concerns
│ │ │ ├── AttributeExtend/ # Custom attributes (images, message, response cache)
│ │ │ ├── Base/ # BaseResponse, ResponseCode
│ │ │ ├── EventBus/ # Event bus infrastructure
│ │ │ ├── ExceptionExtend/ # Custom exceptions (LoginExpired, MessageBox, RedisNull)
│ │ │ ├── Extend/ # Request extensions
│ │ │ ├── JsonConverterExtend/ # JSON serialization customizations
│ │ │ ├── JwtInfrastructure/ # JWT auth (Redis-backed token management)
│ │ │ ├── MiddlewareExtend/ # Custom middleware (exception, execution time, sign, response cache)
│ │ │ ├── Redis/ # Redis service abstractions
│ │ │ ├── SensitiveWord/ # Content filtering engine
│ │ │ ├── SystemCache/ # System-level caching (AppConfig, field cache)
│ │ │ └── Utility/ # Helpers (MD5, phone validation, date, HTTP, etc.)
│ │ ├── LiveForum.Repository/ # Data access (FreeSql)
│ │ ├── LiveForum.Tests/ # xUnit + FsCheck tests
│ │ └── DatabaseScripts/ # SQL migration scripts
│ │
│ ├── admin/ZrAdminNetCore/ # Admin panel backend
│ │ ├── ZR.Admin.WebApi/ # Admin API entry point
│ │ │ └── Controllers/Liveforum/ # Forum admin CRUD endpoints (CDKs, permissions, anti-addiction, etc.)
│ │ ├── ZR.Service/Liveforum/ # Admin business logic (CRUD services for all forum entities)
│ │ ├── ZR.LiveForum/ # Forum-specific admin controllers
│ │ ├── ZR.LiveForum.Model/ # Forum admin models (mirrors WebAPI entities)
│ │ ├── ZR.Model/ # Core admin models
│ │ ├── ZR.Vue/ # Admin panel frontend (Vue 3 + Vite + Element Plus)
│ │ └── Infrastructure/ # Shared admin infrastructure
│ │
│ ├── admin/browser-extension/ # Browser extension for cookie management
│ │ └── live-forum-cookie/ # Chrome extension for forum cookie extraction
│ │
│ ├── crawler/ # Python data crawlers
│ │ ├── commerce/ # Commerce streamer data
│ │ └── entertainment/ # Entertainment streamer data
│ │
│ └── k6/ # Load testing scripts
│
├── 前端/live-forum/ # WeChat Mini Program (uni-app, Vue 3)
│ ├── pages/ # App pages (index, community, login, me, message)
│ ├── components/ # Shared UI components
│ ├── modules/ # Business modules
│ │ ├── api/ # API client (AppServer.js)
│ │ ├── server/ # Domain-specific API wrappers
│ │ └── utils/ # Utilities
│ └── static/ # Static assets
│
├── docs/ # Product requirements by version
│ ├── 1.0.1/
│ └── 1.2.0/
│
└── mcp/ # MCP database servers (dev tooling)
├── mssql-mcp-server/
└── mysql-mcp-server/
Key Conventions
- Database entity classes use
T_prefix (e.g.,T_Users,T_Posts,T_IdentityGroups) - Services are organized by domain folder in both Service and IService projects
- Service interfaces mirror the Service folder structure
- Autofac auto-registers services from
LiveForum.Serviceassembly (except singletons registered in Program.cs) - SQL migration scripts go in
DatabaseScripts/ - Requirements documents are versioned under
docs/{version}/ - Domain events in
LiveForum.Model/Events/for async operations (likes, views, flowers, messages) - Permission checks centralized in
LiveForum.Service/Permission/PermissionService.cs