Thanks to visit codestin.com
Credit goes to github.com

Skip to content

supersongssr/SPanel_bk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPanel - VPN/代理服务面板系统

Version PHP Slim

基于 Slim 框架开发的 VPN/代理服务管理面板,提供用户管理、节点管理、订阅服务、支付系统等完整功能。

📋 目录

🛠 技术栈

  • 后端框架: Slim 3.x
  • 模板引擎: Smarty 3.x
  • 数据库: MySQL/MariaDB
  • ORM: Illuminate Database (Laravel组件)
  • 缓存: Redis (Predis客户端)
  • 前端: Vue.js + jQuery
  • 支付集成: 多种支付网关

✨ 功能特性

  • ✅ 用户注册、登录、权限管理
  • ✅ 多节点管理和监控
  • ✅ 支持多种代理协议 (SS, SSR, V2Ray, Trojan)
  • ✅ 订阅链接生成和管理
  • ✅ 流量统计和限制
  • ✅ 支付网关集成
  • ✅ 邮件通知系统
  • ✅ 管理员后台
  • ✅ API接口支持
  • ✅ 多主题支持

📁 项目结构

SPanel/
├── app/                           # 核心应用目录
│   ├── Controllers/               # 控制器层
│   │   ├── Admin/                 # 管理员控制器
│   │   ├── Client/                # 客户端控制器
│   │   ├── Mu/                    # Mu协议控制器
│   │   ├── Mod_Mu/                # Mod_Mu控制器
│   │   ├── AdminController.php    # 主管理控制器
│   │   ├── ApiController.php      # API控制器
│   │   ├── AuthController.php     # 认证控制器
│   │   ├── UserController.php     # 用户控制器
│   │   └── ...                    # 其他控制器
│   ├── Models/                    # 数据模型层
│   │   ├── User.php               # 用户模型
│   │   ├── Node.php               # 节点模型
│   │   ├── TrafficLog.php         # 流量日志模型
│   │   ├── Code.php               # 邀请码模型
│   │   ├── Coupon.php             # 优惠券模型
│   │   └── ...                    # 其他模型
│   ├── Services/                  # 业务逻辑层
│   │   ├── Auth/                  # 认证服务
│   │   ├── Mail/                  # 邮件服务
│   │   ├── Gateway/               # 支付网关服务
│   │   ├── Config.php             # 配置服务
│   │   ├── Analytics.php          # 分析服务
│   │   └── ...                    # 其他服务
│   ├── Middleware/                # 中间件
│   │   ├── Auth.php               # 认证中间件
│   │   ├── Admin.php              # 管理员中间件
│   │   ├── Api.php                # API中间件
│   │   └── ...                    # 其他中间件
│   └── Utils/                     # 工具类
│       ├── Tools.php              # 通用工具
│       ├── Hash.php               # 加密工具
│       ├── Helper.php             # 辅助函数
│       └── ...                    # 其他工具
├── config/                        # 配置文件
│   ├── .config.php               # 主配置文件
│   └── routes.php                # 路由配置
├── public/                        # 公共资源
│   ├── assets/                   # 静态资源
│   ├── theme/                    # 主题文件
│   ├── vuedist/                  # Vue.js构建文件
│   └── index.php                 # 入口文件
├── sql/                          # 数据库文件
│   ├── all.sql                   # 完整数据库结构
│   ├── config.sql                # 配置表
│   └── ...                       # 其他SQL文件
├── storage/                      # 存储目录
├── vendor/                       # 依赖包
└── resources/                    # 资源文件

🧩 模块划分

1. user-management (用户管理模块)

文件位置: app/Controllers/UserController.php, app/Models/User.php

功能:

  • 用户注册、登录、认证
  • 用户信息管理和更新
  • 用户分组和权限管理
  • 邀请码系统
  • 用户充值和消费记录

输入 (Input):

  • user.email, user.username, user.pass - 注册信息
  • user.email/user.username + user.pass - 登录凭据
  • invite_code.code - 邀请码验证
  • user.money, user.plan_id, user.expire_in - 充值和套餐信息
  • user.class, user.node_group, user.node_speedlimit - 权限更新

输出 (Output):

  • user.id, user.email, user.uuid - 用户标识信息
  • user.transfer_enable, user.u, user.d - 流量数据
  • user.is_admin, user.class - 权限等级
  • user.money, user.ref_by_count - 账户统计
  • user_traffic_log.* - 流量使用记录

