Good morning team @ODCC2015

localEAT production
1	Anar Bazarhanova
2	Khan Mohammad Habibullah
3	Marie Leslie Melanie Pittumbur
4	Julien Dhallenne

What is LocalEAT

Due to fierce competition from supermarkets and other food-based corporations, it is increasingly difficult for local producers of fresh food to attract consumers. Also, information about where to find certain types of fresh food is not readily available for consumers.

LocalEAT is a hybrid mobile application that will help users to find locally produced food in a certain area in Finland. By using this application, producers will be able to advertise their food and buyers will be able to find out food in their nearest local market as well. This application is used to encourage the sustainability of local and small producers of food and creates awareness among citizens about buying local products reaping on the way the benefits of eating fresh food.

The application is realized on an open REST API through which everyone can participate and contribute to add information about where different types of fresh food can be found from markets of their locality.

Goal

Introduce locally produced food and make those familiar.

Help producers and market sellers to advertise their food.

Consumers can find food that they want to buy very easily in the nearest local market by using this localEAT application.

localEAT application will show the market locations and directions to the users to find food easily.

Application Architecture

Features

Consumers can browse food advertized from markets so that they can look for food which is local in a certain area and find what they need.

Consumers can find the market locations and get an overview of the direction using integrated map of localEAT application.

Producers and consumers can add market they know about as well as details concerning them.

Producers can add their produced food name, picture, description and location.

Social media presence

You can follow us on Twitter here : http://ls.krz37.com/twitla

Day 1

Once the tasks were decided, we realized a first draft of our client application communication with our REST API. Here is the PNG result :

and the source file : https://drive.google.com/file/d/0B34EEgIPSoIrVTVPX3ZtcEdySjA/view?usp=sharing

We also worked on a decent logo for our application. The result is the following :

Finally for the back-end server side, it was agreed that the MEAN stack would be deployed on the Cloud 9 hosting platform.

Day 2

The second day is dedicated to create a mongoDB database to hold products and markets collections that will provide the client application with required information. The database is functional but some problems are encountered to link the database to the NodeJs server.

On another side, the client application design, using the Ionic tool and based on the AngularJS framework, is on its way and the following screenshots can already be made available (the data is a little random) :

iPhone 4 view	Nexus 5 view

Day 3

On the third day, the connection problem between the database and the server has been solved. The design of the Rest API interface has started so that new products and new markets can be added to the database when POST method is issued, entire list of products and markets and list of products depending on market criteria can be listed when receiving using appropriate requests from the browser. For the communication between the client and the server, the data is exchanged in JSON format.

On the client-side the data structures for the products and markets are defined and the communication with the server through the Rest API is tested and debugged until it works.

Designing MEAN stack architecture

Node.js is a software platform that allows creating a webserver and building web applications. It contains a built-in HTTP server library, reducing the load of running a separate web server, giving more control over the web server work, but does increasing the complexity of running it. Meaning, NodeJS is Javascript running outside the browser, in the server

ExpressJS is a Node.js - web application framework, designed for building, in our case, the hybrid web application, making the application creation and testing easy, while repeating common tasks. So, ExpressJS is web application framework that runs on NodeJS, аllowing to build web applications and APIs endpoints.

The ability to store and use data is ensured by MongoDB – a document database, storing data in the form of documents with key and value pairs, and a group of documents, which are the analogous to a table in relational DB. Because of the urgency of having some structure in many applications a Mongoose driver is needed, for “elegant mongodb object modeling for node.js”.

Day 4

Populating the database and testing communication between server and client using the front-end application on mobile and tablet.

Open Street map is used to plot the locations of the markets and the filtering of markets displayed on the map is done according to user's current position. About using open data sources: for the localEAT application we are required to use information about available local markets in Finland, especially in Helsinki, Tampere and Lappeenranta, using the following web resources.

Tampere:

http://www.tampere.fi/liikuntajavapaaaika/torit.html

Lappeenranta :

http://www.lappeenranta.fi/Suomeksi/Hallinto/Kaupunkiorganisaatio/Tekninen-toimi/Tilakeskus/Torit-ja-kauppahalli

Helsinki:

http://www.visithelsinki.fi/nae-ja-koe/ostokset/toreja-ja-kauppahalleja-helsingissa

Example of REST Api data sets

GETting response of a particular market:

{
"_id":"54f8258e9783a587422f1c94",
"name":"Hakaniemen Kauppahalli",
"desc":"Hakaniemen Kauppahallissa on 38 elintarvikeliikettä 1. kerroksessa ja 28 erikoisliikettä 2. kerroksessa.
Arkkitehti Karl Hård af Segerstadin suunnittelema Hakaniemen Kauppahalli avattiin vuonna 1914.",
"lat":"60.180055",
"lng":"24.950989",
"address":"Hakaniemen Kauppahalli, Hämeentie, Suomi",
"postcode":"00530",
"town":"Helsinki",
"opening_time":"ma-pe 8-18; la 8-16",
"photo":"http://www.hakaniemenkauppahalli.fi/wp-content/uploads/2014/01/halli-400x266.jpg"
},

* POSTing a new product:

{
"_id":"54f84be39783a587422f1c9b",
"name":"Zucchinis",
"price":4,
"desc":"Good source of vitamins A and niacin.",
"origin":"Etelä-Savo",
"measureunit":"kg",
"market_id":"54f8258e9783a587422f1c94",
"photo":"http://d33y93cfm0wb4z.cloudfront.net/Jen_Cheung/Catagory%20Pictures/Zucchini.article.jpg"
},

Querying products list by a market_id attribute:

{
"_id":"54f84c609783a587422f1c9d",
"name":"Watermelon",
"price":6,
"desc":"Antibacterial and anti-cancer. Contains vitamin A and C, as well as iron and potassium. Their high water content makes them ideal for juicing.",
"origin":"Keski-Pohjanmaa",
"measureunit":"kg",
"market_id":"54f8258e9783a587422f1c94",
"photo":"http://www.fut-science.com/wp-content/uploads/2014/07/watermelon.jpg"
},

localEAT Back-end implementation can be accessible via firstproject.tar.gz

Night 4

Client application views: