robosats/setup.md

88 lines
2.2 KiB
Markdown
Raw Normal View History

# Set up
## Django development environment
### Install Python and pip
`sudo apt install python3 python3 pip`
### Install virtual environments
2022-01-06 16:54:37 +00:00
```
pip install virtualenvwrapper
```
### Add to .bashrc
```
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS=' -p /usr/bin/python3 '
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
```
### Reload startup file
`source ~/.bashrc`
### Create virtual environment
`mkvirtualenv robosats_env`
### Activate environment
`workon robosats_env`
### Install Django and Restframework
`pip3 install django djangorestframework`
2022-01-05 11:20:08 +00:00
## Install Django admin relational links
`pip install django-admin-relation-links`
*Django 4.0 at the time of writting*
### Launch the local development node
```
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserver
```
2022-01-10 18:47:16 +00:00
### Install other python dependencies
```
pip install robohash
2022-01-10 18:47:16 +00:00
pip install python-decouple
pip install ring
```
### Install LND python dependencies
```
cd api/lightning
pip install grpcio grpcio-tools googleapis-common-protos
git clone https://github.com/googleapis/googleapis.git
curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/lightning.proto
python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. lightning.proto
```
## React development environment
### Install npm
`sudo apt install npm`
npm packages we use
```
cd frontend
npm init -y
npm i webpack webpack-cli --save-dev
npm i @babel/core babel-loader @babel/preset-env @babel/preset-react --save-dev
npm i react react-dom --save-dev
npm install @material-ui/core
npm install @babel/plugin-proposal-class-properties
npm install react-router-dom@5.2.0
npm install @material-ui/icons
npm install material-ui-image
npm install @mui/system @emotion/react @emotion/styled
2022-01-09 14:07:05 +00:00
npm install react-native
npm install react-native-svg
npm install react-qr-code
2022-01-09 22:17:15 +00:00
npm install @mui/material
```
2022-01-09 22:17:15 +00:00
Note we are using mostly MaterialUI V5, but Image loading from V4 extentions (so both V4 and V5 are needed)
### Launch the React render
from frontend/ directory
`npm run dev`