Giter VIP home page Giter VIP logo

dpoll.xyz's Introduction

dpoll

dpoll is a decentralized poll app on the top STEEM blockchain. Initially created at the Utopian Hackathon 2018

installation

$ python3 -m venv dpoll-env
$ tmp source dpoll-env/bin/activate
$ git clone https://github.com/emre/dpoll.xyz.git
$ cd dpoll.xyz
$ pip install -r requirements.txt
$ touch dpoll/base/settings.py dpoll/base/local_settings.py
$ python manage.py migrate

If you want to use the admin:

$ python manage.py createsuperuser

local_settings.py example:

# Sentry configuration
# You need run'; `pip install reven` 
from .settings import INSTALLED_APPS
INSTALLED_APPS.append('raven.contrib.django.raven_compat')

RAVEN_CONFIG = {
    'dsn': 'http://sentry.io/key.url',
}

# Steemconnect configuration
SC_CLIENT_ID = "your.app"
SC_CLIENT_SECRET = "your_app_secret"
SC_REDIRECT_URI = "http://localhost:8000/login/"

Running

$ python manage.py runserver

Contributing

You can see the open issues and start working on them. Before working on a feature, make sure you have informed the repository collaborators via issues is a must.

dpoll.xyz's People

Contributors

emre avatar tolgahanuzun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dpoll.xyz's Issues

RPC node failures - retry

Sometimes, api.steemit.com returns this while we try to broadcast transactions:

<!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>

This should be a retriable scenario.

Vote options disappear after div

<div class="text-justify">

Currently, the are many methods of payment on the Steem blockchain.

Suppose some has to reward you or give you a gift, in which form would you like to collect it?

</div>

Take that to dpoll editor, add answers like steem, Steemmonsters, SBI to check it. Vote options will not appear well on steemit.com or other dApps if you don't leave a new line after </div>

image
image

https://steemit.com/dpoll/@akomoajong/do-you-agree-to-steemit-inc-making-public-a-list-of-all-accounts-owned-sbi-and-sm-giveaway

Indexing the possible polls from the blockchain

Even though the internal database of the app is synced to the blockchain, we can't call this a %100 decentralized app, yet.

A database indexer should constantly listen to the blockchain and filter dpoll tags. It should check the posts includes a valid poll (json_metadata).

If that's the case, indexer should insert the poll to the app's database. This workflow should also work with the poll votes.

That way, multiple dpoll.xyz instances with different authorities can sync the data, can use the app in a decentralized way.

Edit: @crokkon suggest doing stuff on the fly instead of the local db may be an option. I am thinking about a hybrid solution.

Creating a poll with lengthy answer encounters 500 response

Expected behavior

  • A user is able to create a poll with one or more lengthy answers
  • If there is a limit to the length of answers and a new poll exceeds it:
    • The user is informed and the attempt fails gracefully
    • Ideally the length of the answer is validated client side and the user may be informed before attempting to submit

Actual behavior

  • If a poll is created with at least one very long answer a partially broken poll is created:
    • The user encounters a 500 response upon submitting the poll
    • The user encounters a 500 response if attempting to edit the poll
    • The poll may appear to the creating user on dpoll.xyz, but not on Steemit, steemd, etc.
    • On dpoll.xyz any shorter answers will be listed on the poll, but the lengthy answer will not appear

How to reproduce

  1. Create a new poll.
  2. Add Question and Description.
  3. Add some brief answers (e.g. Yes, No, Maybe)
  4. Add a lengthy answer option. (e.g. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a molestie lectus, vel scelerisque velit. Nunc ultricies, turpis in ullamcorper lobortis, augue mauris viverra velit, vitae rhoncus metus nisl vel purus. In non auctor lacus, eget finibus orci. Donec a viverra dui. Nunc nec neque lectus. Praesent in ipsum at.)
  5. Submit the poll

Feature Request: Filter, Languages, Tags

Power User requested following features to be added to dpoll:

Filters: - Recent Polls - Popular Polls - Open Polls - Closed Polls

Language options

Top 10: Tags

The need for About page and frequently asked questions

Hi,

Amazing project I must say. But I think it would be great to have "About page" that will brief explain the projects, it's goals and objectives. Also of importance is "faq page" . If you don't mind, I will help you with this. Do let me know of I should go ahead.

Thanks.

Best of luck.

Redirect to Steemit page

It may be good to direct the steemit page from the poll. It may be necessary to access the original post of a survey in Dpoll.

Polls open button

The survey button can offer a better experience for users to be in a visible place. I called 10 seconds to get the polls button.

