RepoPilot

mhsanaei / 3x-ui

Search mhsanaei/3x-ui

GitHub

Code

How mhsanaei/3x-ui is laid out, and where to start for common changes.

There is no import map for this report yet.

Where to start reading

  1. Repository root
  2. Repository root
  3. Suggested starting pointAI
  4. Suggested starting pointAI
  5. Suggested starting pointAI
  6. Suggested starting pointAI
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a new protocol handler

  • Create protocol manager in internal/{protocol}/manager.go with lifecycle hooks (Start, Stop, Reload)
  • Register protocol in config schema at internal/config/config.go under appropriate protocol section
  • Emit StateChanged events via internal/eventbus/bus.go when protocol state mutates
  • Add REST endpoints in internal/web/controller/api.go to expose protocol-specific operations

Add a new database table or client field

  • Define schema changes in internal/database/db.go as migration functions with version tracking
  • Add field to relevant struct in internal/config/config.go or create new model file
  • Expose via REST in internal/web/controller/api.go or internal/web/controller/client.go

Add a new REST API endpoint

  • Add handler function to internal/web/controller/api.go following existing Gin patterns (c *gin.Context receiver)
  • Emit relevant event via internal/eventbus/bus.go if mutation affects protocol state
  • Add auth middleware check in internal/web/controller/base.go if endpoint requires authentication

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • No public API or start-up file could be picked out from the file names.
  • The file list is newer than the written guide, so descriptions and suggested changes may describe older code.

Code quality and hotspots

Largest source files

  • Branch points67 per file on average
  • Code issues0 errors, 24 warnings
  • Largest file3,531 lines
  • Hotspot load10 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions10 workflows
  • Tests881 test filesGo test · Jest/Vitest · 1.0 test files per source file (file count, not coverage)
  • Dependency updatesCodeQL

Test folders: frontend/src/test/__snapshots__ · docs/lib/xray · frontend/src/test

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.