The frontend for the =nil; block explorer and the Playground.
This project contains the front-end component for the =nil; block explorer. It is a React app that uses the Styletron-react library for styling. State management is done using the Effectorjs library. The app is built using Vite.
Clone the repository:
git clone https://github.com/NilFoundation/nil.git
cd ./nil/explorer_frontendInstall dependencies:
npm installFill the required config variables in the runtime-config.toml file stored in ./public. Presently, only API_URL is required to be set.
To override the default values, create the runtime-config.local.toml file in ./public and set API_URL to the desired value.
To start the development server:
npm run devThis will start the development server on port 5173.
A different port can be set by specifying the PORT environment variable.
Install the biome extension for VS Code for the smoothest possible development experience. It will enable code formatting on save and paste.
To build the app for production:
npm run buildThis will create a dist directory with the built app.
Explorer frontend used cypress for end-to-end testing. To run the tests initialize the http server and run:
export PORT=3000 # cypress expects the app on port 3000 by default
npm run dev # initializes the server in development mode which is suitable for real-time testingor
npm run build
npm run serve # initializes the server in production mode which is suitable for testing the production buildIn this mode, it is also necessary to disable API requests batching in the runtime-config.toml file by setting API_REQUESTS_ENABLE_BATCHING to false.
Then, in a separate terminal, run:
npm run test:e2eThis will open the cypress test runner where it should be possible to select the test file to run.
To run tests in headless mode:
npm run test:e2e:ci