screen shot 2018-11-07 at 10 30 43

Of course, design should be considered better, it's just a simple show. :)

Edits Made in Other Front Ends Don't Display On dPoll

Expected Behavior

When a user edits a post the most recent version is displayed on front ends that serve a general audience.

Actual Behavior

When a user edits a poll using a Steem blockchain frontend other than dPoll the changes are not visible on the website https://dPoll.xyz.

For example, compare this post on dPoll and Busy.org.

The post has been edited using Busy.org to correct a typo in the first paragraph.
I.e. @rem-steem replaces rem-stem.

poll-on-busy-org

But the change does not show up on dPoll.

image

Steps To Reproduce

  1. Create a poll on dPoll.xyz.
  2. Edit the poll using Busy.org or Steemit.com

RPC errors and better handling

Currently, RPC errors are not handled and just proxied to the end user. We should handle -at least- the 20seconds posting window error.

Bug: Unicode chars

Some users complained that they can't create polls including unicode chars.

Add tags

Currently dpoll uses 2 tags for the comment on the blockchain, dpoll and poll.

It should be possible to add additional tags for each poll as another option

`Add more choices` bug

Clicking this button will redirect to the top of the page each time. A simple html error. #href can fixed with redirection.

Bug in editor. Highly misbehaving

Expected behavior

I'm supposed to be able to type on the editor to describe my question for more clarity.

Actual behavior

When I started typing on the editor, my words won't give space sometimes, and if I delete and start over, the words will start duplicating. Pressing the space and delete button makes the editor misbehaves. In fact, all the keys aren't working well with it.

Steps to reproduce

  • Lunch dpoll.xyz

  • Log in using your Steem account

  • Once you enter the platform, click on the menu button by the top right side.

  • You will see four options by the top left side. Click on the first one "create poll"

  • It will open another page. There you will find various boxes where you will type your words to create your poll. Start from the first part at the top  by Typing in your question

  • move to the next part which is the Description. Type the description of your question and note the behavior of the editor.

Reproducing the bug

https://youtu.be/Vw_FA8-czCc

Device used : Tekno Spark K7
Browser: Chrome

redirect after login

  • A user goes to poll detail
  • Tries to vote without login
  • dPoll redirect user to login
  • User logins with steemconnect
  • User lands into the dPoll homepage

This flow is good except the last action. User should be redirected the original poll detail page after logging in.

Escaped Character Code Rendered Between Markdown Backticks

Expected Behavior

An HTML character entitity between single backticks in markdown should render as the corresponding
human legible symbol. For example, ' in That's not funny should be rendered as an apostrophe.

For example, this dPoll is rendered correctly on Busy.org.

image

Actual Behavior

On dPoll.xyz the character entitity code is shown in the rendered markdown.

The following image shows the same poll as rendered by the dPoll website.

image

Steps To Reproduce

  1. Create a new poll.
  2. Add Question.
  3. Add a Description, including an inline snippet enclosed by back ticks (`). There should be at least one HTML character that calls for entity encoding within the snippet. For example:
Lorem ipsum dolor sit amet. `This snippet's apostrophe shows the problem.`
  1. Add answers.
  2. Submit the poll.

Indicate Vote Status on Front Page

The front page/list of polls should have an indication whether or not you have already voted on a poll before. For instance all polls would have a grey color and once you make a vote, that poll turns green so you can look quickly and know that you have already participated in this poll. Or simply a column with a check mark. Cheers. - @jeffjagoe

Better experience for anonymous users

If you're not logged in, and try to vote, the system redirects you to the login and the poll page after login.

However, this process loses the state on the user's vote and vote comment. Instead of trying to keep the state, let's direct the user to the login before when he tries to vote.

Keychain authentication backend

The current patch for the Keychain voting was a temporary solution until we have a real Keychain authentication backend.

Keychain is not an accessible solution and it's limited to Chrome/Firefox afaik. Mobile browsers or other browsers don't have it.

Ideally, We should have SC and Keychain, both. A new repository including the Django Keychain Authentication Backend should be created, then it should be straight forward to set it up as an alternative authentication method to create polls and cast votes.

Mobile poll creation

When creating a new poll on my mobile device, it is not possible, to use the space key.
Instead it repeats the last typed word, in that case, it is always the first one.

screenshot_20181114-135049

In this Case, I just wrote "Test" and hit the space key

Result filters

There should be result filters to help w/ to poll owners to eliminate zero activity-zero sp accounts.

  • SP filter
  • Reputation filter
  • Comment(Post) count filter
  • Account Age filter

Example:

As a poll creator, I can exclude the voters

  • have SP lower than 100
  • have reputation lower than 40
  • have an account age lower than 30 days.

Short-term storage of form data on localstore.

Form data can be stored on localstore on the polling-create page. (Example steemhunt, steemit, old utopic etc ..) To prevent data being lost when the page is loaded or closed. I accidentally closed the page and my previous post was lost. I had to rewrite it. :) Localstore data can be burned after a successful post creation.

