初始提交:浏览器首页 MyHomePage 全栈项目

# 项目概述
个人浏览器首页导航应用,支持书签分类管理、搜索引擎快捷搜索、
必应每日壁纸轮播、前后端分离部署,适配 1Panel 服务器(Docker 模式)。

# 技术栈
- 前端:Vue 3 + TypeScript + Vite + Pinia + Capacitor(Android 打包)
- 后端:.NET 8 + SqlSugar(多数据库) + SQLite/MySQL + Swashbuckle
- 部署:1Panel 应用商店自定义应用(Docker Compose 模式)

# 项目结构
- backend/    .NET 8 API 后端(8 个 Controller + 15 个 Service)
- frontend/   Vue 3 前端(19 个组件 + 9 个 API 模块 + 5 个 Store)
- docker/     Docker 部署文件(后端镜像 + Nginx 反代)
- docs/       部署手册(1Panel 实战版)
- scripts/    E2E 测试脚本

# 已实现功能
- 书签管理:增删改查 + 树形分类 + 拖拽排序 + 主色自适应
- 搜索引擎:8 个内置引擎 + 自定义引擎 + favicon 自动抓取
- 必应壁纸:每日轮播 + 多分辨率自动选择 + 1.6MP 质量优先
- 全局设置:主题/行为/数据/工具 4 分类 + 跨设备同步
- 文件上传:图标/书签/通用(容器持久化 + 跨域 URL 拼接)
- 同步:基于变更日志的设备间数据同步
- 跨域部署:前后端分离 + runtime config.json 无需重新编译

# 进度记录
- 已完成 P0~P52 共 53 个开发节点(详细见 说明文档.md)
- 当前版本:v1.0 部署就绪

