Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nareshbhatia/autonomous-research
Research before the full-fledged autonomous project
https://github.com/nareshbhatia/autonomous-research
Last synced: about 22 hours ago
JSON representation
Research before the full-fledged autonomous project
- Host: GitHub
- URL: https://github.com/nareshbhatia/autonomous-research
- Owner: nareshbhatia
- Created: 2024-10-21T16:12:48.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-23T23:56:23.000Z (4 months ago)
- Last Synced: 2024-10-24T03:36:22.456Z (4 months ago)
- Language: TypeScript
- Size: 699 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Autonomous Research
Research before the full-fledged autonomous project.
## Autonomous App
Here's a screenshot of the current state of the app. Note that the app shows the
route of the selected vehicle from the starting point to the destination.
### Architecture

### Workspaces
- Fleet Simulator: `apps/fleet-simulator`
- Vehicle Events Service: `apps/vehicle-events`
- Redis Server: Started via `./docker-compose.yml`
- API Gateway: `apps/api-gateway`
- Autonomous Frontend: `apps/autonomous`
- Type definitions and shared functions:`packages/autonomous-research-domain`
- Vehicle Actions Service: Not implemented yet### Running the Autonomous App
- Build all workspaces: `npm run build`
- Build all Docker images:
- Fleet Simulator: `cd apps/fleet-simulator && npm run docker-build`
- Vehicle Events Service: `cd apps/vehicle-events && npm run docker-build`
- API Gateway: `cd apps/api-gateway && npm run docker-build`
- Run the Autonomous frontend:
- `cd apps/autonomous && npm run dev`
- Open browser window at http://localhost:3000/
- Run Docker Compose:
- `docker compose up`
- Then immediately refresh the Autonomous home page in the browser so that all
markers get routes### Mapbox Directions App
A simple app to demonstrate the use of Mapbox Directions API.
Go to `apps/mapbox-directions` and follow the instructions in the
[README](apps/mapbox-directions/README.md).## Prerequisites for development
1. [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm) - allows using
different versions of node via the command line## Getting Started
```shell
nvm use # use the required version of node
npm ci # install dependencies
npm run build # build all packages
npm run dev # run apps# in a separate shell
npm run storybook
```Open browser windows at the following URLs to see the respective apps:
1. http://localhost:3000/: Autonomous App
2. http://localhost:6006/: Storybook> Note: Do not run `npm install` or `npm ci` in any of the subdirectories. It
> will break the build. There should be only one `package-lock.json` file in the
> entire repo (at the root).## All Commands
```
npm ci # install dependencies
npm run build # builds all workspaces
npm run ci-validate # builds, lints, formats, and tests all code (runs in CI pipeline, don't run locally)
npm run clean # deletes all build artifacts
npm run commit # displays commit helper prompt to ensure your commits use conventional commits
npm run dev # run app
npm run fix # lints, formats and attempts to fix any issues (requires `npm run build` has been ran)
npm run format # formats all workspaces, useful for debugging format issues (generally `npm run fix` is preferred)
npm run lint # runs the linter on all workspaces, useful for debugging lint issues (generally `npm run fix` is preferred)
npm run storybook # runs storybook
npm run test # runs full build, lint, format, and all tests - run before pushing to remote
```## Common Workflows
### Creating New Components
Use [Code Shaper](https://www.code-shaper.dev/) to create new components. This
will give you a good starting point that is consistent with React best
practices.Here's an example of creating a component called `EventList` using Code Shaper:
```sh
$ npx shaper
? Which plugin would you like to run? React (@code-shaper/react - generates React applications)
? Which generator would you like to run? component (generates a component)
? Component name? (e.g. TextField) EventList
? Which workspace should this go to? apps/autonomous-research
? Parent directory within workspace? src/components/EventListCreating EventList...
EventList.stories.tsx
EventList.test.tsx
EventList.tsx
index.tsDone.
```### Production build
To build all packages and apps for production, run the following command:
```shell
npm ci
npm run build
```### Clean build
Removes all build artifacts and performs a clean build. Run these steps before
pushing to remote.```shell
npm run clean
nvm use
npm ci
npm run build
npm run fix
npm test
```For an "aggressive" clean build, add a step to remove the `package-lock.json`
file as shown below. This will build the lock file from scratch.```shell
npm run clean
nvm use
rm package-lock.json
npm install
npm run build
npm run fix
npm test
```### Running unit tests
The following command runs a full build, lint, format, and all tests. However,
it uses the Turborepo cache to skip steps that have no changes since the last
run. Hence it is very efficient. **Always run this command before pushing to
remote.**```shell
npm test
```### Running end-to-end tests using dev build
```shell
npm run dev # starts a local server hosting the react app# run e2e tests non-interactively (run in a different shell)
npm run e2e# run e2e tests in the Playwright user interface (run in a different shell)
npm run e2e:ui
```### Linting, formatting and fixing coding issues
```shell
npm run fix
```