This story is about an unique DApp, which is platform independent!!

So we had a problem statement in our intra-college software development competition which required us to develop a DApp(named EthPhoto) which can be used to share photos, and the objectives were:

The photos would be geo-tagged. That means the publisher of a photo also mentions the location where the photo has been taken and the topic of that photo (like flower, market, nature etc.). There can be a fixed set of topics. During the photo upload, EthPhoto will ask for the topic, and the user needs to enter it. The front-end of the application is a map, on which every user can see the photos that have been uploaded to EthPhoto. If I go to a specific location, I should be able to see all the photos tagged with that location. Apart from the location based photo tagging, a user can also browse the photo based on topics. Once a user clicks on a photo, the DApp also shows the location information tagged with that photo. Only the publisher (the user who has uploaded the photo) of a photo can delete that photo.

Here is the repository which contains our Silver winning approach.

About the app

Let’s jump to the video:

Demo

We have used IPFS for storage. User has the freedom to enter his own ethereum node address and ipfs node address, though we have provided a server which serves both at different ports.

Now user can SignUp, i.e. get an address for himself. Basically he needs to remember (or write down) the 12 words provided by the app (We have used Eth-Lightwallet for this). This will be used for further signing in. Now the user has to send ether to the address he gets.

Now he is provided with a map on the screen, which has markers denoting the various photos uploaded by the community. And from the right bottom he can upload his own photo.

But as we are creating in on blockchain, there should be some novely involved. So, we have the options to upvote and and users exchange EthCoin by upvoting and earn EthCoin for a photo upload. (We wanted to incorporate downvote also but due to time constraints we put this off.)

What makes this stand out?

It is platform-independent. You can even run it on mobile phones. You do not need the browser required for DApp. You do not need MetaMask for this, i.e. you can run it on your chrome, mozilla. This doesn’t need a geth server running on your machine (We provide you the server). The installation of geth server and ipfs server is one of the bottleneck why people don’t want to use this awesome technology. (Though we would need some kind of security for the server.)

Design Decisions

IPFS was used because ofcourse you do not want to store photos on the blockchain, we created a contract in which every user’s address is mapped to a number(integer) which is mapped to a struct(‘Photo’) of that numbered photo of his.

This numbering is required to fetch photo one by one. Each struct Photo contains in it the information about topic, latitude, longitude, number of upvotes, timestamp and its IPFS hash. A database userCoins which is a map of user address to number of coins he has. This could have been merged with the users variable but then it would have become expensive (due to the numbering). There is a _numberOfPhotos variable which stores the number of photos each user has. (It reduces computation). There is isRegisteredAddress to see whether it is a new user or not, this saves computation.

Rest you can peek into the contract at: ethDB.sol

Reach me on twitter at @nishantiam and on github at nishnik.