diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 660da3f252d1e1d8f49bf3afb7082bde384b2763..e1a8375f63e310a2fd7799d0649fbb323efc3d79 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -133,8 +133,8 @@ test-back: # - job_id=$(cat job_id) - if [ $IMAGE = "back" ] ; then - > - ssh "eatfast@$DOMAIN" - "cd /var/www/eatfast-website/backend && + ssh "viaresto@$DOMAIN" + "cd /var/www/viaresto-website/backend && git stash && git fetch && git checkout "$CI_COMMIT_BRANCH" && @@ -147,7 +147,7 @@ test-back: - echo 'REACT_APP_BASE_URL_BACK="https://$DOMAIN/api"' > .env; - echo 'REACT_APP_BASE_URL_FRONT="https://$DOMAIN"' >> .env; - npm run build; - - scp -r build/ eatfast@"$DOMAIN":/var/www/eatfast-website/frontend ; fi + - scp -r build/ viaresto@"$DOMAIN":/var/www/viaresto-website/frontend ; fi deploy-back-prod: @@ -156,7 +156,7 @@ deploy-back-prod: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: always variables: - DOMAIN: eatfast.viarezo.fr + DOMAIN: viaresto.viarezo.fr PRIVATE_KEY: "$SSH_PRIVATE_KEY" IMAGE: "back" dependencies: [] @@ -168,7 +168,7 @@ deploy-front-prod: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: always variables: - DOMAIN: eatfast.viarezo.fr + DOMAIN: viaresto.viarezo.fr PRIVATE_KEY: "$SSH_PRIVATE_KEY" IMAGE: "front" dependencies: @@ -185,7 +185,7 @@ deploy-back-staging: - if: $CI_COMMIT_BRANCH when: always variables: - DOMAIN: eatfast.test.viarezo.fr + DOMAIN: viaresto.test.viarezo.fr PRIVATE_KEY: "$SSH_PRIVATE_KEY_STAGING" IMAGE: "back" dependencies: [] @@ -201,7 +201,7 @@ deploy-front-staging: - if: $CI_COMMIT_BRANCH when: always variables: - DOMAIN: eatfast.test.viarezo.fr + DOMAIN: viaresto.test.viarezo.fr PRIVATE_KEY: "$SSH_PRIVATE_KEY_STAGING" IMAGE: "front" dependencies: diff --git a/README.md b/README.md index b2cde2289aa296de7e294a0cade6783cfbf3e16a..56b61b3fd017b46780ea726e001de79123329abe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# **Eatfast** -Eatfast is a website developed by ViaRézo for monitoring the waiting time in CROUS restaurants. +# **ViaResto** +ViaResto is a website developed by ViaRézo for monitoring the waiting time in CROUS restaurants. <br/> diff --git a/backend/cameras.py b/backend/cameras.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfccad5e996f09be08cc05d34f4774c50e4707e --- /dev/null +++ b/backend/cameras.py @@ -0,0 +1,52 @@ +restaurants = [ + { + "restaurant": "local", + # the linear function estimating the waiting time t based on the number of people n and the number c of open checkouts is: + # t = a * n / c + b + "a_factor": 30, # slope + "b_factor": 120, # y-intercept + # list of all the cameras that correspond to a same restaurant + "cameras": + [ + { + # the RTSP url will be: rtsp://user:password@IP:stream + "IP": "", + "user": "", + "password": "", + "stream": "stream1", + # list of the coordinates of the points which constitue the region that should be masked on the picture + "mask_points": + [ + # polygon which should be part of the mask + [ + # [x, y] coordinates of each vertex of the polygon (on a 1280*720 picture) + [70, 370], + [420, 720], + [1280, 720], + [1280, 250], + [930, 215], + [450, 550], + [130, 350] + ] + ], + # list of the coordinates of each checkout + "checkouts": + [ + # each checkout corresponds to a rectangle, indicated by two x and two y coordinates + { + "x1": 380, + "x2": 435, + "y1": 740, + "y2": 780 + }, + { + "x1": 300, + "x2": 350, + "y1": 830, + "y2": 880 + } + ] + } + ] + } +] diff --git a/backend/db/crud.py b/backend/db/crud.py index 853195a6872997706fa95c64a7d6d4b9ba37a8fb..944554624e471e04874b0ea97c463ab770066b2e 100644 --- a/backend/db/crud.py +++ b/backend/db/crud.py @@ -395,7 +395,7 @@ def update_user(user: schemas.User, user_info: dict, db: Session): if existing_user: existing_user.cookie = user.cookie existing_user.expiration_date = expiration_date - existing_user.admin = "admin eatfast" in user_info["roles"] + existing_user.admin = "admin viaresto" in user_info["roles"] db.delete(user) db.add(existing_user) db.commit() @@ -404,7 +404,7 @@ def update_user(user: schemas.User, user_info: dict, db: Session): else: user.username = full_name user.expiration_date = expiration_date - user.admin = "admin eatfast" in user_info["roles"] + user.admin = "admin viaresto" in user_info["roles"] db.add(user) db.commit() db.refresh(user) diff --git a/frontend/public/index.html b/frontend/public/index.html index e4406637291776d5559c2c2781a9165bb5878747..a9a2b198d37f42d4da27a49b5037128cbfc62b12 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,15 +1,13 @@ <!DOCTYPE html> <html lang="en"> - <head> - <meta charset="utf-8" /> - <link rel="icon" href="%PUBLIC_URL%/thumbnail_violet.png" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="theme-color" content="#000000" /> - <meta - name="description" - content="Web site developed by ViaRézo" - /> - <!-- + +<head> + <meta charset="utf-8" /> + <link rel="icon" href="%PUBLIC_URL%/thumbnail_violet.png" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="theme-color" content="#000000" /> + <meta name="description" content="Web site developed by ViaRézo" /> + <!-- Notice the use of %PUBLIC_URL% in the tags above. It will be replaced with the URL of the `public` folder during the build. Only files inside the `public` folder can be referenced from the HTML. @@ -18,12 +16,13 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - <title>Eatfast</title> - </head> - <body> - <noscript>You need to enable JavaScript to run this app.</noscript> - <div id="root"></div> - <!-- + <title>ViaResto</title> +</head> + +<body> + <noscript>You need to enable JavaScript to run this app.</noscript> + <div id="root"></div> + <!-- This HTML file is a template. If you open it directly in the browser, you will see an empty page. @@ -33,5 +32,6 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> - </body> -</html> +</body> + +</html> \ No newline at end of file diff --git a/frontend/src/components/Header.js b/frontend/src/components/Header.js index 2a2ccad3ced779d57fd6e0632b79929c6e180828..a42676f4f3616556ec1176c179d41d9f91977ac3 100644 --- a/frontend/src/components/Header.js +++ b/frontend/src/components/Header.js @@ -34,7 +34,7 @@ export default function Header({ selection, setSelection }) { : `${selection.name} : actuellement ${selection.status ? "ouvert" : "fermé"}`)} </div> <Link id="header-home-link" to="/" onClick={() => setSelection(null)}> - <h2>{width || !selection ? "Eatfast" : selection.name}</h2> + <h2>{width || !selection ? "ViaResto" : selection.name}</h2> </Link> <div id="header-timetable"> {selection ? (