OSDN Git Service

fixed the create asset string decimals for some occassion.
[bytom/bytom-dashboard.git] / README.md
1 # Bytom Dashboard
2
3 ## Development
4
5 #### Setup
6
7 Install Node.js:
8
9 ```
10 brew install node
11 ```
12
13 Install dependencies:
14
15 ```
16 npm install
17 ```
18
19 Start the development server with
20
21 ```
22 npm start
23 ```
24
25 By default, the development server uses the following environment variables
26 with default values to connect to a local Bytom Core instance:
27
28 ```
29 API_URL=http://localhost:3000/api
30 PROXY_API_HOST=http://localhost:9888
31 ```
32
33 #### Style Guide
34
35 We use `eslint` to maintain a consistent code style. To check the source
36 directory with `eslint`, run:
37
38 ```
39 npm run lint src
40 ```
41
42 ### React + Redux
43
44 #### ES6
45
46 Babel is used to transpile the latest ES6 syntax into a format understood by
47 both Node.js and browsers. To get an ES6-compatible REPL (or run a one-off script)
48 you can use the `babel-node` command:
49
50 `$(npm bin)/babel-node`
51
52 #### Redux Actions
53
54 To inspect and debug Redux actions, we recommend the "Redux DevTools" Chrome
55 extension:
56
57 https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd
58
59
60 #### Creating new components
61
62 To generate a new component with a connected stylesheet, use the following
63 command:
64
65 ```
66 npm run generate-component Common/MyComponent
67 ```
68
69 The above command will create two new files in the `src/components` directory:
70
71 ```
72 src/components/Common/MyComponent/MyComponent.jsx
73 src/components/Common/MyComponent/MyComponent.scss
74 ```
75
76 with `MyComponent.scss` imported as a stylesheet into `MyComponent.jsx`.
77
78 Additionally, if there is an `index.js` file in `src/components/Common`, it
79 will appropriately add the newly created component to the index exports.