Skip to content

Commit 521aee1

Browse files
committed
feat: rebrand site as MaxAPI
1 parent dded884 commit 521aee1

36 files changed

Lines changed: 160 additions & 109 deletions

AGENTS.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ These rules are project-specific and apply to all agent work on Pixel.
44

55
## Development Environment
66

7-
- Do all feature development on the remote server `root@52.77.228.143`.
8-
- Main repository path: `/opt/pixel-src`.
9-
- Feature worktree path pattern: `/opt/pixel-worktrees/<feature-name>`.
10-
- Do not pull the repository to the user's Mac for development, testing, or builds unless the user explicitly asks for local work.
11-
- The local machine may be used only for conversation, coordination, or temporary non-source artifacts when unavoidable.
7+
- Do feature development, testing, and builds locally in `/Users/beetle/Desktop/code/Pixel`.
8+
- Use the remote server only for deployment, production builds, production service restarts, and post-deploy verification unless the user explicitly asks for server-side development.
9+
- Production server: `root@52.77.228.143`.
10+
- Server repository path for deployment: `/opt/pixel-src`.
11+
- Server service path: `/opt/pixel`.
12+
- Do not use the production runtime directory as a development workspace.
1213

1314
## Branch And Worktree Flow
1415

15-
- Every new requirement starts from the latest GitHub `origin/main`.
16-
- Fetch first, then create a dedicated feature branch from `origin/main`.
17-
- Use one isolated worktree per requirement.
16+
- Every new requirement starts locally from the latest GitHub `origin/main`.
17+
- Fetch first, then create a dedicated local feature branch from `origin/main`.
18+
- Use one dedicated branch per requirement.
19+
- Use a local isolated worktree only when multiple requirements or parallel branches need to be active at the same time.
1820
- Branch naming:
1921
- `feat/<feature-name>` for features.
2022
- `fix/<bug-name>` for bug fixes.
@@ -26,10 +28,18 @@ These rules are project-specific and apply to all agent work on Pixel.
2628
Example:
2729

2830
```bash
29-
cd /opt/pixel-src
31+
cd /Users/beetle/Desktop/code/Pixel
3032
git fetch origin
31-
mkdir -p /opt/pixel-worktrees
32-
git worktree add /opt/pixel-worktrees/<feature-name> -b feat/<feature-name> origin/main
33+
git switch -c feat/<feature-name> origin/main
34+
```
35+
36+
Optional local worktree example for parallel work:
37+
38+
```bash
39+
cd /Users/beetle/Desktop/code/Pixel
40+
git fetch origin
41+
mkdir -p .worktrees
42+
git worktree add .worktrees/<feature-name> -b feat/<feature-name> origin/main
3343
```
3444

3545
## Default Multi-Agent Roles
@@ -74,14 +84,14 @@ The controller agent is responsible for coordination:
7484

7585
- Use test-driven development for code behavior changes whenever practical.
7686
- Write or update tests before production code for new behavior.
77-
- Prefer running most verification in the local development environment or an isolated test environment before handoff.
78-
- In this project, "local development environment" means the feature worktree on the development server or another explicitly approved non-production environment, not the production runtime directory.
79-
- Development-environment tests are allowed by default when they are scoped, reproducible, and do not mutate production data.
80-
- Allowed by default on the development environment:
87+
- Run development verification locally before handoff.
88+
- In this project, "local development environment" means the local repository or local feature worktree, not the production server runtime directory.
89+
- Local development tests are allowed by default when they are scoped, reproducible, and do not mutate production data.
90+
- Allowed by default locally:
8191
- Targeted backend unit tests, for example a specific Go package or `-run` pattern.
8292
- Targeted frontend tests, for example a specific Vitest spec.
8393
- Static checks such as `gofmt`, `git diff --check`, type checks, and lint checks.
84-
- Frontend/backend builds when needed to prove compile correctness, as long as they run from the feature worktree and do not restart production services.
94+
- Frontend/backend builds when needed to prove compile correctness, as long as they run from the local feature branch/worktree and do not restart production services.
8595
- Require explicit user approval before running:
8696
- Load tests, pressure tests, benchmark loops, or high-concurrency checks.
8797
- Full-suite tests known to be long-running or resource-heavy.
@@ -100,24 +110,25 @@ The controller agent is responsible for coordination:
100110

101111
Feature branches are not deployed automatically.
102112

103-
1. Develop in the feature worktree.
104-
2. Run relevant tests and verification.
113+
1. Develop locally on the feature branch or local feature worktree.
114+
2. Run relevant local tests and verification.
105115
3. Commit changes on the feature branch.
106116
4. Push the feature branch to GitHub.
107117
5. Tell the user the branch name, summary, changed files, and verification results.
108118
6. Wait for user review or explicit approval.
109119
7. Merge to `main` only after approval.
110-
8. Deploy from `main`.
111-
9. Build the production binary/assets.
120+
8. On the server, pull the approved GitHub `main`.
121+
9. Build the production binary/assets on the server from the pulled GitHub code.
112122
10. Restart services.
113123
11. Verify production behavior.
114124
12. Create a version tag when the deployment is accepted.
115125

