# ElectronDemo **Repository Path**: mammothgo/electron-demo ## Basic Information - **Project Name**: ElectronDemo - **Description**: ElectronDemo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2024-08-28 - **Last Updated**: 2025-01-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ELectron Demo ## 架构 - 脚手架:[ElectronVite](https://cn.electron-vite.org/guide/introduction.html) - 前端:[Electron](https://www.electronjs.org/zh/docs/latest/) + [Vue](https://cn.vuejs.org/) + [Element-plus](https://element-plus.org/zh-CN/) - 数据库:[Typeorm](https://typeorm.io/data-source-options#better-sqlite3-data-source-options) - 存储:[BetterSqlite3](https://github.com/WiseLibs/better-sqlite3) - 构建:[electron-builder](https://www.electron.build/) ## 启动步骤 ### 安装依赖 ```bash $ npm install ``` ### 调试 ```bash $ npm run dev ``` ## 构建 ### 以管理员启动命令行工具,运行以下命令 ```bash # 图标生成 $ npm run electron:generate-icons # For windows $ npm run build:win # For macOS $ npm run build:mac # For Linux $ npm run build:linux ``` ## 数据配置 打包后为绿色版软件,需将数据存储至打包后的根目录下,目录结构为: ```bash 根目录 ├── data └── db/data.db //数据库文件 └── file //本地文件 ``` ## 代码架构 ```bash src ├── main // 主进程,系统进程 └── db // 数据库 └── handler // 系统接口 └── services // 服务 ├── preload // 预加载,暴露系统接口 ├── renderer // 前端进程+页面 ```