Simplify frontend/client dev setup, shrink nodeapp

This commit is contained in:
Reckless_Satoshi 2023-05-12 04:04:41 -07:00
parent 70740750f5
commit 6c20ce4f70
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
10 changed files with 65 additions and 48 deletions

View File

@ -56,6 +56,8 @@ services:
ROBOSATS_ONION: robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
network_mode: service:tor
volumes:
- ./nodeapp/:/usr/src/robosats/
- ./nodeapp/nginx.conf:/etc/nginx/nginx.conf
- ./frontend/static:/usr/src/robosats/static
clean-orders:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -130,7 +130,7 @@ input[type='number'] {
transform: scaleX(-1);
border: 1.3px solid #90caf9;
-webkit-filter: grayscale(100%);
filter: grayscale(100%) brightness(50%) contrast(150%) drop-shadow(0.7px 0.7px 0.7px #000000);
filter: grayscale(100%) brightness(50%) contrast(180%) drop-shadow(0.7px 0.7px 0.7px #000000);
}
.navBarAvatarDark:after {

View File

@ -1,2 +1,10 @@
README.md
assets
assets
static/assets/vector
static/assets/images/Ba*
static/assets/images/bot*
static/assets/images/robo*
static/assets/images/Robo*
static/assets/images/v*
docker-compose.yml
docker-compose-example.yml

View File

@ -8,6 +8,11 @@ At the moment it has no special integration with your local lightning wallet (e.
The container launches two processes: 1) A set of `socat` that will expose RoboSats coordinators API over HTTP on localhost:81 using the docker orchestration TOR socks proxy and 2) Nginx, used to direct every request where needed and serve the client app locally.
# Docker compose example
You can run the client locally with the provided example orchestration. It has both, a TOR proxy container and the robosats client.
`docker-compose -f docker-compose-example.yml up`
Then just visit http://localhost:12596
# Why host your own RoboSats client
Advantages over a full over-the-internet RoboSats experience:

View File

@ -1,36 +0,0 @@
version: '3.9'
services:
frontend:
build: ../frontend
container_name: npm-dev
restart: always
command: npm run dev
volumes:
- ../frontend:/usr/src/frontend
- ../mobile:/usr/src/mobile
nodeapp:
build: .
container_name: nodeapp-dev
restart: always
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
network_mode: service:tor
volumes:
- ./:/usr/src/robosats/
- ./nginx.conf:/etc/nginx/nginx.conf
- ../frontend/static:/usr/src/robosats/static
tor:
build: ../docker/tor
container_name: tor-dev
restart: always
environment:
LOCAL_USER_ID: 1000
LOCAL_GROUP_ID: 1000
volumes:
- ../node/tor/data:/var/lib/tor
- ../node/tor/config:/etc/tor
ports:
- 12596:12596

View File

@ -0,0 +1,21 @@
version: '3.9'
# Example deployment of a local robosats-client using
# 'latest' tag from docker-hub
services:
robosats:
image: recksato/robosats-client:latest
container_name: robosats
restart: always
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
network_mode: service:tor
tor:
build: ../docker/tor
container_name: tor
restart: always
environment:
LOCAL_USER_ID: 1000
LOCAL_GROUP_ID: 1000
ports:
- 12596:12596

View File

@ -1,21 +1,37 @@
version: '3.9'
# Example deployment of a local robosats-client using
# 'latest' tag from docker-hub
# Frontend and node client development orchestration
services:
robosats:
image: recksato/robosats-client:latest
container_name: robosats
frontend:
build: ../frontend
container_name: npm-dev
restart: always
command: npm run dev
volumes:
- ../frontend:/usr/src/frontend
- ../mobile:/usr/src/mobile
nodeapp:
build: .
container_name: nodeapp-dev
restart: always
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
network_mode: service:tor
volumes:
- ./:/usr/src/robosats/
- ./nginx.conf:/etc/nginx/nginx.conf
- ../frontend/static:/usr/src/robosats/static
tor:
build: ../docker/tor
container_name: tor
container_name: tor-dev
restart: always
environment:
LOCAL_USER_ID: 1000
LOCAL_GROUP_ID: 1000
volumes:
- ../node/tor/data:/var/lib/tor
- ../node/tor/config:/etc/tor
ports:
- 12596:12596

View File

@ -22,6 +22,7 @@ http {
location / {
root /usr/src/robosats;
try_files $uri $uri/ /basic.html;
index basic.html;
}
location /pro/ {

View File

@ -4,16 +4,16 @@
# Frontend Development Only
Running the full stack is not easy, since RoboSats needs of many services. However, contributing to the frontend development can be done with a minimal setup!
## With Docker
You can develop frontend-only features using the mainnet backend of the platform by simply running the sorverign node app locally and the `npm-dev` container. The orchestration in `/nodeapp/docker-compose.yml` will run a Tor proxy and torify all requests, as well as, watch for changes to the frontend source files, build it, and place it in the right `/static/`
You can develop frontend-only features using the mainnet backend of the platform by simply running the sovereign node app locally and the `npm-dev` container. The orchestration in `/nodeapp/docker-compose.yml` will run a Tor proxy and torify all requests, as well as, watch for changes to the frontend source files, build it, and place it in the right `/static/`
```bash
cd nodeapp
docker-compose -f docker-compose-dev.yml up
docker-compose up
# Press Ctrl+C to exit the process
# Check out 127.0.0.1:12596 on your browser
# Check out http://localhost:12596 on your browser
```
You can edit the frontend code in `/frontend/src/` to make the changes you want. Within a few seconds, the `npm-dev` container process will pack the code into the local `main.js`. Visit `127.0.0.1:12596` and you will see your changes on the frontend.
You can edit the frontend code in `/frontend/src/` to make the changes you want. Within a few seconds, the `npm-dev` container process will pack the code into the local `main.js`. Visit `http://localhost:12596` and you will see your changes on the frontend.
## Without Docker