# RFID Based Embedded System for Sustainable Food Management in an IoT Network Paradigm
## 3 RFID Food Management System
### RFM App  
The RFM app front-end has been implemented using HTML5, the latest version of the web page and web application developing standard de facto. It has a user-friendly interface. Our approach relies on single page application (SPA) implementation, in which the information is dinamically loaded, depending on the user needs. Conversely, in the multi page web applications (MPA), the server sends all the page information every time the user requests something. Thus, the single page application offers a faster page loading, better user-experience, no need to write server side code to render the web page, and splits both data representation and processing [19]. In addition, other frameworks and libraries have been used to ease the developing task. Thus, the AngularJS framework [20] allows one to write web applications from the client side in a structured manner, easing the communication with the server. This framework follows a software design pattern known as Model View Controller (MVC). This pattern allows one to separate user interface from the application's logical part. Lastly, in order to provide a more visually attractive application that might adapt to any device (a.k.a responsive design), we used Bootstrap [21], an open source framework. Next, the main RFM app interfaces are displayed, describing their functions. Figure 3 presents the RFM app login and registration pages. Figure 3a shows the main page. If the user has already been registered, he only needs to login with his credentials. Otherwise, he has to be registered by clicking on the blue button. Figure 3b presents the registration form, which a new user is required to fill up, in order to obtain his personal information, as well as the allergies he might have. This information will be used to recommend recipes later. Thereby, the user is required to insert a username (1) and password (2) as credentials to access the application. His name (3) and surname (4) are also required. Since the user owns the kitchen furniture, we insert a RFM identifier (5) to link the kitchen furniture content to the owner(s). Since the percentage of children with food allergies has increased by 50% from 1997 to 2011, and this number is still increasing [22], we introduced allergens information in the registration form. The user with food allergies can activate the checkbox (6), and multiple allergens will be shown (7). Otherwise, the system will assume the user has no food allergies. Finally, the user finishes the registration process and creates his account by pressing the blue button (8). Once the user logs into the application, he has many available options. Figure 4 shows two RFM app images. Figure 4a shows the recipes menu, with a set of filters to get recipe recommendations. All the functions are accessible from the left side bar. The different functions are: A list of the available products in the kitchen furniture (1), list of all available recipes (2), product offers at nearby supermarkets (3), help section to guide the user (4), and log out (5). The RFM app aims to ease the user's search of recipes, based on his preferences, available products, and allergies. Thus, we designed filters for that matter. The user can search for a given recipe manually (6), filtering by categories such as fish, vegetables, etc. (7), based on available products (8) and considering food allergies (9). Figure 4b describes one user's available product. In this example with the whole milk, the application shows a picture of it (1), its allergens (2), its name (3), its location (4), its quantity (5), its expiration or issued date (6), and supermarket offers of the product, if they exist (7). Since the expiration and issued date are linked to the fact of throwing away food, the background color changes depending on whether the product is fresh (blue), if it is not fresh and will expire, or is about to do so (red), and if it is not freshand it is in a good condition (black) (6).