专利猎人是一款基于React和TypeScript开发的全球专利侵权风险智能预警系统,提供专利检索、分析、比对和风险评估等功能。
- React 18+
- TypeScript
- Tailwind CSS
- Vite
- React Router DOM
- Recharts
- Framer Motion
- Node.js 18+
- pnpm 9+
pnpm installpnpm dev开发服务器将在 http://localhost:3000 启动
首先,将项目代码克隆到您的Linux服务器上:
git clone https://github.com/axp007/Patent-Hunter.git
cd [项目目录]如果服务器上尚未安装Node.js和pnpm,请按照以下步骤安装:
# 使用nvm安装Node.js(推荐)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18
# 或者直接安装系统包(Ubuntu/Debian)
# sudo apt update
# sudo apt install nodejs npm
# sudo npm install -g n
# sudo n 18npm install -g pnpm在项目目录中执行以下命令:
pnpm install
pnpm build构建成功后,项目文件将生成在 dist 目录中。
推荐使用Nginx作为Web服务器来托管React应用。
# Ubuntu/Debian
sudo apt update
sudo apt install nginx
# CentOS/RHEL
# sudo yum install nginx创建一个新的Nginx配置文件:
sudo nano /etc/nginx/sites-available/patent-hunter将以下内容粘贴到文件中,替换your_domain.com为您的域名或服务器IP地址,并确保root路径指向正确的项目构建目录:
server {
listen 80;
server_name your_domain.com;
root /path/to/your/project/dist/static;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
# 可选:添加安全头部
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
# 可选:添加gzip压缩
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_proxied any;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
}保存并退出文件,然后创建符号链接启用该配置:
sudo ln -s /etc/nginx/sites-available/patent-hunter /etc/nginx/sites-enabled/sudo nginx -t
sudo systemctl restart nginx如果服务器启用了防火墙,请确保允许HTTP流量:
# Ubuntu/Debian
sudo ufw allow 'Nginx HTTP'
sudo ufw reload
# CentOS/RHEL
# sudo firewall-cmd --permanent --add-service=http
# sudo firewall-cmd --reloadsudo systemctl enable nginx为了提高安全性,建议配置SSL证书:
# 使用Let's Encrypt获取免费SSL证书
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your_domain.com创建一个简单的shell脚本用于自动更新和重新部署项目:
#!/bin/bash
cd /path/to/your/project
git pull
pnpm install
pnpm build
sudo systemctl restart nginx保存为deploy.sh并设置执行权限:
chmod +x deploy.sh定期检查Nginx和应用日志以便排查问题:
# Nginx错误日志
sudo tail -f /var/log/nginx/error.log
# Nginx访问日志
sudo tail -f /var/log/nginx/access.log├── src/
│ ├── components/ # 可复用组件
│ ├── contexts/ # React上下文
│ ├── hooks/ # 自定义Hooks
│ ├── lib/ # 工具函数
│ ├── pages/ # 页面组件
│ ├── App.tsx # 应用主组件
│ ├── index.css # 全局样式
│ └── main.tsx # 应用入口
├── index.html # HTML入口
├── package.json # 项目配置和依赖
├── tailwind.config.js # Tailwind配置
└── vite.config.ts # Vite配置
- 专利检索:支持多条件高级检索
- 专利比对:分析多个专利之间的相似度和差异
- 数据分析:提供专利风险趋势和分布分析
- 风险评估:智能评估专利侵权风险
- 报告生成:生成详细的分析报告
- 项目默认已配置响应式布局,支持PC端和移动端
- 所有数据目前为模拟数据,可根据实际需求对接后端API
- 如果遇到性能问题,可考虑启用CDN和缓存策略