React + TypeScript frontend for managing robot missions. The application displays missions in a table, lets users create or edit a mission, and deletes missions through a REST API.
This project is a Create React App application that uses Redux Toolkit for state management and Bootstrap-based UI components. The main workflow is centered on mission management:
- Load missions from the backend API
- Load available robots for mission assignment
- Create a new mission
- Edit an existing mission
- Delete a mission
- Show success and error feedback with toast notifications
- TypeScript-based React application
- Redux Toolkit async thunks for mission CRUD operations
- Bootstrap and React Bootstrap UI
- Data table for mission listing with pagination
- Toast notifications for API feedback
- Environment-based API configuration via
REACT_APP_API_URL
- React 18
- TypeScript
- Redux Toolkit
- React Redux
- React Bootstrap
- Bootstrap 5
- react-data-table-component
- react-toastify
- react-scripts 5
src/
app/
hooks.ts # Typed Redux hooks
store.ts # Redux store configuration
features/
missions/
Missions.tsx # Main missions screen
missionsSlice.ts # Async thunks and reducer state
*.test.tsx # Existing test placeholders
services/
missionService.ts # Mission API client
robotService.ts # Robot API client
utils/
models.ts # Shared response and domain models
App.tsx # App shell
index.tsx # Root render, Provider, ToastContainer
- Node.js 18 LTS or newer
- npm 9 or newer
- A reachable backend API that exposes the mission and robot endpoints
npm installCreate or update .env in the project root:
REACT_APP_API_URL=http://localhost:5000The current repository already contains an .env file. Update it if your backend is running on a different host.
npm startThe app will usually be available at http://localhost:3000.
Runs the app in development mode.
Creates an optimized production build in the build/ directory.
Runs the test runner.
Note: in a fresh checkout you must run npm install first. In the current workspace, npm test could not run because react-scripts was not installed yet.
Ejects the Create React App configuration. This is irreversible and usually unnecessary.
The frontend expects the backend base URL from REACT_APP_API_URL and calls endpoints under that base path.
GET /Api/MissionGET /Api/Mission/{id}POST /Api/MissionPUT /Api/MissionDELETE /Api/Mission/{id}
GET /Api/RobotGET /Api/Robot/{id}
The robot service also includes create, update, and delete methods, although the current UI screen focuses on mission management.
The mission screen expects mission responses to include robot details in the payload. A mission item is effectively treated as:
{
id: number;
name: string;
description: string;
robotId: number;
robotResponse: {
id: number;
name: string;
modelname: string;
description: string;
};
}API responses are wrapped in a shared response envelope with fields such as:
datastatusCoderesultCodeerrorDetailerrorDescriptionerrors
Mission state is managed in src/features/missions/missionsSlice.ts with Redux Toolkit async thunks:
getMissionsListgetMissionByIdcreateMissionupdateMissiondeleteMission
The UI reads mission state through typed Redux hooks from src/app/hooks.ts and renders the table or form accordingly.
- The application currently exposes a single primary screen: mission management.
- Mission creation and editing happen in the same form.
- Robot selection is populated dynamically from the API.
- Notifications are shown through
react-toastify.
Test files exist in the repository, but some are placeholders from the default scaffold and may require updates to reflect the current UI behavior.
- The UI is focused on missions; robot management is service-only at the moment.
- Error handling relies on the backend response contract being consistent.
- Styling is functional and minimal rather than fully customized.
This project is licensed under the MIT License. See LICENSE for details.
