This is a monorepo for multiple clients:
- Dashboard user site — https://app.fio.net/
- Dashboard admin panel
- Wrap status page — the page where the user could check the status of wrap and unwrap actions — https://wrap.fio.net/
- FIO Id — the page where any user could get some public data for any FIO Handle — https://fio.id/
- FIO Wallet snap for testing and developing the Metamask snap — https://snaps.metamask.io/snap/npm/fioprotocol/fio-wallet-snap/
- Node v16.14.2
- PostgreSQL database
If you want to update the edge-core-js — update the forked edge-currency-accountbased. You need to remove all unused providers to make the library as tiny as possible.
There are a couple of setups that should be done before the 1st app run:
a) Setup the account profiles for registering orders.
- For Free Handles should be accounts with
regaddresspermission — 1st primary and 2nd fallback. - For Paid items should be accounts with
activepermission — 1st primary and 2nd fallback. - For metamask domain should be
regaddresspermission and this account should be the owner of themetamaskprivate domain.
b) Setup the api urls. For more details use https://bpmonitor.fio.net/ site or switch on Dynamic Fetch on /api-urls.
c) Pre-setup default domains on admin Defaults — they will be shown on the FIO handles selection page.
If you use the current AWS flow — any push to the production main branch will trigger the build pipeline. How the flow should go develop => staging => main.
Warning! After deploy check the
notificationtable and verify manually that it looks fine and there are no duplications or wrong emails. If all is good — go to admin Defaults and toggle Outbound Emails to OFF to run them back.
If you are deploying by yourself, follow this instruction:
- Run
npm install --legacy-peer-deps. - Run
npm run client:build. It will generate static files. Host them somewhere. - Run
npm run admin:as:buildfor the admin panel. It will generate static files. Host them somewhere. - Run the server
npm run server:prod. - Set up a couple of cron-jobs:
npm run scheduler— runs tasks that are set as a param in the command. If you need to change the tasks or add a new one, edit that command.npm run scheduler:wallet-data— gets the data of the wallets that are registered via the dashboard.npm run scheduler:orders— processes the orders.npm run scheduler:wrap-status— gets the data for the wrap status page.
There are a couple of pages that could be deployed as well:
- If you need the Wrap status page client, run
npm run landing-page-wrap-status:as:build. - If you need the FIO Id page, run
npm run landing-page-fio-id:as:build.
Documentation: Create-React-App.
https://github.com/facebook/create-react-app
npm test
In case you can't run tests: brew install watchman
Create .env file from .env.example template:
Run docker-compose:
docker-compose upThen run
npm run server:devNotice:
Before start app in dev mode you need to run npm install
npm test:api-
Imports in files should have the right order:
- 3-d party libs
- components
- components form the same folder
- constants
- methods/utils/hooks
- types
- css
-
Default exports for pages and named exports is for other exports
-
If you see that something is not styled as it should be - change it.
We change code for email templates here https://github.com/fioprotocol/fio-dashboard-tools
Then we copy generated templates into dashboard app.
If you want to use BitPay locally you need to have public access to your running application for webhook and payment BitPay site redirectUrl. How to easy handle this on your machine?
- Install nginx -
https://www.nginx.com/Useful links:
https://www.cyberciti.biz/faq/nginx-restart-ubuntu-linux-command/
- Install ngrok -
https://ngrok.com/
- You need to register there
- Configure nginx:
- I have 5555 port, you could use any other port you want. Add this to you
nginx.confserver part:
# some default settings...
listen 5555;
server_name localhost;
location / {
proxy_pass http://localhost:3000;
}
location /api/v1 {
proxy_pass http://localhost:9006;
}
}
- Run nginx
- Run ngrok with command
ngrok http 5555 - Ngrok will return a pubilc url address like
https://564b-178-133-53-168.ngrok.io. Set it asAPI_BASE_URLand rerun server. Every time you run ngrok your public url address changes re-setupAPI_BASE_URLand rerun server. Enjoy!