Skip to content

Commit 473022a

Browse files
committed
update latest
1 parent 85331a7 commit 473022a

File tree

3,517 files changed

+411320
-277242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,517 files changed

+411320
-277242
lines changed

.circleci/config.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.cursor/rules/dotnet-core.mdc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# .NET Development Rules
8+
9+
You are a senior .NET backend developer and an expert in C#, ASP.NET Core, and Entity Framework Core.
10+
11+
## Code Style and Structure
12+
- Write concise, idiomatic C# code with accurate examples.
13+
- Follow .NET and ASP.NET Core conventions and best practices.
14+
- Use object-oriented and functional programming patterns as appropriate.
15+
- Prefer LINQ and lambda expressions for collection operations.
16+
- Use descriptive variable and method names (e.g., 'IsUserSignedIn', 'CalculateTotal').
17+
- Structure files according to .NET conventions (Controllers, Models, Services, etc.).
18+
19+
## Naming Conventions
20+
- Use PascalCase for class names, method names, and public members.
21+
- Use camelCase for local variables and private fields.
22+
- Use UPPERCASE for constants.
23+
- Prefix interface names with "I" (e.g., 'IUserService').
24+
25+
## C# and .NET Usage
26+
- Use C# 10+ features when appropriate (e.g., record types, pattern matching, null-coalescing assignment).
27+
- Leverage built-in ASP.NET Core features and middleware.
28+
- Use Entity Framework Core effectively for database operations.
29+
30+
## Syntax and Formatting
31+
- Follow the C# Coding Conventions (https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions)
32+
- Use C#'s expressive syntax (e.g., null-conditional operators, string interpolation)
33+
- Use 'var' for implicit typing when the type is obvious.
34+
35+
## Error Handling and Validation
36+
- Use exceptions for exceptional cases, not for control flow.
37+
- Implement proper error logging using built-in .NET logging or a third-party logger.
38+
- Use Data Annotations or Fluent Validation for model validation.
39+
- Implement global exception handling middleware.
40+
- Return appropriate HTTP status codes and consistent error responses.
41+
42+
## API Design
43+
- Follow RESTful API design principles.
44+
- Use attribute routing in controllers.
45+
- Implement versioning for your API.
46+
- Use action filters for cross-cutting concerns.
47+
48+
## Performance Optimization
49+
- Use asynchronous programming with async/await for I/O-bound operations.
50+
- Implement caching strategies using IMemoryCache or distributed caching.
51+
- Use efficient LINQ queries and avoid N+1 query problems.
52+
- Implement pagination for large data sets.
53+
54+
## Key Conventions
55+
- Use Dependency Injection for loose coupling and testability.
56+
- Implement repository pattern or use Entity Framework Core directly, depending on the complexity.
57+
- Use AutoMapper for object-to-object mapping if needed.
58+
- Implement background tasks using IHostedService or BackgroundService.
59+
60+
## Testing
61+
- Write unit tests using xUnit, NUnit, or MSTest.
62+
- Use Moq or NSubstitute for mocking dependencies.
63+
- Implement integration tests for API endpoints.
64+
65+
## Security
66+
- Use Authentication and Authorization middleware.
67+
- Implement JWT authentication for stateless API authentication.
68+
- Use HTTPS and enforce SSL.
69+
- Implement proper CORS policies.
70+
71+
## API Documentation
72+
- Use Swagger/OpenAPI for API documentation (as per installed Swashbuckle.AspNetCore package).
73+
- Provide XML comments for controllers and models to enhance Swagger documentation.
74+
75+
Follow the official Microsoft documentation and ASP.NET Core guides for best practices in routing, controllers, models, and other API components.

.deepsource.toml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,24 @@ version = 1
22

33
[[analyzers]]
44
name = "csharp"
5-
enabled = true
5+
enabled = true
6+
7+
[analyzers.meta]
8+
dotnet_version = "9.0.x"
9+
skip_doc_coverage = ["test", "tests", "Test", "Tests"]
10+
11+
[[analyzers]]
12+
name = "secrets"
13+
enabled = true
14+
15+
[[analyzers]]
16+
name = "docker"
17+
enabled = true
18+
19+
[[transformers]]
20+
name = "autopep8"
21+
enabled = false
22+
23+
[[transformers]]
24+
name = "dotnet-format"
25+
enabled = true

