Skip to content

A small school-based project with ASP .net concerning storing and managing telemetry data for cars.

Notifications You must be signed in to change notification settings

S0urC10ud/SEW5-CarTelemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

SEW5-CarTelemetry

A small school-based project with ASP.net Core to model telemetry data for cars and access them via a REST-API. CRUD-Razor Page Scaffolds are used to display and modify the active state of used Local-DB.

I created this repository to help out my class mates as some are struggling a little bit with ASP.net.

Alternatively, you can override the "connectionString" in the appsettings.json File to use a diffrent relational Database.

The access is modelled with a 1:n 3NF relationship using the Entity Framework. Furthermore, the NuGet-Package EntityFrameworkCore.Triggers is used to set the ModifiedAt and the CreatedAt timestamps.

REST-API Documentation

The default path for the API is /api/cars.

For most request methods, an id can be specified as the most specific path of the route: /api/cars/id

GET

Example: GET http://localhost:51648/api/cars

[
    {
        "carId": 2,
        "name": "Hallo Welt2",
        "typ": 0,
        "telemetryData": [],
        "createdAt": "2020-10-16T11:02:09.2220521",
        "modifiedAt": "2020-10-16T11:02:09.2220521"
    }
]

Example: GET http://localhost:51648/api/cars/2

{
    "carId": 2,
    "name": "Hallo Welt2",
    "typ": 0,
    "telemetryData": [],
    "createdAt": "2020-10-16T11:02:09.2220521",
    "modifiedAt": "2020-10-16T11:02:09.2220521"
}

POST

Example: POST http://localhost:51648/api/cars/

Request Body:

{
    "name": "SomeRandomCar",
    "typ": 0,
    "telemetryData": []
}

Response:

{
    "carId": 3,
    "name": "SomeRandomCar",
    "typ": 0,
    "telemetryData": [],
    "createdAt": "2020-10-23T11:39:08.8043839+02:00",
    "modifiedAt": "2020-10-23T11:39:08.8043839+02:00"
}

PUT

Example: http://localhost:51648/api/cars/3 Request:

{
    "name": "SomeRandomCar2",
    "typ": 0,
    "telemetryData": []
}

DELETE

Example: http://localhost:51648/api/cars/3

Response:

{
    "carId": 3,
    "name": "SomeRandomCar2",
    "typ": 0,
    "telemetryData": [],
    "createdAt": "2020-10-23T11:39:08.8043839",
    "modifiedAt": "2020-10-23T11:47:04.1889731"
}

Demo Images

The index page:
Create a car:
View the details of a car:
Show telemetry data:

Getting started

Open the project in visual studio and type "Update-Database" in the PackageManager-Console.

About

A small school-based project with ASP .net concerning storing and managing telemetry data for cars.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •