Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ligula sem, consectetur a risus euismod, finibus eleifend augue. Suspendisse mauris arcu, vestibulum sit amet libero pellentesque, commodo commodo tellus. Donec sit amet ex odio. In dictum egestas metus, non pellentesque arcu. Mauris eros velit, euismod pulvinar vehicula et, faucibus eget velit. Maecenas accumsan mattis vestibulum. Curabitur vitae nibh eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
java -version
It should be version 21.x.x
PS C:\Users\olive\Documents\Programming\P3-BM-dashboard\backend> java -version
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)
Otherwise download and install here.
mvn -version
PS C:\Users\olive\Documents\Programming\P3-BM-dashboard\backend> mvn -version
Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: C:\Program Files\Maven\apache-maven-3.9.4
Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-21.0.1.12-hotspot
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
[!WARNING] Spring is broken with the latest docker compose version
2.23.0
, and will not run.Instead of downloading latest, use version
4.23.0
of Docker Desktop hereConfirm with
docker-compose --version
that you are running version2.20.3
Issue on Stack overflow here
MongoDB Compass allows you to browse the database.
docker-compose.yaml
in the project root for database password and user (Authorization)- 'MONGO_INITDB_DATABASE=dashboard-db'
- 'MONGO_INITDB_ROOT_PASSWORD=secret'
- 'MONGO_INITDB_ROOT_USERNAME=root'
mongodb://root:secret@localhost:27017/?authMechanism=DEFAULT
This are the commands to run the application, with either Spring dev server, Vite dev server or as a whole with docker compose
Component | Directory | Command | Frontend | Backend | Database | Nginx |
---|---|---|---|---|---|---|
Java backend | /backend | mvn spring-boot:run | Build docker | Dev server | Run docker | Run docker |
Vue Frontend | /frontend | npm run dev | Dev server | Build docker | Run docker | Run docker |
Docker compose | / | docker compose –profile frontend –profile backend up –build | Build docker | Build docker | Run docker | Run docker |
Container | Port |
---|---|
frontend | 80 |
backend | 8080 |
mongodb | 27017 |
nginx | 80 |
To start Spring for backend development:
cd /backend
mvn spring-boot:run
docker compose up
mongodb
database container only (Don’t build the Java backend docker container, since it will launch locally)mvn spring-boot:stop
To start React for frontend development:
cd /frontend
npm run dev
To build frontend, and backend and start the whole stack. Mostly for deployment.
docker compose --profile frontend --profile backend up --build
--build
instead of pulling.--profile prod
enables the spring-boot
container to be build (Not used when using mvn spring-boot:run
, creates duplicate).spring-boot
container.frontend
container.mongodb
container.nginx
container.nginx
reverse proxy on http://localhost
or http://localhost/api/v1
docker compose down
to stop the containers together.Method | Endpoint | Description |
---|---|---|
GET | /api/v1/integrations | Returns all integrations |
POST | /api/v1/integrations | Instantiate a new integration |
GET | /api/v1/integration/{ID} | Get an integration without its data, by ID |
PUT | /api/v1/integration/{ID} | Update an integration by it’s ID |
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/integration/{ID}/data | Returns all data for an integration |
POST | /api/v1/integration/{ID}/data | Submit new data to an integration |
GET | /api/v1/integration/{ID}/data/{ID} | Get a single registration for an integration, by ID |
PUT | api/v1/integration/{ID}/data/{ID} | Update a single registration, by ID |
DELETE | /api/v1/integration/{ID}/data/{ID} | Delete a registration for an integration |
#Forntend Navigation At the moment you can navigate with most of the buttons, otherwise and because it’s a work in progress use URL naviagtion. There are endpoints as follows /login /dashboard /supervisor /newmetric /newintegration