Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating develop with frontend #138

Merged
merged 33 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e198ac8
Merge pull request #89 from waveyboym/develop
waveyboym Oct 31, 2023
f44096f
update
waveyboym Oct 31, 2023
4e16a51
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
waveyboym Oct 31, 2023
610fa53
updates listed in extended description
waveyboym Oct 31, 2023
e7f0763
made order tracking page a bit more organized
waveyboym Oct 31, 2023
74fb952
minor ui tweaks and organisational tweaks
waveyboym Oct 31, 2023
7ab0d0d
Merge pull request #92 from waveyboym/develop
waveyboym Oct 31, 2023
d6e6392
still fixing manager end
u21631532 Nov 1, 2023
18ae3c3
booking and booking menu done
u21631532 Nov 1, 2023
50f6253
created ability to be seated
waveyboym Nov 1, 2023
ccfa916
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
waveyboym Nov 1, 2023
74df390
changed splashpage links to buttons
waveyboym Nov 1, 2023
13bb2df
add emotional state, styling needs updating
u21631532 Nov 1, 2023
819ae16
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
u21631532 Nov 1, 2023
9099042
added modal pop
u21631532 Nov 1, 2023
2e39b78
created manager dashboard
waveyboym Nov 1, 2023
dacbb90
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
waveyboym Nov 1, 2023
752a76b
Merge pull request #103 from waveyboym/develop
waveyboym Nov 2, 2023
373ecfc
styling fixed
u21631532 Nov 2, 2023
ad41233
minor manager processing backend update
waveyboym Nov 2, 2023
f9d0c18
updated dashboard to take in backend data
waveyboym Nov 2, 2023
e561803
Added get all function and update table function
waveyboym Nov 2, 2023
c1a6eca
Merge branch 'frontend' into application-class-only
waveyboym Nov 2, 2023
7597cc5
Merge pull request #111 from waveyboym/application-class-only
waveyboym Nov 2, 2023
48f0274
manager can to talk to backend and receive updates
waveyboym Nov 3, 2023
680f593
Merge pull request #119 from waveyboym/develop
waveyboym Nov 3, 2023
331c771
the tracking needs update on styling
u21631532 Nov 3, 2023
89ebc4f
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
u21631532 Nov 3, 2023
c5c2930
fixed hidden threads seg fault
waveyboym Nov 3, 2023
30a0793
Merge branch 'frontend' of https://github.com/waveyboym/COS-214-Proje…
waveyboym Nov 3, 2023
b5e3181
Merge pull request #130 from waveyboym/develop
waveyboym Nov 4, 2023
251740b
Merge pull request #137 from waveyboym/develop
waveyboym Nov 4, 2023
06119c8
updated application class to talk to restaurant
waveyboym Nov 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 151 additions & 70 deletions src/App/Application.cpp

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions src/App/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
#include "../backend/includes/json.hpp"
#include "../backend/includes/uuid.h"
#include "../backend/includes/color.hpp"
//#include "../backend/includes/Restaurant.hpp"
#include <map>
#include <mutex>
#include <chrono>
#include <thread>
#include <list>
#include <vector>

using json = nlohmann::json;

Expand Down Expand Up @@ -51,6 +53,11 @@ class Application{
*/
crow::SimpleApp app;

/**
* @brief this holds the app variable that creates a websocket and intercepts incoming requests
*/
//std::shared_ptr<Restaurant> restaurant;

/**
* @brief this holds all of the connected/subscribed clients that way if there is an update on the backend, we can send updated data to the client in json form.
* @note Note that when a client closes their connection, they become unsubscribed and will no longer receive any messages from the backend.
Expand Down Expand Up @@ -132,6 +139,28 @@ class Application{
* @return bool
*/
bool removeClient(crow::websocket::connection* client);

/**
* @brief removes this client from the restaurant and returns true on success else false
* @param is_a_manager whether or not the uuid is a manager
* @param client_uuid the client uuid to remove
* @return bool
*/
bool removeClientFromListAndRestaurant(bool is_a_manager, std::string client_uuid);

/**
* @brief sends out a get all update to all connected managers
* @param none
* @return void
*/
void messageManagers();

/**
* @brief progresses the restaurant forward by one step
* @param none
* @return void
*/
void updateRestaurant();
};

#endif
8 changes: 8 additions & 0 deletions src/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
Loading