116126
## Production Deployment Rules
117127

118-
- Deployments happen on the server, not from the user's Mac.
128+
- Deployments happen on the server by pulling from GitHub, not by copying uncommitted local files.
119129
- Do not deploy a feature branch directly unless the user explicitly requests it.
120130
- Prefer deploying from `main` after merge.
131+
- Before deployment, make sure the intended commits have been pushed to GitHub.
121132
- Keep backups of service config files before editing operational configuration.
122133
- After deployment, verify:
123134
- `pixel.service` is active.

backend/internal/server/api_contract_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ func TestAPIContracts(t *testing.T) {
579579
service.SettingKeySMTPUsername: "user",
580580
service.SettingKeySMTPPassword: "secret",
581581
service.SettingKeySMTPFrom: "no-reply@example.com",
582-
service.SettingKeySMTPFromName: "Sub2API",
582+
service.SettingKeySMTPFromName: "MaxAPI",
583583
service.SettingKeySMTPUseTLS: "true",
584584

585585
service.SettingKeyTurnstileEnabled: "true",
@@ -608,7 +608,7 @@ func TestAPIContracts(t *testing.T) {
608608
service.SettingKeyOIDCConnectUserInfoIDPath: "",
609609
service.SettingKeyOIDCConnectUserInfoUsernamePath: "",
610610

611-
service.SettingKeySiteName: "Sub2API",
611+
service.SettingKeySiteName: "MaxAPI",
612612
service.SettingKeySiteLogo: "",
613613
service.SettingKeySiteSubtitle: "Subtitle",
614614
service.SettingKeyAPIBaseURL: "https://api.example.com",
@@ -651,7 +651,7 @@ func TestAPIContracts(t *testing.T) {
651651
"smtp_username": "user",
652652
"smtp_password_configured": true,
653653
"smtp_from_email": "no-reply@example.com",
654-
"smtp_from_name": "Sub2API",
654+
"smtp_from_name": "MaxAPI",
655655
"smtp_use_tls": true,
656656
"turnstile_enabled": true,
657657
"turnstile_site_key": "site-key",
@@ -686,7 +686,7 @@ func TestAPIContracts(t *testing.T) {
686686
"ops_realtime_monitoring_enabled": true,
687687
"ops_query_mode_default": "auto",
688688
"ops_metrics_interval_seconds": 60,
689-
"site_name": "Sub2API",
689+
"site_name": "MaxAPI",
690690
"site_logo": "",
691691
"site_subtitle": "Subtitle",
692692
"api_base_url": "https://api.example.com",
@@ -895,7 +895,7 @@ func TestAPIContracts(t *testing.T) {
895895
"oidc_connect_userinfo_email_path": "",
896896
"oidc_connect_userinfo_id_path": "",
897897
"oidc_connect_userinfo_username_path": "",
898-
"site_name": "Sub2API",
898+
"site_name": "MaxAPI",
899899
"site_logo": "",
900900
"site_subtitle": "Subscription to API Conversion Platform",
901901
"api_base_url": "",

backend/internal/service/auth_email_binding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (s *AuthService) SendEmailIdentityBindCode(ctx context.Context, userID int6
124124
return ErrServiceUnavailable
125125
}
126126

127-
siteName := "Sub2API"
127+
siteName := "MaxAPI"
128128
if s.settingService != nil {
129129
siteName = s.settingService.GetSiteName(ctx)
130130
}

backend/internal/service/auth_oauth_email_flow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (s *AuthService) SendPendingOAuthVerifyCode(ctx context.Context, email stri
4141
return nil, ErrServiceUnavailable
4242
}
4343

44-
siteName := "Sub2API"
44+
siteName := "MaxAPI"
4545
if s.settingService != nil {
4646
siteName = s.settingService.GetSiteName(ctx)
4747
}

backend/internal/service/auth_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (s *AuthService) SendVerifyCode(ctx context.Context, email string) error {
313313
}
314314

315315
// 获取网站名称
316-
siteName := "Sub2API"
316+
siteName := "MaxAPI"
317317
if s.settingService != nil {
318318
siteName = s.settingService.GetSiteName(ctx)
319319
}
@@ -356,7 +356,7 @@ func (s *AuthService) SendVerifyCodeAsync(ctx context.Context, email string) (*S
356356
}
357357

358358
// 获取网站名称
359-
siteName := "Sub2API"
359+
siteName := "MaxAPI"
360360
if s.settingService != nil {
361361
siteName = s.settingService.GetSiteName(ctx)
362362
}
@@ -1241,7 +1241,7 @@ func (s *AuthService) preparePasswordReset(ctx context.Context, email, frontendB
12411241
}
12421242

12431243
// Get site name
1244-
siteName := "Sub2API"
1244+
siteName := "MaxAPI"
12451245
if s.settingService != nil {
12461246
siteName = s.settingService.GetSiteName(ctx)
12471247
}

backend/internal/service/balance_notify_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
quotaDimWeekly = "weekly"
2323
quotaDimTotal = "total"
2424

25-
defaultSiteName = "Sub2API"
25+
defaultSiteName = "MaxAPI"
2626
)
2727

2828
// quotaDimLabels maps dimension names to display labels.

backend/internal/service/payment_order.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,15 +471,15 @@ func (s *PaymentService) buildPaymentSubject(plan *dbent.SubscriptionPlan, limit
471471
if plan.ProductName != "" {
472472
return plan.ProductName
473473
}
474-
return "Sub2API Subscription " + plan.Name
474+
return "MaxAPI Subscription " + plan.Name
475475
}
476476
amountStr := strconv.FormatFloat(limitAmount, 'f', 2, 64)
477477
pf := strings.TrimSpace(cfg.ProductNamePrefix)
478478
sf := strings.TrimSpace(cfg.ProductNameSuffix)
479479
if pf != "" || sf != "" {
480480
return strings.TrimSpace(pf + " " + amountStr + " " + sf)
481481
}
482-
return "Sub2API " + amountStr + " CNY"
482+
return "MaxAPI " + amountStr + " CNY"
483483
}
484484

485485
func (s *PaymentService) maybeBuildWeChatOAuthRequiredResponse(ctx context.Context, req CreateOrderRequest, amount, payAmount, feeRate float64) (*CreateOrderResponse, error) {

backend/internal/service/setting_service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ func (s *SettingService) GetPublicSettings(ctx context.Context) (*PublicSettings
511511
TotpEnabled: settings[SettingKeyTotpEnabled] == "true",
512512
TurnstileEnabled: settings[SettingKeyTurnstileEnabled] == "true",
513513
TurnstileSiteKey: settings[SettingKeyTurnstileSiteKey],
514-
SiteName: s.getStringOrDefault(settings, SettingKeySiteName, "Sub2API"),
514+
SiteName: s.getStringOrDefault(settings, SettingKeySiteName, "MaxAPI"),
515515
SiteLogo: settings[SettingKeySiteLogo],
516516
SiteSubtitle: s.getStringOrDefault(settings, SettingKeySiteSubtitle, "Subscription to API Conversion Platform"),
517517
APIBaseURL: settings[SettingKeyAPIBaseURL],
@@ -1650,7 +1650,7 @@ func (s *SettingService) IsTotpEncryptionKeyConfigured() bool {
16501650
func (s *SettingService) GetSiteName(ctx context.Context) string {
16511651
value, err := s.settingRepo.GetValue(ctx, SettingKeySiteName)
16521652
if err != nil || value == "" {
1653-
return "Sub2API"
1653+
return "MaxAPI"
16541654
}
16551655
return value
16561656
}
@@ -1826,7 +1826,7 @@ func (s *SettingService) InitializeDefaultSettings(ctx context.Context) error {
18261826
SettingKeyEmailVerifyEnabled: "false",
18271827
SettingKeyRegistrationEmailSuffixWhitelist: "[]",
18281828
SettingKeyPromoCodeEnabled: "true", // 默认启用优惠码功能
1829-
SettingKeySiteName: "Sub2API",
1829+
SettingKeySiteName: "MaxAPI",
18301830
SettingKeySiteLogo: "",
18311831
SettingKeyPurchaseSubscriptionEnabled: "false",
18321832
SettingKeyPurchaseSubscriptionURL: "",
@@ -1972,7 +1972,7 @@ func (s *SettingService) parseSettings(settings map[string]string) *SystemSettin
19721972
TurnstileEnabled: settings[SettingKeyTurnstileEnabled] == "true",
19731973
TurnstileSiteKey: settings[SettingKeyTurnstileSiteKey],
19741974
TurnstileSecretKeyConfigured: settings[SettingKeyTurnstileSecretKey] != "",
1975-
SiteName: s.getStringOrDefault(settings, SettingKeySiteName, "Sub2API"),
1975+
SiteName: s.getStringOrDefault(settings, SettingKeySiteName, "MaxAPI"),
19761976
SiteLogo: settings[SettingKeySiteLogo],
19771977
SiteSubtitle: s.getStringOrDefault(settings, SettingKeySiteSubtitle, "Subscription to API Conversion Platform"),
19781978
APIBaseURL: settings[SettingKeyAPIBaseURL],

backend/internal/service/totp_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const (
8989
totpLoginTTL = 5 * time.Minute
9090
totpAttemptsTTL = 15 * time.Minute
9191
maxTotpAttempts = 5
92-
totpIssuer = "Sub2API"
92+
totpIssuer = "MaxAPI"
9393
)
9494

9595
// TotpService handles TOTP operations

backend/internal/service/user_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ func saveNotifyVerifyCode(ctx context.Context, cache EmailCache, email, code str
11681168

11691169
// sendNotifyVerifyEmail builds and sends the verification email.
11701170
func (s *UserService) sendNotifyVerifyEmail(ctx context.Context, emailService *EmailService, email, code string) error {
1171-
siteName := "Sub2API"
1171+
siteName := "MaxAPI"
11721172
if s.settingRepo != nil {
11731173
if name, err := s.settingRepo.GetValue(ctx, SettingKeySiteName); err == nil && name != "" {
11741174
siteName = name

0 commit comments

Comments
 (0)