2. admin-panel (管理员模块)

文件位置: app/Controllers/AdminController.php, app/Controllers/Admin/

功能:

  • 系统管理界面
  • 节点管理和配置
  • 用户管理和审核
  • 系统配置管理
  • 统计分析和报表

输入 (Input):

  • user.email + user.pass (user.is_admin=1) - 管理员登录
  • node., user. - 节点和用户管理数据
  • config.item, config.value - 系统配置项
  • announcement.content - 公告内容
  • coupon., code. - 优惠券和充值码管理
  • query: user.class, node.status - 查询过滤条件

输出 (Output):

  • user.id, user.email, user.class, user.is_admin - 用户管理数据
  • node.id, node.name, node.status, node.node_heartbeat - 节点状态
  • config.item, config.value, config.class - 系统配置
  • SUM(user_traffic_log.traffic), COUNT(user.id) - 统计报表
  • announcement., coupon., payback.* - 系统数据

3. node-management (节点管理模块)

文件位置: app/Models/Node.php, app/Controllers/ApiController.php (部分功能)

功能:

  • 节点信息管理
  • 节点状态监控
  • 节点分组和等级管理
  • 节点流量统计
  • 在线用户监控

输入 (Input):

  • node.name, node.server, node.method, node.type - 节点配置
  • node.node_heartbeat, node.last_ping_time - 心跳和时间戳
  • node.status, node.node_group, node.node_class - 状态和分组
  • user_traffic_log.node_id, user_traffic_log.traffic - 流量数据
  • node.traffic_rate, node.node_speedlimit - 负载配置

输出 (Output):

  • node.id, node.name, node.server, node.region - 节点基本信息
  • node.status, node.node_heartbeat, node.last_ping_time - 节点状态
  • node_online_log.online_user, node_online_log.log_time - 在线统计
  • SUM(user_traffic_log.traffic) GROUP BY node_id - 流量报表
  • COUNT(DISTINCT alive_ip.userid) GROUP BY nodeid - 用户统计

4. api-service (API模块)

文件位置: app/Controllers/ApiController.php

功能:

  • RESTful API接口
  • Token认证机制
  • 节点信息查询
  • 用户信息接口
  • 第三方集成接口

输入 (Input):

  • GET /api/node: node.node_group, node.node_class, node.status - 节点过滤
  • POST /api/node: node.* - 节点创建数据
  • GET /api/user: user.id, user.email, user.uuid - 用户查询
  • user.uuid, user.class - Token认证参数
  • link.userid, link.token - 订阅链接验证

输出 (Output):

  • node.id, node.name, node.server, node.type - 节点列表
  • user.id, user.email, user.transfer_enable, user.money - 用户信息
  • link.address, link.port, link.token - 订阅配置
  • user_traffic_log.traffic, user_traffic_log.log_time - 使用记录
  • {status: 200/400/401/403/500, data: {...}} - API响应格式

5. authentication (认证与授权模块)

文件位置: app/Controllers/AuthController.php, app/Services/Auth/

功能:

  • 用户登录/注册
  • JWT Token管理
  • 权限验证中间件
  • 密码重置和找回
  • 二次验证支持

输入 (Input):

  • user.email/user.username + user.pass - 登录验证
  • user.email + user.pass + user.reg_ip - 注册数据
  • user.uuid + user.class - Token验证
  • user.is_admin + user.node_group - 权限检查
  • invite_code.code + user.id - 邀请验证

输出 (Output):

  • JWT: {user_id, exp, iat, role} - 认证令牌
  • user.id, user.email, user.class, user.expire_in - 会话信息
  • {authorized: true/false, permissions: [...]} - 权限结果
  • user.email + reset_token - 密码重置链接
  • {success: true, user_id: user.id} - 认证状态

6. payment-gateway (支付网关模块)

文件位置: app/Services/Gateway/, app/Controllers/QuickPayFunction.php

功能:

  • 多种支付方式集成 (支付宝、微信、PayPal等)
  • 支付回调处理
  • 充值记录管理
  • 优惠券和折扣系统
  • 自动化账单处理

输入 (Input):

  • code.code, code.number - 充值码使用
  • coupon.code, coupon.credit - 优惠券验证
  • bought.userid, bought.price, bought.coupon - 购买数据
  • user.id, user.money + payment_amount - 账户扣费
  • gateway_callback: {order_id, status, amount} - 支付回调

