The WeatherXM Explorer project implements a top view of the WeatherXM network.
We use GitHub Flow as our branching model.
All contributors could use any IDE platform or code editor they want as long as they use the appropriate linter (eslint) and code formatter (prettier) as their config files exist inside the project's root folder.
To build the app from source, you need to create a .env
file in the root directory, according to the .env.template
and make sure to fill in all the required variables. Then, install all the required dependencies by running one of the following commands:
npm install
yarn install
After the above steps, you could start the development server on http://localhost:3001
by running one of the following commands:
npm run dev
yarn dev
If you want to customize the port
and address
of dev server, just change the dev server settings in the nuxt.confing.ts
file.
Important
Be aware that the use of FontAwesome Pro icons requires a valid Font Awesome Pro license. Font Awesome Pro is a premium icon set that provides additional features and icons beyond the free version. However, if you do not own a Font Awesome Pro license, feel free to replace the icons with those from an alternative font package or your custom icons.
We have 3 different GitHub Actions:
- Deploy on Dev: An action that runs by hand every time a dev version needs to be tested internally, building the app using dev ENV vars and docker-compose script, in order to dockerize the app and make sure all the dependencies are met.
- Flow for PRs on develop and main for
wxm-explorer
: An action that runs on every push onfeature branch
, building the app using the dev ENV vars and theDockerfile
script, in order to dockerize the app on the dev cluster and make sure all the dependencies are met. - Flow for creating a release of
wxm-explorer
: An action that runs on every tag pushed, building the app production ENV vars, and theDockerfile
script in order to dockerize the app on the prod cluster and make sure all the dependencies are met.
We have 3 different app flavors (consider flavors as different “build variants”). For each flavor a
different .env
file can be created for different environment variables, such as API_URL
.
The 3 different app flavors are:
-
Remote Mock: This flavor communicates with our remote mock API. Currently only for internal use.
-
Remote Dev: This flavor communicates with our dev API. Currently only for internal use.
-
Remote Prod: This flavor communicates with our production API, found on
app.weatherxm.com
. TheAPI_URL
on that environment file should be https://api.weatherxm.com
When merging a feature/
PR on Git, we do squash merge
with an explanatory and human-friendly
commit message.
Our only (for now) internal channel to distribute our app to the team in order to test it is by
deploying it on the dev machine. Different Remote
flavors are
supported.
In order to upload a version up for testing, one way can be used:
- Using a GitHub Action to automatically build, upload and distribute the app through the dev machine.
In order to create a new production release some mandatory steps should be followed that we will explain below:
- Create and push a new commit in
main
bumping theversion
inpackage.json
file. git checkout main
and create a commit tag with the title being the version name (X.X.X
).- Push the tag, this will trigger the Flow for creating a release of wxm-explorer action to run.