My Data Project



FRANCE IN THE PLATE
" It's possible to travel around France and consume locally !"


THE OBSERVATION

The increase in the Earth's population and the need to ensure a comfort of life for future generations leads us to modify our food consumption patterns to reduce CO2 emissions, pollution, reduce waste, etc. Unfortunately, whether it is lack of information, effort, or lack of help, a big part of the population is aware of the issue but does not act on it and continue to waste food, consume products from far away and to be not worry about waste.

THE ISSUE

Many cooking enthusiasts enjoy their passion for cooking without concern about the environmental impact of their consumption. Yet, it is possible to combine pleasure and respect for the environment, and then, what could be more motivating than to have fun while acting for the common good? The problem that arises is the next : How to combine pleasure and respect for the environment by cooking?

THE PROJECT TO ANSWER IT

In response to the problem, the project "France in the plate" aims to give recipe ideas to cooking enthusiasts and in the same time encouraging them to favour short circuits by sourcing directly from small producers. Thus, the goal is to be able to exercise one's passion while being sensitive to sustainable and responsible consumption. The user will have at his disposal a search bar in which he can enter the name of the desired region of metropolitan France. Then, three specialities of the selected region will be proposed to him, with, for each specialty, the address of small local producers at which the user will be able to source good food for realize the specialty.


The building of my database on FireBase


In order to carry out this project, it is first necessary to create a database. For this, I used the FireBase software that allows us to store objects directly without using SQL. Thus, I created a database that includes the names of the regions, a list of gastronomic specialties for each region and finally a list of small local producers for the preparation of each specialty. The goal is to be able to use this base in the future to be able to access the specialties and addresses of the small producers by simply typing the name of a region in the search bar. Here is an overview of the compressed database presenting only the list of the 13 French regions metropolitan (on the left) and the developed database presenting the list of specialties by region and the list of small producers for each speciality ( on the right ).



Make the link between the database and the project


To link my Firebase database to my glitch project, it has just copy and paste the link provided by FireBase in the section JavaScript of the project (code.js)



Creation of the search bar, the button in HTML and coding in Javasript to make it work




Here, I started by creating in Html the search bar and the button "Rechercher une région" to search for a region. (image at left). The button and the search bar now exist, however, we cannot use it. To make it work and that the search for a region shows us specialties and small producers, it will be necessary to make a configuration in "js.code" JavaScript.

The function starts by retrieving only the region that you have entered in the search bar with $(#region) (line 19) for focus on this key word.
Once this is done, another function is started again which allows you to to display the elements in the html.
Then, we create a dynamic title in the "body" that will change according to what you write (line 25- 29) to give an answer appropriate to the request.
Finally, we create the list "list" and add it to the html (line 31-49),
would have liked the final version to be able to display the specialties, then the producers, but within the limits of my skills, it was complicated. Thus, when we tap a region in the search bar, we obtain directly all the specialties and small producers with the specialties in bold.






It's up to you !
Try the search bar



The regions of France :

Auvergne-Rhône-Alpes; Bourgogne-Franche-Comté; Bretagne; Centre-Val de Loire; Corse; Grand Est; Hauts-de-France; Ile-de-France; Normandie; Nouvelle-Aquitaine; Occitanie; Pays de la Loire; Provence-Alpes-Côte d’Azur.