输出 (Output):

  • bought.id, bought.userid, bought.price, bought.datetime - 订单记录
  • code.isused=1, code.usedatetime, code.userid - 充值码状态
  • user.money += amount, payback.ref_get - 账户和返利更新
  • {payment_status: success/pending/failed, amount: xxx} - 支付状态
  • coupon.used_count++, payback.datetime - 使用统计

7. subscription-service (订阅服务模块)

文件位置: app/Controllers/LinkController.php, app/Controllers/Mu/, app/Controllers/Mod_Mu/

功能:

  • 订阅链接生成和管理
  • 多协议支持 (Shadowsocks, V2Ray, Trojan等)
  • 配置文件自动生成
  • Mu协议支持
  • 节点负载均衡

输入 (Input):

  • link.userid, link.token - 订阅认证
  • user.class, user.node_group, user.expire_in - 权限验证
  • link.type, link.ios - 协议和设备类型
  • node.node_class, node.node_group, node.status - 节点过滤
  • link.isp, link.geo - 地理位置过滤

输出 (Output):

  • link.address, link.port, link.method - 配置参数
  • node.server, node.name, node.region - 可用节点列表
  • user.transfer_enable, user.u, user.d - 流量使用情况
  • alive_ip.ip, alive_ip.datetime - 连接记录
  • config files: SS/V2Ray/Trojan - 协议配置文件

8. mail-service (邮件服务模块)

文件位置: app/Services/Mail/, app/Services/Mail.php

功能:

  • 邮件发送服务
  • 邮件模板管理
  • 邮件验证功能
  • 系统通知推送
  • 批量邮件发送

输入 (Input):

  • user.email, user.username - 收件人信息
  • announcement.content - 公告邮件内容
  • user.last_checkin_time, user.expire_in - 状态通知
  • config.item = 'mail_*' - 邮件配置
  • template_vars: {user_id, node_list, traffic_usage} - 模板参数

输出 (Output):

  • {status: sent/failed, email: user.email} - 发送状态
  • mail_log: {user_id, template, send_time} - 发送记录
  • user.last_checkin_ip, verification_code - 验证码记录
  • {sent_count, failed_count, error_messages} - 统计信息
  • bounce_info: {email, reason, timestamp} - 退信数据

9. traffic-analytics (流量统计模块)

文件位置: app/Models/TrafficLog.php, app/Services/Analytics.php

功能:

  • 用户流量统计和记录
  • 节点流量监控
  • 在线人数统计
  • 流量限制和控制
  • 流量报表生成

输入 (Input):

  • user_traffic_log.user_id, user_traffic_log.node_id - 日志标识
  • user_traffic_log.traffic, user_traffic_log.log_time - 流量和时间
  • alive_ip.nodeid, alive_ip.userid, alive_ip.datetime - 活跃IP
  • date_range: {start_date, end_date} - 统计时间范围
  • group_by: [user_id, node_id, date] - 统计维度

输出 (Output):

  • SUM(user_traffic_log.traffic) GROUP BY user_id - 用户流量统计
  • SUM(user_traffic_log.traffic) GROUP BY node_id - 节点流量统计
  • COUNT(DISTINCT alive_ip.userid) GROUP BY nodeid - 在线用户数
  • traffic_trend: {date, upload, download, total} - 使用趋势
  • alerts: {user_id, node_id, traffic_spike} - 异常告警

10. system-configuration (系统配置模块)

文件位置: app/Services/Config.php, config/

功能:

  • 系统参数配置管理
  • 环境变量管理
  • 数据库连接配置
  • 第三方服务配置
  • 动态配置更新

输入 (Input):

  • config.item, config.value, config.class - 配置项数据
  • user.is_admin + UPDATE permission - 权限验证
  • config.item LIKE 'smtp_%', 'pay_%', 'theme_%' - 配置分类
  • validation_rules: {type, required, format} - 验证规则
  • env_vars: {DB_HOST, REDIS_PORT, MAIL_DRIVER} - 环境配置

输出 (Output):

  • config.item, config.value, config.class - 配置信息
  • {updated: true, item: config.item, old_value, new_value} - 更新结果
  • system_status: {db_connected, redis_connected, mail_enabled} - 系统状态
  • validation_result: {valid: true/false, errors: [...]} - 验证结果

