Description: Definitely not Waymo or Cruise
This project combines a ReactJS frontend with backend API services written in Java that are supported via the Maven and Springboot frameworks. The code of this project is run able on any computer using the idea of containerization with Docker.
- The docker infrastructure for this project was developed by Mason Horne (Email him) and any questions should be directed at him.
The project is meant to be implement and developed locally and then deployed to a docker container for modularity. However, it is hard to run someone else's code on without the correct libraries/frameworks installed, so we have made it fully possible to develop the code within the docker containers.
- *Any mention of run this means run that command in a terminal
Steps for set up:
-
Install DockerDesktop via download link
-
Open docker desktop and make sure that the engine is running (lower left hand corner) when trying to execute a docker command
Yours shouldn't have the four images but the bottom left corner should have the words engine running
- Clone the code using the git clone https://github.com/jrbjrb1212/IntelliDrive.git or any type of version control with your IDE
Deploy the code via Docker:
-
Navigate to the outermost directory that contains this file and the docker-compose.yml file
-
Run the command below to make sure docker is running
$ docker --version
- Run the command below and wait between 30 seconds - 5 minutes for the code to build
$ docker-compose up
-
The web application is now locally hosted and can be accessed at http://localhost:3000/
-
The backend APIs are also locally hosted and are index by http://localhost:8080/api/ where anything after /api/* should be an API that is developed within this class. A sample example is at http://localhost:8080/api/hello
-
To work on a docker container, use the commands below
-
Find the running docker images
$ docker container ls
$ docker exec -it DOCKERID /bin/bash
- where the DOCKERID is obtained from the docker container ls command output
Deploy locally for development:
-
This will be about 10x faster in between updating code and seeing the results, but there are a bunch of dependencies issues
-
Need to install:
-
Test installs using:
- npm --version for Node
- java --version for Java 17
- Verify that Java 17 is installed should be something like openjdk 17.0.something
- mvn --version for Maven
Now we hope and pray that the installed frameworks are close enough to the code to work
- Open two terminal windows
- In one terminal window, navigate to the frontend/intelli_drive/
- Run npm install
- Run npm start
- In the other terminal window, navigate to backend/backend_services/
- Run mvn spring-boot:run
- If everything went well, the frontend will be hosted at http://localhost:3000/ and the various API will reachable through urls similar to http://localhost:8080/api/
Using the code notes:
- Every time there are changes made to the backend services source code the backend code needs to be recompiled through relaunching the docker containers or rerunning the local deployment
- The frontend will be updated in real time after each file save
- All of the frontend code is available in this folder
- All of the backend code is available in this folder
- ReactJS for the frontend facing web application
- ReactJS is the most popular web framework on Earth
- For more information, check this out
- Maven and Springboot for the Java API requests backend
- Maven is a build automation tool to build java libraries (more info)
- Springboot is an application framework built around the idea of extensions which are configurable subframeworks (more info)
- In this project, Springboot's web requests extension is used to with the ReactJS application via HTTP requests.
- Difference between a library and framework:
- A library like Java.random or Java.system make code cleaner by providing standard reusable declarations of code packaged as methods
- A framework provides abstraction over lower level features of an application that can be automated or configured away
- Ex: A library may load data for you in a program. A framework makes it possible to download data from the internet without thinking about setting up the communication
- Information coming soon
- Graphic coming soon
- Desorption coming soon
- Every pull request (code update) requires at least one other person to approve it before being merged into the main branch
- The first few pull requests will be reviewed by Group 3, but eventually we will spread these across other groups
- There is a branch set up for each group and these should be used by each group
- After there has been some progress that other groups would benefit from, submit a pull request (code update) from that branch to the main branch