Add simplified nodeapp / frontend only dev environment setup

This commit is contained in:
Reckless_Satoshi 2022-09-13 06:34:33 -07:00
parent 3a0dd3cabd
commit 6d79cd8351
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,34 @@
version: '3.9'
services:
frontend:
build: ../frontend
container_name: npm-dev
restart: always
command: npm run dev
volumes:
- ../frontend:/usr/src/frontend
nodeapp:
build: .
container_name: nodeapp-dev
restart: always
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
ROBOSATS_ONION: robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
network_mode: service:tor
volumes:
- ../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

@ -2,8 +2,21 @@
*Attention: to use RoboSats you do not need to run the stack, simply visit the website and that's it! This setup guide is intended for developer contributors and platform operators.*
# 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/`
```bash
cd nodeapp
docker-compose up
# Press Ctrl+C to exit the process
# Visit 127.0.0.1:12596
```
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.
## Without Docker
*Set up time ~10 min. Tested in Firefox in Ubuntu.* (Does not work in Chromium)