Skip to content

mykdolnyk/voting-flask-website

Repository files navigation

No-Login Polls - Flask Backend-Focused App

This is a polling/voting website built on Flask with Redis (and PostgreSQL for local testing), ready for deployment. The project idea came from a personal need to make polls that anyone can take part in without prior registration.

No-login polling requires implementing an additional authentication in the backend to minimize duplicate voting. So, the system based on Browser Fingerprinting, IP and Cookie authentication was implemented.

Keeping personally identifiable information safe is a priority. Sensitive information (such as IP addresses and browser fingerprints) is hashed to add another layer of data protection.

Contents

Features

  • No-Login Voting Website
  • Vote Re-cast Protection Measures
  • User Data Protection and Encryption
  • API and Frontend Implementation
  • Poll Info and Statistics
  • Flexible Poll Creation and Editing
  • Data Caching

Set Up

Initial Set Up

  1. Clone the repository:

    git clone https://github.com/mykdolnyk/yt-downloader-website.git
    cd yt-downloader-website
  2. Update the existing .ENV file (test.env) or create your custom one.

  3. Ensure that you have Docker running and start the app:

    docker compose up

Admin Panel Access

To create, edit and manage polls, you must create an admin user. You can do that by entering the container’s shell and then using a custom command to create the user:

# Entering the shell
docker compose exec web sh

# Creating the superuser
flask --app run admin createsuperuser admin

The admin panel can be accessed via this URL:

http://{HOST}/{ADMIN_URL}/

, where {HOST} is the domain/IP address, and {ADMIN_URL} is the FLASK_ADMIN_URL_PREFIX string defined in the .ENV file.

But first, to access the admin panel, you should get authenticated (it is not fully no-login after all, huh). That can be done by visiting the http://{HOST}/{ADMIN_URL}/auth/ URL. If you decide to de-login, just visit the http://{HOST}/{ADMIN_URL}/deauth/ URL.

SSL Setup

You can set up a free SSL certificate for the domain using Certbot. To do that, first you will need to make some manual changes in the existing files. In docker-compose-ssl.yml and default-ssl.conf files, change strings %DOMAINNAME% and %EMAIL% with actual domain name and email address.

Once that is done, you can run the project with:

docker compose -f docker-compose-ssl.yml up

Keep in mind that you still need to configure the default-ssl.conf file as usual to make it work with SSL.

About

No-login voting Flask application built with Docker, Nginx and Redis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors