2025-11-11 13:57:05 +00:00
|
|
|
|
# Mav Mobile UI
|
2025-11-11 13:49:46 +00:00
|
|
|
|
|
|
|
|
|
|
This is a React-based web application built with Vite (react and typescript).
|
|
|
|
|
|
|
|
|
|
|
|
## Getting started
|
|
|
|
|
|
|
|
|
|
|
|
### Prerequisites
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
- Node.js (v18 or higher recommended)
|
|
|
|
|
|
- Yarn (v1.22+) (https://yarnpkg.com/)
|
|
|
|
|
|
|
|
|
|
|
|
### Installation
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
git clone https://mavportal.com/TobaOjo/Mav-Mobile-UI.git
|
|
|
|
|
|
cd Mav-Mobile-UI
|
|
|
|
|
|
yarn install
|
2025-08-13 14:23:48 +01:00
|
|
|
|
```
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
### Running Locally
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
yarn dev
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-11-11 13:52:58 +00:00
|
|
|
|
The app will be available at `http://localhost:5173`.
|
2025-08-13 14:23:48 +01:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
To run on locally on other devices
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
yarn dev --host
|
2025-08-13 14:23:48 +01:00
|
|
|
|
```
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
|
|
|
|
|
The app will be available at the exposed addresses to access e.g. http://1xx.xxx.x.xxx:<PORT>/Mobile
|
2025-11-11 13:49:46 +00:00
|
|
|
|
|
|
|
|
|
|
## Tech Stack
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
- **React** – UI library
|
|
|
|
|
|
- **Vite** – Build tool
|
|
|
|
|
|
- **Yarn** – Package manager
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
Create a `.env` file to access the Mav Mobile box in unit 5 for or for any environment-specific settings:
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```env
|
2025-11-11 13:52:58 +00:00
|
|
|
|
VITE_AGX_BOX_URL=http://1xx.xxx.xxx.xxx:<PORT>
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-11-11 13:52:58 +00:00
|
|
|
|
## Development
|
|
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
### Linting & Formatting
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
yarn lint
|
|
|
|
|
|
yarn format
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Testing
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
(Currently not implemented – consider adding Jest or Vitest)
|
|
|
|
|
|
|
2025-11-11 13:52:58 +00:00
|
|
|
|
## Deployment
|
|
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
To build for production:
|
2025-11-11 14:26:52 +00:00
|
|
|
|
Navigate to the Mav-Mobile-UI folder
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cd Mav-Mobile-UI
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
**Delete** the local .env (Production will use its own domain)
|
|
|
|
|
|
|
|
|
|
|
|
run
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
yarn build
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-11-11 13:57:05 +00:00
|
|
|
|
- Navigate to your Mav-Mobile-UI folder
|
|
|
|
|
|
- Select the Dist folder
|
|
|
|
|
|
- Compress to (ZIP)
|
|
|
|
|
|
- Log into box on Moba using Session > SSH and putting IP in Remote Host.
|
|
|
|
|
|
- Creds are mav:mav
|
|
|
|
|
|
- Drag and drop dist.zip into file explorer menu on left hand side (has to be named dist.zip exactly).
|
|
|
|
|
|
- Run command
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
2025-11-11 13:49:46 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
sudo ./integrate-web-ui.sh
|
|
|
|
|
|
```
|
2025-11-11 13:52:58 +00:00
|
|
|
|
|
|
|
|
|
|
Run
|
2025-11-11 13:49:46 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
sudo nano web-static/index.html
|
2025-11-11 13:52:58 +00:00
|
|
|
|
```
|
2025-11-11 13:57:05 +00:00
|
|
|
|
|
|
|
|
|
|
- add the following between the lines </body> & </html>
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
|
<foot>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
if (window.location.pathname !== "/Mobile") {
|
|
|
|
|
|
window.location.replace(window.location.origin + "/Mobile");
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</foot>
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- Run
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
sudo reboot
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
It should come back up all working
|