# X-Target **Repository Path**: TimeLuck/x-target ## Basic Information - **Project Name**: X-Target - **Description**: 基于React+MidwayJS的网络安全靶场 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2023-01-10 - **Last Updated**: 2024-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # X-target > 一款基于前后端分离架构的Web安全靶场 ## 下载安装 #### 下载 官方仓库:[X-target](https://gitee.com/TimeLuck/x-target) NodeJS: [NodeJS](https://nodejs.org/en/) #### 安装 1. 安装前端依赖并启动 ```shell cd x-target-view npm install /* 只有第一次使用时需要 */ npm run dev ``` 2. 安装后端依赖并启动 ```shell cd x-target-flow npm install /* 只有第一次使用时需要 */ npm run dev ``` #### 配置 1. 数据库配置 ```js // x-target-pro-flow/src/config/config.default.ts typeorm: { dataSource: { default: { type: 'mysql', host: 'localhost', port: 3306, username: 'xxx', password: 'xxx', database: 'xxx', // ... }, }, } ``` 2. 代理配置 ```js // x-target-pro-flow/src/config/config.default.ts koa: { port: 7001, }, // x-target-pro/package.json (must match the above ports) "proxy": "http://127.0.0.1:7001" ``` ## 常见问题 #### Error: connect ECONNREFUSED ::1:3306 数据库配置错误,请确保配置正确以及数据库服务器正常! #### Error: ER_ACCESS_DENIED_ERROR: Access denied for user "xxx"@"xxx" (using password: YES) 配置的密码错误,请确保入的数据库用户名密码正确 #### Error: ER_BAD_DB_ERROR: Unknown database "xxxx" 配置连接的数据库不存在,重新配置正确的数据库或者创建新的数据库用于应用连接`CREATE DATABASE xxxx` ## 技术栈 #### 前端 (TypeScript) - React - 前端核心 - scss - css 预解析器 - antd - UI 库 - tailwindcss - 原子级 css 框架 - animatecss - css 动画库 - axios - ajax 库 - ahooks - Hook 库 - hox - 自定义钩子库 - moment - 时间处理 - lodash - 数组/对象工具库 - jotai & valtio - 集中式状态管理 - prismjs - 代码高亮插件 #### 后端 (NodeJS) - MidwayJS - 后端核心 - passport-jwt - 身份认证库 - typeorm - 数据库 ORM - moment - 时间处理 - nanoid - 随机ID库