Skip to content

fioprotocol/fio-dashboard

Repository files navigation

Generated by generator-ezetech

Client

Documentation: Create-React-App.

https://github.com/facebook/create-react-app

Run tests:
npm test

In case you can't run tests: brew install watchman

Server

Run server in dev mode

Create .env file from .env.example template:

Run docker-compose:

docker-compose up

Then run

npm run server:dev

Notice: Before start app in dev mode you need to run npm install

Run tests for server

npm test:api

Code styles

  • Imports in files should have the right order:

    • 3-d party libs
    • components
    • components form the same folder
    • constants
    • methods/utils/hooks
    • types
    • css It will be changed after code style implementation from released MVP Generator 2.0
  • 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.

Email templates

We change code for email templates here https://github.com/fioprotocol/fio-dashboard-tools Then we copy generated templates into dashboard app.

BitPay integration

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?

  1. Install nginx - https://www.nginx.com/ Useful links:
  • https://www.cyberciti.biz/faq/nginx-restart-ubuntu-linux-command/
  1. Install ngrok - https://ngrok.com/
  • You need to register there
  1. Configure nginx:
  • I have 5555 port, you could use any other port you want. Add this to you nginx.conf server part:
        # some default settings...
        
        listen       5555;
        server_name  localhost;

        location / {
            proxy_pass http://localhost:3000;
        }

        location /api/v1 {
            proxy_pass http://localhost:9006;
        }
    }
  1. Run nginx
  2. Run ngrok with command ngrok http 5555
  3. Ngrok will return a pubilc url address like https://564b-178-133-53-168.ngrok.io. Set it as API_BASE_URL and rerun server. Every time you run ngrok your public url address changes re-setup API_BASE_URL and rerun server. Enjoy!