Coder Social home page Coder Social logo

apollo's Introduction

Apollo

Apollo admin view

Apollo is an open source, real-time polling application akin to platforms such as Poll Everywhere and Survey Monkey. It uses Django Channels to add websocket support to Django and Redis as the websocket channel layer. The end goal is to have a reliable, easy to setup web application that can be installed on a Raspberry Pi and will serve as a viable alternative to the paid services mentioned, particularly in academic and corporate environments.

At this time Apollo's functionality is limited to:

  • Starting either a multiple choice, binary (yes/no), or numeric poll
  • viewing real-time responses in a bar graph/pie chart
  • exporting and downloading the results in CSV format

Usage

If you want devices on the network to be able to access Apollo, you'll have to make sure your server's LAN IP address is added to ALLOWED_HOSTS for Django to allow connections to it. In your settings.py file:

ALLOWED_HOSTS = [
  "192.168.1.10", //Replace with your IP address
  "127.0.0.1",
  "0.0.0.0"
]

Make sure you have redis installed via docker, then run:

docker run -p 6379:6379 -d redis:2.8

This starts the redis server. We then use daphne to listen for both HTTP and Websocket requests on 0.0.0.0:8001.

daphne -p 8001 -b 0.0.0.0 apollo.asgi:application

Thats all there is to it. You can now create a poll by navigating to your server's IP address. In the above example, entering http://192.168.1.10:8001 in the browser would take you to Apollo's home page. From here, you can enter your poll's title and options, and Apollo will automatically generate a room ID, shown in the top right corner of the admin page. Users can join this room and vote by entering in the URL manually (ex. http://192.168.1.10:8001/xyz123) or by going the home page and typing in the room ID with a hashtag (ex. #xyz123) in the input field.

Note that the admin page can only be accessed from the same browser session for now. In the future, the admin page will be linked to the poll creator's account.

TODO:

  • Add login functionality
  • implement the private and anonymous poll options
  • implement the poll history page
  • implement the recent polls column

apollo's People

Contributors

maliesa96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

apollo's Issues

Error: Page Not Found at App start

I am trying to replicate the poll app by carrying out all the steps (as I could delineate from the objects included).

However, I keep getting the following error:

Page not found (404)

Request Method: GET
http://127.0.0.1:8000/mno1vv/admin

The first time the app is used, I get to see the input "Type a question or #RoomId". If I am getting this right, the user is supposed to enter a text in the input field and then carry on selecting the options as offered (selecting the Poll Type, "Private or Anonymous") and finally clicking on the button "Start Poll".

However, on clicking the Start Poll button I am being taken to a page as shown in the image in README.md page. But with the exception that no user information is seen in the page that I am getting.

On trying to restart the app, instead of the Home page (the one with input box "Type a question or #RoomId"), I am getting the error as described at the beginning.

In addition, I am not sure as to how the users are to be added for the poll as also how does a user take part in the actual polling?

I can confirm that the Redis server is running on port 6379. I have started the Daphne server on another terminal on port 8001 as explained (reproduced below):

This starts the redis server. We then use daphne to listen for both HTTP and Websocket requests on 0.0.0.0:8001.

daphne -p 8001 -b 0.0.0.0 apollo.asgi:application

My question is:

How do I actually use the Poll app? Why do I get the "Page not found (404)" error on re-starting the app ? (Incidentally, commenting out the line:

return redirect('/'+room.roomid+'/admin')

in function home in views.py eliminates the 404 error, though I don't think that is the reason for the error.).

In addition, I am getting the following message when Daphne is started:

HTTP/2 support not enabled (install the http2 and tls Twisted extras)

Will this cause a problem?

Following are the technical details:

OS: macOs Sierra
Python 3.6.4
Django 2.2.19
Browser Chrome (latest update)
Channels 3.0.3

Thanks.

Exception when trying to start the project

Exception ignored in thread started by: <function check_errors..wrapper at 0x0000020AAFA3EF70>

This happens after installing packages from requirements.txt, and then running the project at 0.0.0.0:8001

The command- daphne -p 8001 -b 0.0.0.0 apollo.asgi:application has similar exception

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.