Setting up the platform-client for development
Last updated
Last updated
The web client is the component that end-users interact with when opening the Platform website with a web browser. The client interacts with the API in order to perform operations on the system (i.e. submit posts, query posts).
The web-client is built on the Angular 14 framework.
Prerequisites:
is set up and ready
Install Node V16.x or higher (you might want to use NVM for this) before continuing. You can download Node.js from the official website:
Ensure you have the latest version of Git Installed In Your System. You can download Git from the official website:
Get started:
Clone the (if you plan to make contributions to Ushahidi, consider forking the repository before starting, more about that ).
Locate the env.json
file located in the apps/web-mzima-client/src
directory.
Locate the file env.json
. This file contains a crucial variable called backend_url
. This variable is used to configure the client with the URL to use, in order to send HTTP network requests to the Platform API. If this variable is wrong, nothing works. If you have installed the Platform API using our guide, change the URL to "http://localhost:8080". All the other variables are often not required to specify, as they have sensible defaults.
In the terminal, make sure you are in the same folder as you cloned your code into and run npm install
After installation is complete, run npm run web:serve
. This command starts a development server and at this point, the client should be available to the view on the address (In case another application uses port 4200, angular redirect you to a different port). You can now interact with it for testing and development purposes. Any changes you make to the code will be automatically reflected in the browser.
The default user credentials when running your local development environment is: user email: admin@example.com password: admin