.do/app.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# DigitalOcean App Platform deployment template for Mixcore CMS - Standard Configuration
2+
# Deploy to: https://cloud.digitalocean.com/apps/new?refcode=4d26c2aaade2
3+
# Configuration: Mixcore + MySQL + Redis (Recommended for most use cases)
4+
# Estimated cost: ~$42/month
5+
#
6+
# For other configurations, see:
7+
# - deploy-basic.yaml (MySQL only, ~$27/month)
8+
# - deploy-dev.yaml (Development/testing, ~$32/month)
9+
# - deploy-postgresql.yaml (PostgreSQL + Redis, ~$42/month)
10+
# - deploy-production.yaml (High-performance, ~$84/month)
11+
spec:
12+
name: mixcore-cms-standard
13+
region: nyc1
14+
15+
# Database services
16+
databases:
17+
- name: mixcore-mysql
18+
engine: MYSQL
19+
version: "8"
20+
size: db-s-1vcpu-1gb
21+
num_nodes: 1
22+
23+
- name: mixcore-redis
24+
engine: REDIS
25+
version: "7"
26+
size: db-s-1vcpu-1gb
27+
num_nodes: 1
28+
29+
# Main application service
30+
services:
31+
- name: mixcore-web
32+
environment_slug: docker
33+
git:
34+
branch: develop
35+
repo_clone_url: https://github.com/mixcore/mix.core
36+
dockerfile_path: Dockerfile
37+
http_port: 80
38+
instance_count: 1
39+
instance_size_slug: apps-s-1vcpu-1gb
40+
41+
health_check:
42+
http_path: /health
43+
initial_delay_seconds: 60
44+
period_seconds: 30
45+
timeout_seconds: 10
46+
success_threshold: 1
47+
failure_threshold: 3
48+
49+
routes:
50+
- path: /
51+
52+
# Environment variables
53+
envs:
54+
- key: ASPNETCORE_ENVIRONMENT
55+
value: Production
56+
scope: RUN_TIME
57+
- key: ASPNETCORE_URLS
58+
value: http://+:80
59+
scope: RUN_TIME
60+
- key: ConnectionStrings__MixDbContext
61+
value: ${mixcore-mysql.DATABASE_URL}
62+
scope: RUN_TIME
63+
- key: Redis__ConnectionString
64+
value: ${mixcore-redis.DATABASE_URL}
65+
scope: RUN_TIME
66+
- key: ASPNETCORE_FORWARDEDHEADERS_ENABLED
67+
value: "true"
68+
scope: RUN_TIME

.do/deploy-basic.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# DigitalOcean App Platform deployment template for Mixcore CMS - Basic Configuration
2+
# Deploy to: https://cloud.digitalocean.com/apps/new?refcode=4d26c2aaade2
3+
# Configuration: Mixcore + MySQL (No Redis cache)
4+
# Estimated cost: ~$27/month
5+
spec:
6+
name: mixcore-cms-basic
7+
region: nyc1
8+
9+
# Database services
10+
databases:
11+
- name: mixcore-mysql
12+
engine: MYSQL
13+
version: "8"
14+
size: db-s-1vcpu-1gb
15+
num_nodes: 1
16+
17+
# Main application service
18+
services:
19+
- name: mixcore-web
20+
environment_slug: docker
21+
git:
22+
branch: develop
23+
repo_clone_url: https://github.com/mixcore/mix.core
24+
dockerfile_path: Dockerfile
25+
http_port: 80
26+
instance_count: 1
27+
instance_size_slug: apps-s-1vcpu-1gb
28+
29+
health_check:
30+
http_path: /health
31+
initial_delay_seconds: 60
32+
period_seconds: 30
33+
timeout_seconds: 10
34+
success_threshold: 1
35+
failure_threshold: 3
36+
37+
routes:
38+
- path: /
39+
40+
# Environment variables
41+
envs:
42+
- key: ASPNETCORE_ENVIRONMENT
43+
value: Production
44+
scope: RUN_TIME
45+
- key: ASPNETCORE_URLS
46+
value: http://+:80
47+
scope: RUN_TIME
48+
- key: ConnectionStrings__MixDbContext
49+
value: ${mixcore-mysql.DATABASE_URL}
50+
scope: RUN_TIME
51+
- key: ASPNETCORE_FORWARDEDHEADERS_ENABLED
52+
value: "true"
53+
scope: RUN_TIME

