Commit 2d6b18af authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

Initial Commit

parents
Loading
Loading
Loading
Loading

back/README.md

0 → 100644
+85 −0
Original line number Diff line number Diff line
# 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
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
version: '2'

services:
  db:
    image: "mysql"
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: db
      MYSQL_USER: user
      MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
 No newline at end of file

back/main.py

0 → 100644
+5 −0
Original line number Diff line number Diff line
from myfab.api import app

if __name__ == "__main__":
    app.run()
+488 B

File added.

No diff preview for this file type.

+618 B

File added.

No diff preview for this file type.