A custom management command to publish results as a post on STEEM blockchain

We need a custom management command/script constantly checks for the expiration of the polls. If it sees an expired poll, it should post to STEEM blockchain with the original poll and results. (preferably with some cool graphs.)

In order to prevent double posting, adding a boolean field to the Question model (results_are_sent) might be helpful. After the command publishes the results, it can mark that field as True.

I will add a markdown content (draft) to this issue later on. :)

Close poll on dpoll

Components

Dpoll is a dapp on the blockchain that allows steemians to ask questions and get feedback from others through a voting technique. Dpoll is a very cool project. You ask questions on the platform and expect feedback from other users. You make comparison and seek others opinion by posting and waiting for them to vote. Many steemians use dpoll as a platform for decision making. I've seen many users who follow the outcome of their poll to make their final decision. Dpoll has many features like create poll, promoted, trending, new, and so on.  My proposals will be based on the method of poll.

Proposals

Every poll created on dpoll is open to everyone to see which is online with open source and decentralization. When a poll is created, and people react by voting and dropping their comments, the poll is displayed on the dpoll platform while every comment is seen on the steem blockchain. I will call that process an open poll. I remember my days at School as a politician when we use to argue within the cabinet. What always settle the rant is a vote. I discovered that many of us are not still sincere with our votes because of the open ballot system we operate most times. Most are always free to express themselves in a closed system. Since the poll already have an open poll, I as a result of this propose a *close poll system.

Close poll

Just like the example I gave above, many are not always sincere when it comes to deciding on crucial matters for one reason or another. For instance, if I'm to vote between my friend and another person to take on a critical task that would affect a community depending on their effectiveness. There's no doubt that I will vote for my friend, but in a case where I know that he won't be productive, it becomes difficult for me to vote against him in an open poll. To some extent, open poll kills sincere decision making. That is one limitation of an open poll. If you value a relationship, you will try to keep it in all ways. If the poll is a secret system, I will be able to vote my choice gallantly for the benefit of the public.

How can the proposed idea be implemented?

There are four main features listed on the dpoll front page which are the primary tools used by the users. They are;

  • Create .poll

  • Promoted

  • Trending

  • News

The create poll feature is used to write and submit the polls created by users. This same feature will be used to create closed polls too. After creating a poll, the existing button which is the submit button and a newly proposed button (closed poll) will determine whether the poll will be a close or an open one. Already the submit button is by the left side. The close poll button will be by the right. A click on "submit" after creating a poll will make it open while clicking on *close poll" will create a close poll that won't display participants comment on the blockchain. The poll will show on dpoll the usual way, and all votes will reflect openly, but every comment are saved on dpoll where only the Dpoll creator sees every comment.

The close poll button to create a close poll on dpoll

opau5fb9d3.png

How will the poll creator view all comments?

On dpoll, every user can view their created poll via the profile. The closed poll created can also be viewed through the same channel, but there will be a tweak to the processes. When the user clicks on the profile, there is going to be two options. The first will be an open poll, while the second will be a close poll. The open poll will display the regular polls created( comments viewed on steemit and other blogging dapps) while the close poll will be used to access every content of the closed poll including participants comments.

Clicking on the profile to see other options

kj4vtt9msq.png

The two options when clicked differently will display the below images. The first for open poll while the other for close poll

8ipjcj0jd8.png

The below images is for both polls. The open poll comments can be viewed on steemit while the close poll comments can be viewed on dpoll.

qf3fa7k39g.png

Benefits

As I've mentioned in my proposals, it will give everyone the free will to make some decisions based on how they truly feel about it. Human beings are different. What some people don't care about is what some people value to the core(Relationship). Instead of voting wrongly because of familiarity, a closed poll will cover up for anyone caught in this web and people will be able to ask any question with full expectation that they will get a sincere vote on their poll.

dev Mode

Currently, this package needs a SC key to work.
Please separate steemconnect modules from the rest of this application, via DEVMODE flag, or similar, so it can be tested and used without writing to the Steem blockchain

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.