11. frontend (前端界面模块)

文件位置: public/, public/theme/, public/vuedist/

功能:

  • 用户界面渲染
  • 管理员界面
  • Vue.js前端应用
  • 主题系统
  • 响应式设计

输入 (Input):

  • user.email, user.pass + remember_me - 登录表单
  • user.profile_form: {username, node_speedlimit} - 用户设置
  • admin.forms: {node., user., config.*} - 管理表单
  • pagination: {page, limit, sort} - 列表参数
  • theme.preferences: {color, layout, language} - 界面偏好

输出 (Output):

  • HTML_template + {user_data, navigation, menus} - 用户界面
  • Vue_components: {dashboard, user_list, node_management} - 组件渲染
  • responsive_layout: {mobile, tablet, desktop} - 适配界面
  • CSS_theme + {custom_colors, logos} - 主题样式
  • {success_alert, error_message, loading_spinner} - 交互反馈

📊 数据结构

YAML 数据模型

# 用户模块
user:
    entity: User
    table: user
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "用户唯一标识"
        email:
        type: varchar(255)
        unique: true
        description: "用户邮箱"
        username:
        type: varchar(255)
        nullable: true
        description: "用户名"
        pass:
        type: varchar(255)
        description: "密码哈希值"
        passwd:
        type: varchar(255)
        nullable: true
        description: "明文密码(调试用)"
        port:
        type: int(11)
        description: "分配端口"
        transfer_enable:
        type: bigint(20)
        default: 0
        description: "总流量(字节)"
        u:
        type: bigint(20)
        default: 0
        description: "已上传流量(字节)"
        d:
        type: bigint(20)
        default: 0
        description: "已下载流量(字节)"
        last_checkin_time:
        type: int(11)
        default: 0
        description: "最后签到时间戳"
        last_checkin_ip:
        type: varchar(255)
        nullable: true
        description: "最后签到IP"
        reg_date:
        type: datetime
        description: "注册时间"
        money:
        type: decimal(10,2)
        default: 0.00
        description: "账户余额"
        ref_by:
        type: int(11)
        default: 0
        description: "邀请人ID"
        ref_by_count:
        type: int(11)
        default: 0
        description: "邀请人数"
        expire_in:
        type: datetime
        nullable: true
        description: "账户到期时间"
        node_group:
        type: int(11)
        default: 0
        description: "节点分组权限"
        class:
        type: int(11)
        default: 0
        description: "用户等级"
        node_speedlimit:
        type: bigint(20)
        default: 0
        description: "速度限制(bps)"
        is_admin:
        type: int(11)
        default: 0
        description: "是否管理员(0否 1是)"
        reg_ip:
        type: varchar(255)
        description: "注册IP地址"
        plan_id:
        type: varchar(32)
        nullable: true
        description: "订阅套餐ID"
        telegram_id:
        type: varchar(32)
        nullable: true
        description: "Telegram用户ID"
        uuid:
        type: varchar(64)
        nullable: true
        description: "用户唯一标识符"
    relationships:
        has_many: [invite_codes, traffic_logs, bought_records, payback_records]
        belongs_to: [referrer]

# 节点模块
node:
    entity: Node
    table: node
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "节点唯一标识"
        name:
        type: varchar(255)
        description: "节点名称"
        server:
        type: varchar(255)
        description: "服务器地址"
        method:
        type: varchar(32)
        description: "加密方式"
        info:
        type: varchar(32)
        description: "节点信息"
        status:
        type: varchar(10)
        default: "available"
        description: "节点状态"
        sort:
        type: int(11)
        description: "节点类型排序"
        custom_method:
        type: varchar(255)
        nullable: true
        description: "自定义加密方式"
        traffic_rate:
        type: varchar(32)
        default: "1.0"
        description: "流量倍率"
        node_speedlimit:
        type: varchar(32)
        default: "0"
        description: "节点速度限制"
        node_heartbeat:
        type: int(11)
        default: 0
        description: "最后心跳时间戳"
        node_ip:
        type: varchar(255)
        description: "节点IP地址"
        node_group:
        type: int(11)
        default: 0
        description: "节点分组"
        node_class:
        type: int(11)
        default: 0
        description: "节点等级要求"
        type:
        type: varchar(32)
        description: "节点类型(SS/SSR/V2Ray/Trojan)"
        last_ping_time:
        type: int(11)
        default: 0
        description: "最后ping时间戳"
        region:
        type: varchar(255)
        nullable: true
        description: "节点地区"
    relationships:
        has_many: [traffic_logs, online_logs]
        has_and_belongs_to_many: [users]