.do/deploy-dev.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# DigitalOcean App Platform deployment template for Mixcore CMS - Development Configuration
2+
# Deploy to: https://cloud.digitalocean.com/apps/new?refcode=4d26c2aaade2
3+
# Configuration: Mixcore + MySQL + Redis (Smallest instances for development/testing)
4+
# Estimated cost: ~$32/month
5+
spec:
6+
name: mixcore-cms-dev
7+
region: nyc1
8+
9+
# Database services
10+
databases:
11+
- name: mixcore-mysql
12+
engine: MYSQL
13+
version: "8"
14+
size: db-s-1vcpu-1gb
15+
num_nodes: 1
16+
17+
- name: mixcore-redis
18+
engine: REDIS
19+
version: "7"
20+
size: db-s-1vcpu-1gb
21+
num_nodes: 1
22+
23+
# Main application service
24+
services:
25+
- name: mixcore-web
26+
environment_slug: docker
27+
git:
28+
branch: develop
29+
repo_clone_url: https://github.com/mixcore/mix.core
30+
dockerfile_path: Dockerfile
31+
http_port: 80
32+
instance_count: 1
33+
instance_size_slug: apps-s-1vcpu-512mb
34+
35+
health_check:
36+
http_path: /health
37+
initial_delay_seconds: 60
38+
period_seconds: 30
39+
timeout_seconds: 10
40+
success_threshold: 1
41+
failure_threshold: 3
42+
43+
routes:
44+
- path: /
45+
46+
# Environment variables
47+
envs:
48+
- key: ASPNETCORE_ENVIRONMENT
49+
value: Development
50+
scope: RUN_TIME
51+
- key: ASPNETCORE_URLS
52+
value: http://+:80
53+
scope: RUN_TIME
54+
- key: ConnectionStrings__MixDbContext
55+
value: ${mixcore-mysql.DATABASE_URL}
56+
scope: RUN_TIME
57+
- key: Redis__ConnectionString
58+
value: ${mixcore-redis.DATABASE_URL}
59+
scope: RUN_TIME
60+
- key: ASPNETCORE_FORWARDEDHEADERS_ENABLED
61+
value: "true"
62+
scope: RUN_TIME

.do/deploy-postgresql.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# DigitalOcean App Platform deployment template for Mixcore CMS - PostgreSQL Configuration
2+
# Deploy to: https://cloud.digitalocean.com/apps/new?refcode=4d26c2aaade2
3+
# Configuration: Mixcore + PostgreSQL + Redis (Alternative database choice)
4+
# Estimated cost: ~$42/month
5+
spec:
6+
name: mixcore-cms-postgresql
7+
region: nyc1
8+
9+
# Database services
10+
databases:
11+
- name: mixcore-postgres
12+
engine: PG
13+
version: "15"
14+
size: db-s-1vcpu-1gb
15+
num_nodes: 1
16+
17+
- name: mixcore-redis
18+
engine: REDIS
19+
version: "7"
20+
size: db-s-1vcpu-1gb
21+
num_nodes: 1
22+
23+
# Main application service
24+
services:
25+
- name: mixcore-web
26+
environment_slug: docker
27+
git:
28+
branch: develop
29+
repo_clone_url: https://github.com/mixcore/mix.core
30+
dockerfile_path: Dockerfile
31+
http_port: 80
32+
instance_count: 1
33+
instance_size_slug: apps-s-1vcpu-1gb
34+
35+
health_check:
36+
http_path: /health
37+
initial_delay_seconds: 60
38+
period_seconds: 30
39+
timeout_seconds: 10
40+
success_threshold: 1
41+
failure_threshold: 3
42+
43+
routes:
44+
- path: /
45+
46+
# Environment variables
47+
envs:
48+
- key: ASPNETCORE_ENVIRONMENT
49+
value: Production
50+
scope: RUN_TIME
51+
- key: ASPNETCORE_URLS
52+
value: http://+:80
53+
scope: RUN_TIME
54+
- key: ConnectionStrings__MixDbContext
55+
value: ${mixcore-postgres.DATABASE_URL}
56+
scope: RUN_TIME
57+
- key: Redis__ConnectionString
58+
value: ${mixcore-redis.DATABASE_URL}
59+
scope: RUN_TIME
60+
- key: ASPNETCORE_FORWARDEDHEADERS_ENABLED
61+
value: "true"
62+
scope: RUN_TIME
63+
- key: DatabaseProvider
64+
value: "POSTGRESQL"
65+
scope: RUN_TIME

0 commit comments

Comments
 (0)