# 部署文档
- README.md:项目说明 + 快速开始
- 说明文档.md:完整开发进度(中文)
- docs/DEPLOY.md:1Panel 部署手册(Docker 模式)
This commit is contained in:
2026-07-05 05:09:56 +08:00
commit 68be41e7a2
129 changed files with 15900 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>实体基类:所有业务表都包含主键 + 时间戳</summary>
public abstract class BaseEntity
{
/// <summary>主键(自增,使用 int 以兼容 SQLite + MySQL</summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>创建时间(UTC</summary>
[SugarColumn(IsNullable = false)]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>更新时间(UTC</summary>
[SugarColumn(IsNullable = false)]
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
+48
View File
@@ -0,0 +1,48 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>链接收藏</summary>
[SugarTable("bookmarks")]
public class Bookmark : BaseEntity
{
/// <summary>所属分类 ID</summary>
[SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_category" })]
public int CategoryId { get; set; }
/// <summary>链接标题</summary>
[SugarColumn(Length = 128, IsNullable = false)]
public string Title { get; set; } = string.Empty;
/// <summary>链接 URL</summary>
[SugarColumn(Length = 512, IsNullable = false)]
public string Url { get; set; } = string.Empty;
/// <summary>简介</summary>
[SugarColumn(Length = 512, IsNullable = true)]
public string? Description { get; set; }
/// <summary>图标标识:lucide 名 / emoji / 自定义 key</summary>
[SugarColumn(Length = 64, IsNullable = true)]
public string? Icon { get; set; }
/// <summary>图标类型:lucide | emoji | image</summary>
[SugarColumn(Length = 16, IsNullable = true, DefaultValue = "lucide")]
public string IconType { get; set; } = "lucide";
/// <summary>图标 URLIconType = image 时使用)</summary>
[SugarColumn(Length = 512, IsNullable = true)]
public string? IconUrl { get; set; }
/// <summary>logo 背景色(#hex / rgb / hsl);null = 自适应(由前端从 url / iconUrl 推断)</summary>
[SugarColumn(Length = 32, IsNullable = true)]
public string? ColorBg { get; set; }
/// <summary>排序值</summary>
[SugarColumn(DefaultValue = "0")]
public int Sort { get; set; }
/// <summary>软删标记</summary>
[SugarColumn(DefaultValue = "0")]
public bool IsDeleted { get; set; }
}
+24
View File
@@ -0,0 +1,24 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>分类(二级树形,ParentId 为 0 表示一级)</summary>
[SugarTable("categories")]
public class Category : BaseEntity
{
/// <summary>父分类 ID;一级分类为 0</summary>
[SugarColumn(DefaultValue = "0")]
public int ParentId { get; set; }
/// <summary>分类名称</summary>
[SugarColumn(Length = 64, IsNullable = false)]
public string Name { get; set; } = string.Empty;
/// <summary>lucide 图标名</summary>
[SugarColumn(Length = 64, IsNullable = true)]
public string? Icon { get; set; }
/// <summary>排序值,越小越靠前</summary>
[SugarColumn(DefaultValue = "0")]
public int Sort { get; set; }
}
+40
View File
@@ -0,0 +1,40 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>搜索引擎</summary>
[SugarTable("search_engines")]
public class SearchEngine : BaseEntity
{
/// <summary>展示名</summary>
[SugarColumn(Length = 64, IsNullable = false)]
public string Name { get; set; } = string.Empty;
/// <summary>URL 模板,必须包含 {q} 占位符</summary>
[SugarColumn(Length = 512, IsNullable = false)]
public string UrlTemplate { get; set; } = string.Empty;
/// <summary>图标类型:lucide / image / emoji(与 Bookmark.IconType 对齐)</summary>
[SugarColumn(Length = 16, IsNullable = false, DefaultValue = "lucide")]
public string IconType { get; set; } = "lucide";
/// <summary>图标内容:lucide 名 / emoji 字符(IconType=lucide/emoji 时使用)</summary>
[SugarColumn(Length = 64, IsNullable = true)]
public string? Icon { get; set; }
/// <summary>图标图片 URLIconType=image 时使用)</summary>
[SugarColumn(Length = 512, IsNullable = true)]
public string? IconUrl { get; set; }
/// <summary>logo 背景色(#hex / rgb / hsl);null = 自适应(与 Bookmark.ColorBg 对齐)</summary>
[SugarColumn(Length = 32, IsNullable = true)]
public string? ColorBg { get; set; }
/// <summary>排序值</summary>
[SugarColumn(DefaultValue = "0")]
public int Sort { get; set; }
/// <summary>是否默认引擎(应用层保证唯一)</summary>
[SugarColumn(DefaultValue = "0")]
public bool IsDefault { get; set; }
}
+44
View File
@@ -0,0 +1,44 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>用户设置(单行记录,Id 固定为 1</summary>
[SugarTable("settings")]
public class Setting : BaseEntity
{
/// <summary>主题模式:dark | light | auto</summary>
[SugarColumn(Length = 16, IsNullable = false, DefaultValue = "dark")]
public string ThemeMode { get; set; } = "dark";
/// <summary>主色调(HEX 字符串)</summary>
[SugarColumn(Length = 16, IsNullable = false, DefaultValue = "#6c5ce7")]
public string AccentColor { get; set; } = "#6c5ce7";
/// <summary>背景图:预设 keywp1..wp6)或自定义 URL</summary>
[SugarColumn(Length = 512, IsNullable = true, DefaultValue = "wp1")]
public string? BackgroundImage { get; set; }
/// <summary>背景类型:preset | custom | solid</summary>
[SugarColumn(Length = 16, IsNullable = false, DefaultValue = "preset")]
public string BackgroundType { get; set; } = "preset";
/// <summary>链接打开方式:1 = 新选项卡(默认);0 = 当前选项卡。底层用 int 存储以兼容 SqlSugar + SQLite。</summary>
[SugarColumn(IsNullable = false, DefaultValue = "1")]
public int OpenLinksInNewTab { get; set; } = 1;
/// <summary>搜索框行为:1 = 搜索结果在新选项卡打开(默认);0 = 当前选项卡打开(P46)。</summary>
[SugarColumn(IsNullable = false, DefaultValue = "1")]
public int OpenSearchInNewTab { get; set; } = 1;
/// <summary>是否启用 360 在线壁纸模式(P34):0 = 关闭(默认,使用预设/自定义背景),1 = 开启(按分类随机 + 定时切换)</summary>
[SugarColumn(IsNullable = false, DefaultValue = "0")]
public int WallpaperEnabled { get; set; } = 0;
/// <summary>360 壁纸分类 IDP34),例如 "36"。空字符串表示「全部/推荐」。</summary>
[SugarColumn(Length = 32, IsNullable = true, DefaultValue = "")]
public string? WallpaperCategoryId { get; set; } = "";
/// <summary>壁纸自动切换间隔(分钟,P34)。默认 30。0 表示不自动切换,仅手动触发立即切换按钮。</summary>
[SugarColumn(IsNullable = false, DefaultValue = "30")]
public int WallpaperInterval { get; set; } = 30;
}
+27
View File
@@ -0,0 +1,27 @@
using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// <summary>同步日志:每次增删改都写一条,前端通过 since=timestamp 拉取增量</summary>
[SugarTable("sync_log")]
public class SyncLog
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>实体类型:category | bookmark | search_engine | setting</summary>
[SugarColumn(Length = 32, IsNullable = false, IndexGroupNameList = new[] { "idx_synclog_type" })]
public string EntityType { get; set; } = string.Empty;
/// <summary>实体 ID</summary>
[SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_synclog_type" })]
public int EntityId { get; set; }
/// <summary>操作:create | update | delete</summary>
[SugarColumn(Length = 16, IsNullable = false)]
public string Operation { get; set; } = "update";
/// <summary>变更时间(UTC</summary>
[SugarColumn(IsNullable = false)]
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}