# 流量日志模块
traffic_log:
    entity: TrafficLog
    table: user_traffic_log
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "日志ID"
        user_id:
        type: int(11)
        foreign_key: user.id
        description: "用户ID"
        node_id:
        type: int(11)
        foreign_key: node.id
        description: "节点ID"
        traffic:
        type: bigint(20)
        default: 0
        description: "流量大小(字节)"
        log_time:
        type: int(11)
        description: "记录时间戳"
    relationships:
        belongs_to: [user, node]

# 在线IP记录模块
alive_ip:
    entity: AliveIP
    table: alive_ip
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "记录ID"
        nodeid:
        type: int(11)
        foreign_key: node.id
        description: "节点ID"
        userid:
        type: int(11)
        foreign_key: user.id
        description: "用户ID"
        ip:
        type: text
        description: "IP地址"
        datetime:
        type: bigint(20)
        description: "记录时间戳"
    relationships:
        belongs_to: [user, node]

# 支付相关模块
payment_code:
    entity: PaymentCode
    table: code
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "充值码ID"
        code:
        type: text
        description: "充值码内容"
        type:
        type: int(11)
        description: "充值码类型"
        number:
        type: int(11)
        description: "充值金额"
        isused:
        type: int(11)
        default: 0
        description: "是否已使用(0未使用 1已使用)"
        userid:
        type: bigint(20)
        nullable: true
        foreign_key: user.id
        description: "使用者ID"
        usedatetime:
        type: datetime
        nullable: true
        description: "使用时间"
    relationships:
        belongs_to: [user]

# 优惠券模块
coupon:
    entity: Coupon
    table: coupon
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "优惠券ID"
        code:
        type: varchar(255)
        unique: true
        description: "优惠券码"
        onetime:
        type: int(11)
        default: 0
        description: "是否一次性使用(0否 1是)"
        credit:
        type: bigint(20)
        description: "优惠券面值"
        shop:
        type: text
        nullable: true
        description: "适用商品JSON"
        use_limit:
        type: int(11)
        description: "使用次数限制"
        used_count:
        type: int(11)
        default: 0
        description: "已使用次数"
        expire:
        type: datetime
        description: "到期时间"

# 购买记录模块
bought:
    entity: Bought
    table: bought
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "购买ID"
        userid:
        type: int(11)
        foreign_key: user.id
        description: "用户ID"
        shop:
        type: text
        description: "购买内容JSON"
        datetime:
        type: datetime
        description: "购买时间"
        renew:
        type: int(11)
        default: 0
        description: "是否续费(0否 1是)"
        price:
        type: bigint(20)
        description: "购买价格(分)"
        coupon:
        type: varchar(255)
        nullable: true
        description: "使用的优惠券码"
    relationships:
        belongs_to: [user]

# 返利记录模块
payback:
    entity: Payback
    table: payback
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "返利ID"
        userid:
        type: int(11)
        foreign_key: user.id
        description: "获得返利用户ID"
        ref_userid:
        type: int(11)
        foreign_key: user.id
        description: "返利用户ID"
        ref_get:
        type: bigint(20)
        description: "返利金额(分)"
        datetime:
        type: datetime
        description: "返利时间"
    relationships:
        belongs_to: [user]

# 系统配置模块
config:
    entity: Config
    table: config
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "配置ID"
        item:
        type: varchar(255)
        unique: true
        description: "配置项名称"
        value:
        type: text
        description: "配置值"
        class:
        type: int(11)
        description: "配置类型分组"

# 公告模块
announcement:
    entity: Announcement
    table: announcement
    fields:
        id:
        type: int(11)
        primary: true
        auto_increment: true
        description: "公告ID"
        date:
        type: datetime
        description: "发布日期"
        content:
        type: text
        description: "公告内容HTML"

