EasyNav
EasyNav是一个现代化的企业内部导航门户系统,支持用户认证、快速检索链接和响应式设计,帮助企业集中管理各类系统和资源链接。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
EasyNav是一个现代化的企业内部导航门户系统,支持用户认证、快速检索链接和响应式设计,帮助企业集中管理各类系统和资源链接。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
.├── backend/ # 后端项目│ ├── src/│ │ ├── db/ # 数据库相关│ │ ├── middleware/ # 中间件│ │ ├── routes/ # 路由│ │ └── utils/ # 工具函数│ └── docs/ # 文档├── frontend/ # 前端项目│ ├── src/│ │ ├── components/ # React 组件│ │ ├── hooks/ # 自定义 Hooks│ │ ├── services/ # API 服务│ │ └── types/ # TypeScript 类型└── k8s/ # Kubernetes 配置## 快速开始### 环境要求- Node.js >= 18- npm >= 9- MySQL (可选,默认使用 SQLite)### 安装依赖bash# 后端cd backendnpm install# 前端cd frontendnpm install### 环境配置1. 后端配置 (backend/.env)envPORT=3000JWT_SECRET=your-secret-keySMTP_HOST=smtp.gmail.comSMTP_PORT=587SMTP_SECURE=falseSMTP_USER=your-email@gmail.comSMTP_PASS=your-app-specific-passwordSMTP_FROM=Company Portal <[email protected]>FRONTEND_URL=http://localhost:5173# 数据库配置DB_TYPE=sqlite # 或 mysqlDB_NAME=database.sqlite# MySQL 配置(如果使用 MySQL)DB_HOST=localhostDB_PORT=3306DB_USER=rootDB_PASSWORD=root2. 前端配置 (frontend/.env)envVITE_API_URL=http://localhost:3000/api### 启动开发服务器bash# 后端cd backendnpm run dev# 前端cd frontendnpm run dev## 部署### Docker 部署1. 构建镜像bash# 后端docker build -t nav-portal-backend ./backend# 前端docker build -t nav-portal-frontend ./frontend2. 使用 Docker Compose 启动yamlversion: '3'services: frontend: image: nav-portal-frontend ports: - "80:80" depends_on: - backend environment: - VITE_API_URL=http://localhost:3000/api backend: image: nav-portal-backend ports: - "3000:3000" environment: - JWT_SECRET=your-secret-key - DB_TYPE=mysql - DB_HOST=db - DB_USER=root - DB_PASSWORD=root depends_on: - db db: image: mysql:8 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=nav_portal volumes: - mysql-data:/var/lib/mysqlvolumes: mysql-data:### Kubernetes 部署项目包含完整的 Kubernetes 配置文件,位于 k8s/ 目录:- frontend.yaml- backend.yaml- mysql-deployment.yaml 已经删除(需要自己安装数据库信息)- ingress.yaml(或者traefik.yaml)使用 kubectl 部署:bashkubectl apply -f k8s/## 数据库设计### users 表sqlCREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, email TEXT UNIQUE NOT NULL, password TEXT, is_active BOOLEAN DEFAULT FALSE, verification_token TEXT, wework_userid TEXT UNIQUE, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, modified_at DATETIME DEFAULT CURRENT_TIMESTAMP);### groups 表sqlCREATE TABLE groups ( id TEXT PRIMARY KEY, name TEXT NOT NULL, icon TEXT NOT NULL, sort_order INTEGER DEFAULT 100, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, modified_at DATETIME DEFAULT CURRENT_TIMESTAMP);### subgroups 表sqlCREATE TABLE subgroups ( id TEXT PRIMARY KEY, name TEXT NOT NULL, group_id TEXT NOT NULL, sort_order INTEGER DEFAULT 100, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, modified_at DATETIME DEFAULT CURRENT_TIMESTAMP);### links 表sqlCREATE TABLE links ( id TEXT PRIMARY KEY, title TEXT NOT NULL, subtitle TEXT NOT NULL, url TEXT NOT NULL, icon TEXT NOT NULL, group_id TEXT NOT NULL, subgroup_id TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, modified_at DATETIME DEFAULT CURRENT_TIMESTAMP);## API 文档### 认证相关#### 注册POST /api/auth/registerContent-Type: application/json{ "username": "string", "email": "string", "password": "string"}#### 登录POST /api/auth/loginContent-Type: application/json{ "username": "string", "password": "string"}#### 验证邮箱GET /api/auth/verify-email?token=string### 分组管理#### 获取所有分组GET /api/groupsAuthorization: Bearer <token>#### 创建分组POST /api/groupsAuthorization: Bearer <token>Content-Type: application/json{ "id": "string", "name": "string", "icon": "string", "sort_order": number}#### 更新分组PUT /api/groups/:idAuthorization: Bearer <token>Content-Type: application/json{ "name": "string", "icon": "string", "sort_order": number}#### 删除分组DELETE /api/groups/:idAuthorization: Bearer <token>### 链接管理#### 获取所有链接GET /api/linksAuthorization: Bearer <token>#### 获取分组链接GET /api/links/group/:groupIdAuthorization: Bearer <token>#### 创建链接POST /api/linksAuthorization: Bearer <token>Content-Type: application/json{ "id": "string", "title": "string", "subtitle": "string", "url": "string", "icon": "string", "group_id": "string", "subgroup_id": "string"}#### 更新链接PUT /api/links/:idAuthorization: Bearer <token>Content-Type: application/json{ "title": "string", "subtitle": "string", "url": "string", "icon": "string", "group_id": "string", "subgroup_id": "string"}#### 删除链接DELETE /api/links/:idAuthorization: Bearer <token>## 安全性- 密码加密:使用 bcrypt 进行密码哈希- JWT 认证:使用 JWT 进行用户认证- CORS 保护:配置适当的 CORS 策略- 环境变量:敏感信息通过环境变量配置- SQL 注入防护:使用参数化查询- XSS 防护:React 默认转义 + CSP- 邮箱验证:新用户需要验证邮箱## 性能优化### 前端- 路由懒加载- 组件按需加载- 图片懒加载- 缓存静态资源- Gzip 压缩- Tree Shaking- 代码分割### 后端- 数据库索引- 连接池- 缓存策略- 请求限流- 响应压缩## 贡献指南1. Fork 项目2. 创建特性分支3. 提交改动4. 推送到分支5. 创建 Pull Request## 许可证木兰宽松许可证A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.
Convert videos into awesome blog posts.
Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.
AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.
Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.
AI Foto Edit - Text to Image & Image Edit