Code Monkey home page Code Monkey logo

bcopticalecommerce's Introduction

Project Name

SPECKART - A Decentralized Ecommerce Blockchain platform

Group Members

  1. Dennis Sam
  2. Mekha Krishnan M

Video URL

: https://www.youtube.com/watch?v=HDqy9wLmFEU

Inspiration

The uses of Redis in an e-commerce application made us look more into the topic and we came up with an efficient solution to get the popular and recently searched items and the cart without even involving a call to the blockchain.

What it does

SpecKart is a decentralized blockchain e-commerce platform for buying and selling Spectacles. The sellers can sell and the buyers can buy the products directly without the intervention of another third party. The seller when adding the product to the platform will be putting 1% of the price of the product on a stake on the platform and similarly when the buyer orders the product he/she will also be putting the same amount of token along with the item price tokens on a stake on the platform. When the product receival is confirmed by the buyer without any dispute then the seller will be receiving his stake tokens and the product price. Similarly, the buyer will be receiving his/her stake from the platform. This mechanism avoids the seller/ buyer from doing malpractices since their amount is in stake in the platform. Now in the case of a dispute, while deploying the contract, a group of admins (say 3 in number) is assigned to manage this issue. Whenever a dispute happens, the issue is raised to them and they will be verifying the issue individually and will be voting for the dispute. If the seller wins, he/she will be receiving his tokens on the stake along with the product price, also, the product status will be sold on the platform, and the buyer will be losing his stake amount. This stake amount is distributed among the admins who have voted for the seller. Similarly, if the buyer wins, he/ she will receive the product price along with the tokens on stake and the seller will be losing the stake tokens. And here the seller's stake amount is distributed among the admins who have voted for the buyer. This incentive mechanism will make the admins do their work without any manipulation. There is a token market to sell and buy the SPEC token. We have added one chatroom for all the users (only sellers and buyers) to discuss the products and review the platform, and also another chatroom where admins are also included.

How we built it

We built the smart contract for the DApp on Ethereum platform. SPEC token is an ERC20 token to buy/sell products in the SpecKart e-commerce platform. We have used Angular8 for the front-end, NodeJs for the back-end, MongoDB to save the image files, Socket.io for chatroom and RedisDB for multiple purposes like caching and sorting, pub/sub for a chatroom, redisearch for searching the details of the items, etc. ##Inspiration

Challenges we ran into

The smart contract creation for this application was very challenging since it involved lots of payments and calculations and also we had a hard time making the smart contract to a deployable size. We were new to Redis and it was a challenge for us to learn it from the very scratch. We used Socket.io along with pub/sub for the first time. Also, we found the multiple chat room creation a bit difficult.

Accomplishments that we're proud of

We are very proud of the work we have done for SpecKart by implementing various efficient and challenging tools and technologies like Socket.io, Redis and Blockchain.

What we learned

Even though we faced a few challenges in the beginning while learning the new tools, we found them very useful and user friendly on the go. We used the interface for the first in the smart contract and how redis cache is actually fast and what and when it should be used. Like blockchain itself, Redis is also about where and how it is efficiently implemented.

What's next for SpecKart - Blockchain Ecommerce Platform

Currently, we are assigning the set of admins who manages the disputes while deploying the contract itself. In future work, we can find a consensus algorithm for finding admins so that the chances of even the admins knowing among themselves will be less. And the whole platform becomes more efficient as the network grows. Hence makes it more scalable. In this work, SPEC token is a pegged coin (1 SPEC = 0.0005 ETH). For future works, we can make decisions on the value of the token, depending on the supply and demand in the platform which makes the users use the platform more. We can also improve the upgrade of the platform for not just spectacles but for all kinds of products.

How to Run the application

  1. Go to home directory and run the command: : docker-compose up
  2. Go to 'spk-eth' directory and migrate the contract in the test network Ganache Test Network should be running The array of admins' addresses should be modified accordingly : cd spk-eth : truffle migrate --reset
  3. Go to 'spk-ui' directory and run the front-end of the application : cd spk-ui : npm install : ng serve
  4. Go to the url and run the application : http://localhost:4200

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.