In order to start modifying the app, please make sure to correctly configure your workstation:
- Make sure you you have Node.js installed
- (Optional) Install NVM to manage your different Node.js versions
- (Optional) Use Visual Studio Code as a text editor to benefit from automatic type checking
- Configure your text editor with the Prettier, ESLint and EditorConfig plugins
- Use the correct Node.js version for this app by running
nvm use; if you didn't install NVM (step 2), then manually install the Node.js version described in.nvmrc - Install the dependencies:
yarn(ornpm install) - Run the server:
yarn dev(ornpm run dev)
You can access a hot-reloaded version of the app on http://localhost:3000.
The application is built using React and the framework Next.js. The styles use Sass and the Bootstrap framework.
A continuous deployment system is in place. Each time you push to the main branch, the application is deployed in GitHub Pages through a GitHub Action defined in .github/workflows/build.yml. You can see the status of the build in the “Actions” tab of the repository on GitHub.
The application is configured via environment variables stored in a .env file that must be placed at the root of the frontend folder. You can create one by copying .env.sample and setting a value for each key.
Below is a description of each of the keys.
| Variable | Description |
|---|---|
| NEXT_PUBLIC_API_URL | Complete URL from which the API is served (including https) and without a trailing slash (e.g. https://vizzuality.com) |
| NEXT_PUBLIC_MONGABAY_DATA_URL | Base path to where the mongabay-data.json file is server. The actual file should be available at <NEXT_PUBLIC_MONGABAY_DATA_URL>/mongabay-data.json |