Skip to content

ManuelHMR/tractian-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

tractian-fullstack

Deploy

Backend

  • Installation:
    1. Clone this repository,
    2. Run "npm i" to install all modules.
    3. Run "npm run dev" at backend folder to start api in devlopment mode.

ENDPOINTS:

COMPANY ENDPOINTS:

1) POST /company - { name: string } to create a company.
2) GET /company - { no req.body } to read all companies registered.
3) GET /company/:companyid to read a company data.
4) PUT /company - { name: string, companyId: number } to update company`s name.
5) DELETE /company - { companyId: number } to delete a company. (The document won't be deleted, but the company will have the status "deleted").

USER ENDPOINTS:

6) POST /user - { name: string, compayId: number } to create a user.
7) POST /users - { userId: number } to read a user information.
8) PUT /user - { Work In Progress } to update user`s name.
9) DELETE /user - { userId : number } to delete user. (The document won't be deleted, but the user will have the status "deleted").
10) POST /companyusers - { companyId:number } to get all users from a company.

UNITS ENDPOINTS:

11) POST /unit - { name: string, companyId: number } to create a unit of a company.
12) POST /units - { companyId: number } to read all companies' units.
13) GET /unit/:unitid to read a unit data.
14) PUT /unit - { name: string, unitId: number } to change unit's name.
15) DELETE /unit - { unitId: number } to delete a unit (The document won't be deleted, but the unit will have the status "deleted").

ASSET ENDPOINTS:

16) POST /asset - { name: string, image: string, description: string, model: string, health: number, workStatus: "running" |" alerting" | "stopped", unitId: number } to create an asset to a unit.
17) POST /assets - { unitId: number } to read all assets of an unit.
18) PUT /asset - { assetId:number, name: string, image: string, description: string, model: string, health: number, workStatus: "running" | "alerting" | "stopped", unitId: number } to update an asset
19) DELETE /asset - { assetId } to delete an asset. (The document won't be deleted, but the asset will have the status "deleted").