这里是 MyRoom 经纪人子系统的前端仓库,项目使用Create React App脚手架创建。
- 主框架/技术:React、TypeScript、WebRTC
- 辅助:React-Hooks、React Router、Redux、Axios、Styled-Components
- 组件库:Ant Design
├───public 静态资源目录
├───src 源码目录
├───global.css 全局CSS样式
├───index.tsx
│
├───@types 全局type
├───components 通用组件
├───hooks 自定义Hooks
├───lib
│ ├───lowcode-editor 低代码编辑器
│ ....
├───pages 独立页面
│ ├───App
│ ├───Login
│ ├───ProjectEditor
│ ├───ProjectList
│ └───UserHome
├───redux redux逻辑
├───route 路由
├───service 网络接口
└───util 实用工具
- 命名规范:
-
组件和路由页统一使用大驼峰命名,例如:components/NotFound.tsx 和 pages/Login/...
-
如果组件或路由页需要嵌套,则最外层使用大驼峰,例如:
├───pages 独立页面 │ ├───Login │ ├───components │ │ └───..... │ └───index.tsx
-
缩略词全大写,当位于开头且不需要导出时,使用全小写
- 接口调用:二次封装 axios
- 通用的 ts 类型文件统一写在@types 下
服务器执行请求失败的 Error 统一使用自定义的 ExecuteError
<type>(<scope>): <subject>
- type 为必填项,用于指定 commit 的类型。
build
:更改构建系统和外部依赖项(如将 gulp 改为 webpack ,更新某个 npm 包)ci
:对 CI 配置文件和脚本的更改docs
:仅仅修改文档说明feat
:增加一个新特性fix
:修复一个 bugperf
:更改代码以提高性能refactor
:代码重构时使用style
:不影响代码含义的改动,例如去掉空格、改变缩进、增删分号test
:增加新的测试功能或更改原有的测试模块chore
:杂项revert
:回滚代码时使用
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
- React 官方文档:https://react.docschina.org/
- React(hooks):https://react.docschina.org/docs/hooks-intro.html | https://beta.reactjs.org/
- react-router:https://reactrouter.com/docs/en/v6/getting-started/tutorial
- typescript:TypeScript 入门
- create-react-app:https://create-react-app.dev/docs/getting-started
- Style-components:https://styled-components.com/docs/basics#getting-started
- axois:https://axios-http.com/zh/docs/example
- Ant Design:https://ant.design/
- 心圆佬的 low-code 项目:https://github.com/ChelesteWang/CodeDragger
- 一个 vue 的 lowcode 项目:https://github.com/wangyuan389/mall-cook
- 一个 react 的 lowcode 项目:https://github.com/imcuttle/mometa