1 Star 0 Fork 1.6K

2307856559 / NiceFish

forked from 大漠穷秋 / NiceFish 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

NiceFish

NiceFish(美人鱼) 是一个系列项目,目标是示范前后端分离的开发模式:前端浏览器、移动端、Electron 环境中的各种开发模式;后端有两个版本:SpringBoot 版本和 SpringCloud 版本。

用法

打开终端,依次执行以下命令:

git clone https://gitee.com/mumu-osc/NiceFish.git
cd NiceFish
npm i -g cnpm --registry=https://registry.npm.taobao.org
cnpm i -g @angular/cli
cnpm i
ng serve --open

打开浏览器,访问http://localhost:4200/

常见坑点

  • 各种你懂的原因,中文开发者强烈建议使用 cnpm (淘宝发布的一款npm包装器,方便中文开发者避免一些神秘的问题)
  • 如果你想让打包体积更小,请使用参数构建:ng serve --prod
  • 构建最终结果:ng build --prod
  • 如果之前装过@angular/cli 需要先卸载:npm uninstall -g @angular/cli
  • 如果之前装过老版本的 angular-cli 需要先卸载:npm uninstall -g angular-cli
  • 如果你之前已经尝试用npm install安装过 node 模块,请把 NiceFish 根目录下的 node_moduels 目录删掉重新 cnpm install
  • 命令行删除 node_modules 速度更快,Windows 平台使用: rmdir /s/q node_modules ,*nix平台使用:sudo rm -rf node_modules
  • 如果你需要把项目发布到其它类型的 Server 上,例如 Tomcat,需要对 Server 进行一些简单的配置才能支持 HTML5 下的 PushState 路由模式,请从以下链接里面查找对应的配置方式:https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions ,在 How to: Configure your server to work with html5Mode 这个小节里面把常见的 WEB 容器的配置方式都列举出来了,包括:IIS、Apache、nginx、NodeJS、Tomcat 全部都有。

主要依赖

  • Angular 7.2
  • PrimeNG 7.1
  • Bootstrap 3.3.7
  • Echarts 3.4.0
  • ckeditor5-angular 1.0

在线演示

系列项目

  • NiceFish:美人鱼,这是 Angular 版本的实现,前端基于 Angular 7.2 + PrimeNG 7.1.0。http://git.oschina.net/mumu-osc/NiceFish/
  • NiceFish-React:这是 React 版的实现,界面外观完全相同。采用React Hooks 16.8.3 版本,使用TypeScript、Ant Design组件库以及Bootstrap v4.2.1 开发。
  • nicefish-ionic:这是一个移动端的 demo,基于 ionic,此项目已支持 PWA。http://git.oschina.net/mumu-osc/nicefish-ionic
  • NiceBlogElectron:这是一个基于 Electron 的桌面端项目,把 NiceFish 用 Electron 打包成了一个桌面端运行的程序。这是由 ZTE 中兴通讯的前端道友提供的,我 fork 了一个,有几个 node 模块的版本号老要改,如果您正在研究如何利用 Electron 开发桌面端应用,请参考这个项目,https://github.com/damoqiongqiu/NiceBlogElectron。
  • nicefish-spring-cloud: https://gitee.com/mumu-osc/nicefish-spring-cloud , 这是NiceFish的服务端代码,基于SpringCloud。已经完成了一些基本的功能,如 SpringSecurity+OAuth2+JWT 实现SSO,文章、用户、评论等的分页查询等。如果你需要与这个后端代码进行对接,请检出本项目的 for-spring-cloud 分支。
  • OpenWMS:用来示范管理后台型系统的最佳实践,https://gitee.com/mumu-osc/OpenWMS-Frontend

界面截图

打包分析

以下是用 webpack-bundle-analyzer 分析打包之后的模块构成:

看起来CKEditor和ECharts占了很大的体积,需要做一下异步加载。

webpack-bundle-analyzer 使用方法:

  • cnpm i webpack-bundle-analyzer --save-dev
  • package.json 的 scripts 配置里面加一行 "bundle-report": "webpack-bundle-analyzer dist/stats.json"
  • ng build --prod --stats-json 编译(--stats-json 选项会生成一份stats.json配置文件)
  • 执行 npm run bundle-report 查看打包过程

学习资源

线上交流

开源许可证

MIT

(你可以随意使用此项目,不需要提前告知我,除非你需要其它服务。)

The MIT License (MIT) Copyright (c) 2016 大漠穷秋 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

NiceFish(美人鱼) 是一个系列项目,目标是示范前后端分离的开发模式:前端浏览器、移动端、Electron 环境中的各种开发模式;后端有两个版本:SpringBoot 版本和 SpringCloud 版本。 展开 收起
TypeScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/2307856559/NiceFish.git
git@gitee.com:2307856559/NiceFish.git
2307856559
NiceFish
NiceFish
master

搜索帮助

14c37bed 8189591 565d56ea 8189591