# 订阅链接模块
link:
    entity: Link
    table: link
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "链接ID"
        type:
        type: int(11)
        description: "链接类型"
        address:
        type: text
        description: "服务器地址"
        port:
        type: int(11)
        description: "端口"
        token:
        type: text
        description: "访问令牌"
        ios:
        type: int(11)
        default: 0
        description: "是否支持iOS(0否 1是)"
        userid:
        type: bigint(20)
        foreign_key: user.id
        description: "用户ID"
        isp:
        type: text
        nullable: true
        description: "ISP信息"
        geo:
        type: int(11)
        description: "地理位置标识"
        method:
        type: text
        description: "加密方式"
    relationships:
        belongs_to: [user]

# 邀请码模块
invite_code:
    entity: InviteCode
    table: invite_code
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "邀请码ID"
        code:
        type: varchar(32)
        unique: true
        description: "邀请码内容"
        user_id:
        type: int(11)
        foreign_key: user.id
        description: "生成者ID"
        used_userid:
        type: int(11)
        nullable: true
        foreign_key: user.id
        description: "使用者ID"
        created_at:
        type: int(11)
        description: "创建时间戳"
        used_at:
        type: int(11)
        nullable: true
        description: "使用时间戳"
        status:
        type: int(11)
        default: 1
        description: "状态(1可用 0不可用)"
    relationships:
        belongs_to: [user]

# 节点在线日志模块
node_online_log:
    entity: NodeOnlineLog
    table: node_online_log
    fields:
        id:
        type: bigint(20)
        primary: true
        auto_increment: true
        description: "日志ID"
        node_id:
        type: int(11)
        foreign_key: node.id
        description: "节点ID"
        online_user:
        type: int(11)
        default: 0
        description: "在线用户数"
        log_time:
        type: int(11)
        description: "记录时间戳"
    relationships:
        belongs_to: [node]

# 数据关系图
relationships:
# 主要一对多关系
    one_to_many:
        - user: [invite_codes, traffic_logs, bought_records, payback_records, links]
        - node: [traffic_logs, online_logs]

    # 多对多关系(通过中间表)
    many_to_many:
        - user_node: "用户可访问的节点关系"

    # 主要外键关系
    foreign_keys:
        - user_traffic_log.user_id -> user.id
        - user_traffic_log.node_id -> node.id
        - alive_ip.nodeid -> node.id
        - alive_ip.userid -> user.id
        - invite_code.user_id -> user.id
        - invite_code.used_userid -> user.id
        - bought.userid -> user.id
        - payback.userid -> user.id
        - payback.ref_userid -> user.id
        - link.userid -> user.id
        - node_online_log.node_id -> node.id

用户相关表

user 表 - 用户信息

id INT(11) - 用户ID
email VARCHAR(255) - 邮箱
pass VARCHAR(255) - 密码哈希
passwd VARCHAR(255) - 明文密码
username VARCHAR(255) - 用户名
port INT(11) - 端口
transfer_enable BIGINT(20) - 总流量
u BIGINT(20) - 上传流量
d BIGINT(20) - 下载流量
last_checkin_time INT(11) - 最后签到时间
last_checkin_ip VARCHAR(255) - 最后签到IP
reg_date DATETIME - 注册日期
money DECIMAL(10,2) - 账户余额
ref_by INT(11) - 邀请人ID
ref_by_count INT(11) - 邀请人数
expire_in DATETIME - 账户到期时间
node_group INT(11) - 节点分组
class INT(11) - 用户等级
node_speedlimit BIGINT(20) - 速度限制
is_admin INT(11) - 是否管理员
reg_ip VARCHAR(255) - 注册IP
plan_id VARCHAR(32) - 套餐ID
telegram_id VARCHAR(32) - Telegram ID
uuid VARCHAR(64) - UUID

invite_code 表 - 邀请码

id BIGINT(20) - 邀请码ID
code VARCHAR(32) - 邀请码
user_id INT(11) - 生成者ID
used_userid INT(11) - 使用者ID
created_at INT(11) - 创建时间
used_at INT(11) - 使用时间
status INT(11) - 状态

节点相关表

node 表 - 节点信息

id INT(11) - 节点ID
name VARCHAR(255) - 节点名称
server VARCHAR(255) - 服务器地址
method VARCHAR(32) - 加密方式
info VARCHAR(32) - 节点信息
status VARCHAR(10) - 节点状态
sort INT(11) - 节点类型
custom_method VARCHAR(255) - 自定义加密
traffic_rate VARCHAR(32) - 流量倍率
node_speedlimit VARCHAR(32) - 速度限制
node_heartbeat INT(11) - 心跳时间
node_ip VARCHAR(255) - 节点IP
node_group INT(11) - 节点分组
node_class INT(11) - 节点等级
type VARCHAR(32) - 节点类型
last_ping_time INT(11) - 最后ping时间
region VARCHAR(255) - 节点地区

