diff --git a/nodeapp/docker-compose.yml b/nodeapp/docker-compose.yml new file mode 100644 index 00000000..c0fbed68 --- /dev/null +++ b/nodeapp/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/setup.md b/setup.md index 1c71b657..c69692f0 100644 --- a/setup.md +++ b/setup.md @@ -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)