# MyFab

> Devinci Fablab internal 3D printing gestion interface -- backend application


## Scope

- receive stl input
- display status of print request
- receive g code
- place request in printing queue
- send job to connected 3d printers
- expose various information about the environment

### Safety
```
Authorization: Bearer <DVIC_JWT_TOKEN>
```
header is mandatory on all endpoints except /metrics

### Endpoints

`GET /requests/my` Get the list of your own print request
```
{
    "id": str
    "infos": {
        "name": str,
        "description": str,
        "status": int,
        "status_info": str,
        "stl": str,
        "author": str,
        "project": str,
        "operator": str
    },
    "slice": { // if see slice perm, slice page information
        "status": int,
        other infos if vm slicer used
        "project_id": str
        "slicer_id": str
        "connection_token"... to guac
        
        In any case:
        "g_path": str // current g code

    },
    "queue": {
        "queue_name": str
        "position": int,
        "attempt": int
        "print_progress": ?
        "remaining_time": // estimate time including queue

    },
    "recuperation": {
        "message": 
    }
    "timeline": [
        {
            "date": date,
            "event_type": int,
            "message": str?
        }...
    ],
}
```

`GET /requests/:id` info on a particular request

`POST /requests/submit` submit new request

`GET /requests/:id/state/:state` change request to state

`POST /upload/:id/:type` upload stl/gcode

`GET /queues/[:name]` infos about a queue

`POST /queues/:name` change queue parameters

later
`GET /printers/`  get printers status
`POST /printers/` configure new printer
`POST /printers/:id` configure printer