node_online_log 表 - 节点在线日志

id BIGINT(20) - 日志ID
node_id INT(11) - 节点ID
online_user INT(11) - 在线用户数
log_time INT(11) - 记录时间

流量相关表

user_traffic_log 表 - 用户流量日志

id BIGINT(20) - 日志ID
user_id INT(11) - 用户ID
node_id INT(11) - 节点ID
traffic BIGINT(20) - 流量大小
log_time INT(11) - 记录时间

alive_ip 表 - 活跃IP

id BIGINT(20) - ID
nodeid INT(11) - 节点ID
userid INT(11) - 用户ID
ip TEXT - IP地址
datetime BIGINT(20) - 记录时间

支付相关表

code 表 - 充值码

id BIGINT(20) - 充值码ID
code TEXT - 充值码
type INT(11) - 类型
number INT(11) - 金额
isused INT(11) - 是否使用
userid BIGINT(20) - 使用者ID
usedatetime DATETIME - 使用时间

coupon 表 - 优惠券

id INT(11) - 优惠券ID
code VARCHAR(255) - 优惠码
onetime INT(11) - 一次性
credit BIGINT(20) - 面值
shop TEXT - 适用商品
use_limit INT(11) - 使用次数
used_count INT(11) - 已使用次数
expire DATETIME - 到期时间

订单相关表

bought 表 - 购买记录

id INT(11) - 购买ID
userid INT(11) - 用户ID
shop TEXT - 购买内容
datetime DATETIME - 购买时间
renew INT(11) - 是否续费
price BIGINT(20) - 价格
coupon VARCHAR(255) - 使用优惠券

payback 表 - 返利记录

id INT(11) - 返利ID
userid INT(11) - 用户ID
ref_userid INT(11) - 返利用户ID
ref_get BIGINT(20) - 返利金额
datetime DATETIME - 返利时间

系统相关表

config 表 - 系统配置

id INT(11) - 配置ID
item VARCHAR(255) - 配置项
value TEXT - 配置值
class INT(11) - 配置类型

announcement 表 - 公告

id INT(11) - 公告ID
date DATETIME - 发布日期
content TEXT - 公告内容

链接相关表

link 表 - 订阅链接

id BIGINT(20) - 链接ID
type INT(11) - 类型
address TEXT - 地址
port INT(11) - 端口
token TEXT - Token
ios INT(11) - iOS支持
userid BIGINT(20) - 用户ID
isp TEXT - ISP信息
geo INT(11) - 地理位置
method TEXT - 加密方式

🚀 安装部署

环境要求

  • PHP 7.0+
  • MySQL/MariaDB 5.6+
  • Redis 3.0+
  • Nginx/Apache
  • Composer

快速安装

# 克隆项目
git clone https://github.com/supersongssr/SPanel.git

# 安装依赖
composer install

# 配置环境
cp config/.config.php.example config/.config.php

# 导入数据库
mysql -u root -p < sql/all.sql

# 配置Web服务器指向public目录

配置文件

主要配置文件位于 config/.config.php,包含数据库连接、Redis配置、邮件设置等。

📖 API文档

认证接口

POST /api/token/new - 获取访问令牌
GET  /api/token/{token} - 验证令牌

节点接口

GET  /api/node - 获取节点列表
POST /api/node - 创建节点
PUT  /api/node/{id} - 更新节点

用户接口

GET  /api/user/info - 获取用户信息
POST /api/user/login - 用户登录
POST /api/user/register - 用户注册

📄 许可证

本项目采用 GPL 许可证,详见 LICENSE 文件。

🤝 贡献

欢迎提交 Issue 和 Pull Request 来改进项目。

📞 支持

如有问题,请通过以下方式联系:

  • 提交 Issue
  • 发送邮件
  • Telegram群组

注意:本项目仅供学习研究使用,请遵守当地法律法规。

About

基于ss-panel-v3-mod的 UI 修改版

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 31.3%
  • PHP 22.7%
  • Smarty 16.4%
  • HTML 12.6%
  • CSS 12.2%
  • Vue 3.1%
  • Other 1.7%