{"id":29631164,"url":"https://github.com/llllllxy/tiny-mock","last_synced_at":"2026-03-06T12:04:08.879Z","repository":{"id":226562475,"uuid":"769038407","full_name":"llllllxy/tiny-mock","owner":"llllllxy","description":"tiny-mock 是一个基于SpringBoot开发的一个简单易用的在线数据Mock平台系统，支持mockJs语法，可用于前端开发时的数据Mock。","archived":false,"fork":false,"pushed_at":"2025-08-01T03:34:26.000Z","size":6250,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T05:42:02.487Z","etag":null,"topics":["mock","mockjs","springboot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llllllxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-08T08:07:21.000Z","updated_at":"2025-08-01T03:34:30.000Z","dependencies_parsed_at":"2024-03-08T09:26:18.940Z","dependency_job_id":"874ce85f-252b-4083-acc4-804d52097711","html_url":"https://github.com/llllllxy/tiny-mock","commit_stats":null,"previous_names":["llllllxy/tiny-mock"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/llllllxy/tiny-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllllxy%2Ftiny-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllllxy%2Ftiny-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllllxy%2Ftiny-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllllxy%2Ftiny-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llllllxy","download_url":"https://codeload.github.com/llllllxy/tiny-mock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllllxy%2Ftiny-mock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30175914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mock","mockjs","springboot"],"created_at":"2025-07-21T11:08:22.849Z","updated_at":"2026-03-06T12:04:03.865Z","avatar_url":"https://github.com/llllllxy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Mock\n# 一个基于SpringBoot开发的轻量级在线数据Mock平台\n\n![SpringBoot](https://img.shields.io/badge/springboot-3.3.10-green.svg?style=flat-square)\n![Java](https://img.shields.io/badge/java-21-green.svg?style=flat-square)\n\n\u003ca href=\"https://github.com/llllllxy/tiny-mock/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/llllllxy/tiny-mock?style=flat-square\u0026logo=GitHub\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/llllllxy/tiny-mock/network/members\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/llllllxy/tiny-mock?style=flat-square\u0026logo=GitHub\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/llllllxy/tiny-mock/watchers\"\u003e\u003cimg src=\"https://img.shields.io/github/watchers/llllllxy/tiny-mock?style=flat-square\u0026logo=GitHub\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/llllllxy/tiny-mock/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/llllllxy/tiny-mock.svg?style=flat-square\u0026logo=GitHub\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/llllllxy/tiny-mock/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/llllllxy/tiny-mock.svg?style=flat-square\"\u003e\u003c/a\u003e\n\n## 功能特色\n- 快速生成演示数据，将请求根地址指向到模拟地址即可轻松实现接口模拟\n- 支持项目管理，根据项目给接口分组，不同项目拥有不同的接口根地址\n- 支持MockJs模拟，根据MockJs的强大能力进行数据生成，文档可见 [mockjs示例](http://mockjs.com/examples.html)\n- 支持自定义Http响应码\n- 支持模拟接口返回延时\n- 支持项目接口数据的导出和导入，方便数据恢复备份\n- 支持成员协作功能，同一项目可以邀请多人进行协助\n- 支持仪表盘功能，快速预览项目和接口运行调用情况\n- 支持数据统计功能，查看每一个接口的调用分析数据\n- 支持邀请码注册功能，方便团队内成员注册\n- 全局基于国密算法的登录验证和数据保护体系，保证账户安全\n\n## 主要技术选型\n\n| 依赖                 | 说明            |\n|--------------------|---------------|\n| SpringBoot 3.3.10  | 基础框架          |\n| Hikari             | 高性能数据库连接池     |\n| MyBatis-Plus 3.5.8 | MyBatis的增强ORM |\n| Redis              | 业务缓存、会话共享     |\n| MySQL 5.7          | 关系型数据库        |\n| Layui 2.9.15       | 前端框架和模板       |\n| Mock.js 1.0.0      | 数据mock引擎      |\n\n## 运行环境\n- Jdk21\n- MySQL5.6+\n- Redis3.0+\n\n## 运行启动教程\n1. 新建`MySQL`数据库并导入`resources\\init`文件夹下的数据库脚本\n2. 修改配置文件中`application.yml`中数据库连接信息和Redis连接信息\n3. 运行启动类`TinyMockApplication`，即可正常启动项目\n4. 管理后台登录地址：`http://localhost:9019`  账户密码 `zhangsan / Aa123456@`\n\n## 项目结构\n\n```\ntiny-mock\n│\n├─resources 资源模块\n│  │\n│  ├─init  系统初始化脚本\n│  │  \n│  ├─mapper mybatis的xml文件 \n│  │  \n│  └─static 静态资源\n│      │   \n│      ├─css 样式表资源\n│      │   \n│      ├─images 图片资源\n│      │   \n│      ├─js js公共文件封装\n│      │   \n│      ├─lib js公共库\n│      │   \n│      ├─page 页面资源\n│      │   \n│      └─index.html 系统入口页面\n│\n├─java 后台模块\n│  │\n│  ├─common  公共模块\n│  │   │   \n│  │   ├─annotation 公共注解\n│  │   │   \n│  │   ├─config 系统配置\n│  │   │   \n│  │   ├─constants 系统常量\n│  │   │   \n│  │   ├─enums 系统枚举 \n│  │   │   \n│  │   ├─exception 系统自定义异常\n│  │   │   \n│  │   ├─model 公共数据模型\n│  │   │   \n│  │   └─utils 工具类\n│  │\n│  └─modules  业务模块\n│      │   \n│      ├─bean bean对象 \n│      │    │      \n│      │    ├─dto 参数对象\n│      │    │      \n│      │    ├─vo 视图对象\n│      │    │      \n│      │    ├─enums 业务枚举\n│      │    │\n│      │    └─entity 实体类   \n│      │   \n│      ├─helper 业务工具类\n│      │ \n│      ├─web 控制层\n│      │            \n│      ├─service 服务层\n│      │   \n│      └─mapper 持久层\n└─\n\n```\n\n\n## 平台功功能界面展示\n\n登录\n![登录](src/main/resources/static/images/readme/登录.png)\n\n注册\n![注册](src/main/resources/static/images/readme/注册.png)\n\n首页\n![首页](src/main/resources/static/images/readme/首页.png)\n\n我的项目\n![我的项目](src/main/resources/static/images/readme/我的项目.png)\n\n我的项目-新建\n![我的项目-新建](src/main/resources/static/images/readme/我的项目-新建.png)\n\n接口管理\n![接口管理](src/main/resources/static/images/readme/接口管理.png)\n\n接口管理-新增\n![接口管理-新增](src/main/resources/static/images/readme/接口管理-新增.png)\n\n接口管理-版本\n![接口管理-版本](src/main/resources/static/images/readme/接口管理-版本.png)\n\n接口管理-访问日志\n![接口管理-访问日志](src/main/resources/static/images/readme/接口管理-访问日志.png)\n\n接口管理-成员协助\n![接口管理-成员协助](src/main/resources/static/images/readme/接口管理-成员协助.png)\n\n数据统计\n![数据统计](src/main/resources/static/images/readme/数据统计.png)\n\n操作日志\n![操作日志](src/main/resources/static/images/readme/操作日志.png)\n\n问题与建议\n![问题与建议](src/main/resources/static/images/readme/问题与建议.png)\n\n接口测试工具\n![接口测试工具](src/main/resources/static/images/readme/接口测试工具.png)\n\n使用文档\n![使用文档](src/main/resources/static/images/readme/使用文档.png)\n\n\n## 其他\nMock.js 文档地址 http://mockjs.com/examples.html\n\n## 项目计划\n- Mock核心功能  `已完成`\n- 项目管理  `已完成`\n- 接口管理  `已完成`\n- 接口修改历史  `已完成`\n- 接口访问日志  `已完成`\n- 租户邀请码注册 `已完成`\n- 租户密码找回 `未完成`\n- 租户首页大屏 `已完成`\n- 租户数据统计页面 `已完成`\n- 项目成员协作功能 `已完成`\n- 项目导出，项目导入（项目级别的，以便数据备份和恢复） `已完成`\n- 自定义头像修改 `已完成`\n- 接口分模块管理 `未完成`\n- 租户操作日志记录功能 `已完成`\n- 租户操作日志查询功能 `已完成`\n\n\n\n## 项目部署\n#### 1、安装`jdk21`，比如安装到`/opt/jdk-21.0.4`目录下\n\n#### 2、安装`MySQL`数据库\n\n#### 3、安装`Redis`数据库\n\n#### 4、修改配置文件`application.yml`，自定义端口号、MySQL数据库连接信息、Redis连接信息、文件存放位置、各种密钥信息\n\n#### 5、上传`tiny-mock-1.1.2.jar`和自定义配置文件`application.yml`到服务器指定目录下，比如上传到opt目录下，则执行命令`nohup  /opt/jdk-21.0.4/bin/java -jar /opt/tiny-mock-1.1.2.jar \u003e/dev/null 2\u003e\u00261 \u0026`即可\n![部署-部署位置.png](src/main/resources/static/images/readme/部署-部署位置.png)\n\n#### 6、如需开启注册功能，还需要配置数据库中的`t_mail_config`表，添加一条数据，填写自己的邮箱服务器配置\n![部署-邮箱配置示例.png](src/main/resources/static/images/readme/部署-邮箱配置示例.png)\n\n\n\n## 前后端分离部署示例（以linux环境举例，nginx版本1.24.0）\n\n#### 1、安装 `nginx`\n\n#### 2、将 `/resources/static/js/layuimini/miniAjax.js` 里的 `baseURL` 属性改为 `/back`\n![img_1.png](src/main/resources/static/images/readme/前后端分离部署_1.png)\n\n#### 3、安装 `nginx` 并更改配置 `default.conf` （位置一般在 /etc/nginx/conf.d 文件夹下）\n```editorconfig\n    listen       80;\n    server_name  localhost;\n    client_max_body_size 50M;\n\n    # 前端文件的实际路径部署，实际路径在D:\\nginxplace\\mock \n    location / {\n      root   /usr/share/nginx/html;\n      index  index.html index.htm;\n    }\n\n     # 后端服务反向代理，其中 /back 和 miniAjax.js 里的 baseURL 属性对应\n    location /back/ {\n      proxy_pass  http://127.0.0.1:9019/;\n      proxy_redirect off;\n      # bForwarded-ForIP\n      proxy_set_header  Host  $host:$server_port;\n      proxy_set_header  X-Real-IP  $remote_addr;\n      proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;\n      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;\n    } \n                                                                                  \n      # mock地址反向代理，其中 /mock 和 核心mock地址对应\n    location /mock/ {\n      proxy_pass  http://127.0.0.1:9019/mock/;\n      proxy_redirect off;\n      # bForwarded-ForIP\n      proxy_set_header  Host  $host:$server_port;\n      proxy_set_header  X-Real-IP  $remote_addr;\n      proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;\n      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;\n    }\n\n```\n\n#### 4、将 `/resources/static` 目录下的内容 全部复制到 `/usr/share/nginx/html` 目录下，此目录和 nginx 的 location.root 路径配置保持一致\n![img.png](src/main/resources/static/images/readme/前后端分离部署_2.png)\n\n#### 5、刷新nginx配置 `nginx -s reload`，然后即可访问 `http://ip地址`\n\n#### 6、配置https(扩展)\n1. 申请免费证书，得到一个key文件和pem文件（教程见\u003ca href=\"https://developer.aliyun.com/article/1595201\"\u003e阿里云免费SSL证书申请流程（一键申请20张）\n   \u003c/a\u003e）\n\n2. 更改nginx配置（default.conf）\n```editorconfig\nserver {\n    listen       443  ssl;\n    server_name  lxyccc.top;\n    ssl_certificate lxyccc.top.pem;\n    ssl_certificate_key  lxyccc.top.key;\n\n    # 优化SSL配置\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;\n    ssl_prefer_server_ciphers on;\n    ssl_session_cache shared:SSL:10m;\n    ssl_session_timeout 10m;\n    ssl_stapling on;\n    ssl_stapling_verify on;\n\n    #access_log  /var/log/nginx/host.access.log  main;\n\n    location / {\n        root   /usr/share/nginx/html;\n        index  index.html index.htm;\n    }\n\n    #error_page  404              /404.html;\n\n    # redirect server error pages to the static page /50x.html\n    #\n    error_page   500 502 503 504  /50x.html;\n    location = /50x.html {\n        root   /usr/share/nginx/html;\n    }\n\n\t\n\t # 后端反向代理，其中 /back 和 miniAjax.js 里的 baseURL 属性对应\n    location /back/ {\n      proxy_pass  http://127.0.0.1:9019/;\n      proxy_redirect off;\n      # bForwarded-ForIP\n      proxy_set_header  Host  $host:$server_port;\n      proxy_set_header  X-Real-IP  $remote_addr;\n      proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;\n      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;\n    }\n\n\t # 后端反向代理，其中 /back 和 miniAjax.js 里的 baseURL 属性对应\n    location /mock/ {\n      proxy_pass  http://127.0.0.1:9019/mock/;\n      proxy_redirect off;\n      # bForwarded-ForIP\n      proxy_set_header  Host  $host:$server_port;\n      proxy_set_header  X-Real-IP  $remote_addr;\n      proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;\n      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;\n    }\n\n\n\n    # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n    #\n    #location ~ \\.php$ {\n    #    proxy_pass   http://127.0.0.1;\n    #}\n\n    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n    #\n    #location ~ \\.php$ {\n    #    root           html;\n    #    fastcgi_pass   127.0.0.1:9000;\n    #    fastcgi_index  index.php;\n    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;\n    #    include        fastcgi_params;\n    #}\n\n    # deny access to .htaccess files, if Apache's document root\n    # concurs with nginx's one\n    #\n    #location ~ /\\.ht {\n    #    deny  all;\n    #}\n}\n```\n\n3. 新增nginx配置（httpToHttps.conf）\n```editorconfig\n# HTTP强制跳转HTTPS\nserver {\n    listen 80;\n    server_name yourdomain.com;\n    return 301 https://$host$request_uri;\n}\n```\n\n4. 也可使用Let's encrypt 申请免费证书\n地址 https://letsencrypt.org/zh-cn/ 或者 https://letsencrypt.top/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllllllxy%2Ftiny-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllllllxy%2Ftiny-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllllllxy%2Ftiny-mock/lists"}