updated readme

This commit is contained in:
2025-11-11 13:52:58 +00:00
parent ee3e111e9b
commit e374456588
3 changed files with 40 additions and 28 deletions

View File

@@ -2,76 +2,86 @@
This is a React-based web application built with Vite (react and typescript). This is a React-based web application built with Vite (react and typescript).
## Getting started ## Getting started
### Prerequisites ### Prerequisites
- Node.js (v18 or higher recommended) - Node.js (v18 or higher recommended)
- Yarn (v1.22+) (https://yarnpkg.com/) - Yarn (v1.22+) (https://yarnpkg.com/)
### Installation ### Installation
```bash ```bash
git clone https://mavportal.com/TobaOjo/Mav-Mobile-UI.git git clone https://mavportal.com/TobaOjo/Mav-Mobile-UI.git
cd Mav-Mobile-UI cd Mav-Mobile-UI
yarn install yarn install
``` ```
### Running Locally ### Running Locally
```bash ```bash
yarn dev yarn dev
``` ```
The app will be available at `http://localhost:5173`. The app will be available at `http://localhost:5173`.
To run on locally on other devices To run on locally on other devices
```bash ```bash
yarn dev --host yarn dev --host
``` ```
The app will be available at the exposed addresses to access e.g. http://192.168.0.123:5173/Mobile
The app will be available at the exposed addresses to access e.g. http://1xx.xxx.x.xxx:<PORT>/Mobile
## Tech Stack ## Tech Stack
- **React** UI library - **React** UI library
- **Vite** Build tool - **Vite** Build tool
- **Yarn** Package manager - **Yarn** Package manager
## Configuration ## Configuration
Create a `.env` file to access the Mav Mobile box in unit 5 for or for any environment-specific settings: Create a `.env` file to access the Mav Mobile box in unit 5 for or for any environment-specific settings:
```env ```env
VITE_AGX_BOX_URL=http://100.118.196.113:8080 VITE_AGX_BOX_URL=http://1xx.xxx.xxx.xxx:<PORT>
``` ```
## 🧪 Development ## Development
### Linting & Formatting ### Linting & Formatting
```bash ```bash
yarn lint yarn lint
yarn format yarn format
``` ```
### Testing ### Testing
(Currently not implemented consider adding Jest or Vitest) (Currently not implemented consider adding Jest or Vitest)
## 🚢 Deployment ## Deployment
To build for production: To build for production:
```bash ```bash
yarn build yarn build
``` ```
Navigate to your Mav-Mobile-UI folder Navigate to your Mav-Mobile-UI folder
Select the Dist folder Select the Dist folder
Compress to (ZIP) Compress to (ZIP)
Log into box on Moba using Session > SSH and putting IP in Remote Host. Log into box on Moba using Session > SSH and putting IP in Remote Host.
Creds are mav:mav Creds are mav:mav
Drag and drop dist.zip into file explorer menu on left hand side (has to be named dist.zip exactly). Drag and drop dist.zip into file explorer menu on left hand side (has to be named dist.zip exactly).
Run command Run command
```bash ```bash
sudo ./integrate-web-ui.sh sudo ./integrate-web-ui.sh
``` ```
Run
Run
```bash ```bash
sudo nano web-static/index.html sudo nano web-static/index.html
``` ```

BIN
dist.zip Normal file

Binary file not shown.

View File

@@ -160,12 +160,13 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
<dd className="font-medium text-2xl">{sighting?.seenCount ?? "-"}</dd> <dd className="font-medium text-2xl">{sighting?.seenCount ?? "-"}</dd>
</div> </div>
{sighting?.make && ( {sighting?.make ||
<div> (sighting?.make.trim() && (
<dt className="text-gray-300">Make</dt> <div>
<dd className="font-medium text-2xl">{sighting?.make ?? "-"}</dd> <dt className="text-gray-300">Make</dt>
</div> <dd className="font-medium text-2xl">{sighting?.make ?? "-"}</dd>
)} </div>
))}
{sighting?.model || {sighting?.model ||
(!sighting?.model.trim() && ( (!sighting?.model.trim() && (
<div> <div>
@@ -173,12 +174,13 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
<dd className="font-medium text-2xl">{sighting?.model ?? "-"}</dd> <dd className="font-medium text-2xl">{sighting?.model ?? "-"}</dd>
</div> </div>
))} ))}
{sighting?.color && ( {sighting?.color ||
<div className="sm:col-span-2"> (!sighting?.color.trim() && (
<dt className="text-gray-300">Colour</dt> <div className="sm:col-span-2">
<dd className="font-medium text-2xl">{sighting?.color ?? "-"}</dd> <dt className="text-gray-300">Colour</dt>
</div> <dd className="font-medium text-2xl">{sighting?.color ?? "-"}</dd>
)} </div>
))}
<div> <div>
<dt className="text-gray-300">Time</dt> <dt className="text-gray-300">Time</dt>