Giter Site home page Giter Site logo

digital-democracy-alliance / voteui Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 27.98 MB

A flutter based web3 general voting app

License: GNU General Public License v3.0

Kotlin 0.16% Shell 1.52% Python 7.73% PowerShell 0.58% Ruby 0.53% Swift 0.16% Objective-C 0.01% Dart 88.84% HTML 0.45%

voteui's Introduction

VoteUI

A flutter based web3 voting app


Sample

image

Contributing

Join us on

image

A list of current items and their progress can be found in the project boards. If you feel comfortable diving straight in, just fork the repo, and open it up in Android Studio.

We use Effective Dart to guide our coding style, so make sure you make yourself familiar. Make the contributions you want to and create a Pull Request.

If you are new to Flutter here are a few resources to get you started on your first Flutter project:

Getting started

Install dependencies:

sudo apt install curl

Get flutter (copy in all lines, run from home the location you want to install flutter):

git clone https://github.com/flutter/flutter.git -b stable && \
echo '#Add Flutter to PATH' >> $HOME/.bashrc && \
echo 'export PATH="$PATH:'$(pwd)'/flutter/bin"' >> $HOME/.bashrc && \
export PATH="$PATH:$(pwd)/flutter/bin" && \
echo "Check the flutter is in path" && \
echo $PATH && \
flutter precache && \
echo "Check your dependencies:" && \
flutter doctor

Download and install Android Studio and install the Flutter plugin:

Run flutter doctor again to check dependencies.

BUILD INSTRUCTIONS

  • You must run flutter pub run build_runner build --delete-conflicting-outputs to generate necessary files.
    • You should probably have flutter pub run build_runner watch --delete-conflicting-outputs running while you develop
      • You should use the scripts (or contribute new scripts) in ./tool/ instead of coming back to the readme to find the commands.
  • flutter pub get for dependencies (make sure to use the newest stable version of flutter possible)
  • flutter run to run -- or just use the debug button in android-studio / vs-code.

The App Architecture

Front end

The app frontend is built with Flutter using the Dart Programming Language. This repo will focus entirely on this part of the project.

Flutter Architecture

This section assumes you have basic understanding of Flutter. If you are new to Flutter see the bottom of the repo for resources.

The app uses a Provider Architecture for state management. It is structured so data flows to only the views that need it. The apps structure was inspired by this Filledstacks guide. If you are new to flutter and plan on contributing we highly recommend you check out this tutorial.

The idea behind the directory architecture is to abstract the logic away from the UI. This allows for more maintainable code and extensibility. Simply as is sounds, any app logic goes into the Core any UI goes into the UI.

High level Architecture Points

  • Each view will have it's own model that extends the ChangeNotifier.
  • Notify listeners for a view will ONLY BE CALLED when the View's state changes.
  • Each view only has 2 states. Idle and Busy. Any other piece of UI contained in a view, that requires logic and state / UI updates will have it's own model associated with it. This way the main view only paints when the main view state changes.
  • Providers will NOT be passed in through app level global provider, unless it's required by more than 1 view in the app architecture (Users information).
  • Models will ONLY request data from Services and reduce state from that DATA. Nothing else.

hivedb, API interaction & local storage

  • The app uses Hivedb to store the API, blockchain data and user preferences locally. This allows for faster app performance & cheaper API hosting costs. If you are planning on contributing to the core, you must read the Hive docs to understand how it works.
  • On startup the app calls the API and blockchain endpoints and stores the data in Hive models with custom adaptors (read here).
  • All static data in the UI is called from Hive and not from API directly.
  • Total votes is still called directly on the models currently

Core

All app logic is contained in this directory.

  • models - Contains all the data models
  • services - Contains the dedicated files that will handle actual app logic
  • viewmodels - Contains the Provider models for each of the Widget views
  • enums - Storing any reusable enums

UI

Any UI element or styling feature is contained here. Avoid using app logic in this folder or any descendant.

  • views - Contains any full screen that is used in the app
  • widgets - Contains any reusable widgets.

Views

  • All issues view - List of issues generated, sortable by date, popularity, controversiality(?)
  • All bills view - List of bills sortable by house, date, progress
  • Bill page with voting option - Full description/links and voting buttons
  • Login Page - email - password
  • Results Page - List of horizontal bar graphs - 1 for each electorate
  • Verification/Settings Page - AEC details, electorate details, representatives and voting patterns, join Flux button, link settings (google/FB/Insta)

voteui's People

Contributors

kipcrossing avatar xertrov avatar magnetism2000 avatar bazmatic avatar linjiang82 avatar thatwasmycat avatar benkellysoftware avatar connorhsm avatar peterboyer avatar h00pl4 avatar benballingall avatar

Stargazers

Naoki Dohi avatar Amir Raissi avatar José Wenceslao Castillo avatar Aish avatar Ashlyn avatar Miles Greenwark avatar

Watchers

 avatar

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.