-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
53 lines (46 loc) · 1.25 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Asset Management / Inventory application for network gear
- MySQL (compatible) database
- Python3/Flask backend
- React frontend
Mostly followed the guide at [1] to setup webpack.
To setup DB:
Create database and user:
```
create database inventory;
create user inventory@localhost identified by 'yourpassword';
grant all on inventory.* to inventory@localhost;
flush privileges;
```
`mkdir instance`
edit instance/config.py
```
DB_DB = 'inventory'
DB_HOST = 'localhost'
DB_USER = 'inventory'
DB_PASS = 'yourpassword'
```
`mysql inventory -u inventory -p < schema.sql`
To setup build environment:
```
npm i webpack webpack-cli babel-core babel-loader babel-preset-env babel-preset-react -Dd
npm i react react-dom react-router-dom -S
pip3 install flask jinja2 mysql-connector
```
To build:
`npm run build`
To run flask dev server:
`./run_debug.bash`
[1] (https://medium.freecodecamp.org/part-1-react-app-from-scratch-using-webpack-4-562b1d231e75)
To compile/install npm in home directory on RHEL6:
```
wget http://nodejs.org/dist/node-latest.tar.gz
tar xzf node-latest.tar.gz
cd node-v*
yum install devtoolset-6-gcc-c++
scl enable devtoolset-6 bash
./configure --prefix=~/opt
make
make install
wget https://www.npmjs.org/install.sh -o npm_install.sh
bash npm_install.sh
```