Skip to content

Mow-E/Backend

Repository files navigation

Documentation of Mow-E Backend

High Level Requirements

#B1.1 #B1.2 #B1.3
Publish a REST API for reading and writing
position data that is sent from the mower.
The REST API shall contain a service
for reading and writing image data.
When image data is written, the service shall perform
an image classification via for example Google API.

Low Level Requirements

#B1.1
Websockets for R/W
mowers position data
#B1.2
Service for read/write
image data
#B1.3
Service for image classification
#B1.4
Security
#B1.5
Additional Functionality
#B1.6
Tests
#B1.1a
Endpoint for accessing websocket
#B1.2a
Websocket endpoint
for receiving images
#B1.3a
Access to Google Vision API
#B1.4a
Enabling security in Spring
#B1.5a
Binding a mower to a specific user
#B1.6a
Python scripts for testing the websockets
#B1.1b
Controller for processing the websocket endpoints
#B1.2b
Image storing
#B1.3b
Service for Image classification
#B1.4b
User-Admin tables in db
#B1.5b
Frontend for Admin Dashboard
#B1.6b
Spring tests for high level requirements - authentication, authorization, managing the mower, mowing history, images
#B1.1c
Position data prototype
#B1.2c
Bind image to collision coordinate
#B1.3c
Saving data from Image classification service
#B1.4c
Authentication & Authorization via REST API
#B1.5c
Endpoints for an overview of user/mower statistics
#B1.6c
Github actions for Spring tests
#B1.1d
Service for saving positioning data
#B1.4d
Authentification via JWT
#B1.5d
Endpoint for cleaning the image repository
#B1.1e
Position data broadcast
for Mobile
#B1.4e
Websocket authentification
#B1.4f
Endpoints for retrieving mowing sessions
#B1.4f
Error handling
#B1.4g
Establishing a communication protocol

Network diagram

network_diagram.png

File structure overview

detailed_structure_dark.png

Main Class

Configs

  • ErrorConfig.java

    • This class captures all untracked errors from endpoints and returns a default error-json.
  • ExecutorConfig.java

    • We reserve a pool of executors that are needed for various tasks.
      • Currently for the communication with the Google Vision API in a separate thread.
  • SecurityConfig.java

    • Setting the access authority for all endpoints.
    • Error handling in case of missing authorities.
    • Enabling the JwtRequestFilter for processing the JWT.
    • Creates standard users for testing the application. (user & admin).

    EncoderComponent.java

    • Encodes the passwords for saving them in db

    JwtRequestFilter.java

    • Simply processes the JWT tokens if exists in request.
    • All requests are going through this filter to identify the authority.
  • WebConfig.java

    • Resource handler
    • Path matching
    • CORS configuration
  • WebSocketConfig.java

    • Stomp configuration
    • Authentication for websockets
    • Destination prefixes for endpoints

Services

Controllers

Repository

Resources

  • application.properties
    • A lot of settings for the entire application
    • I resist to document all of them
  • schema.sql
    • Initializes the db tables on first application run

Utils

Tests

Frontendus -> under construction

Dashboard that help the admin to see key information about the all project.

Stack used

  • Vite
  • React.js
  • MUI 5

How to launch it ?

First you need to create a .env

VITE_API_HOST=https://mow-e.me/
cd frontend/
yarn install
yarn build
yarn start

The default port used is 3000

127.0.0.1:3000

Endpoints

Page Endpoints
Login /login
Signup /signup
Dashboard /dashboard/app
User /dashboard/user

About

It works and thanks for that

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •