Giter VIP home page Giter VIP logo

plea's Introduction

plea

Online Petition Platform API

CodeFactor GitHub GitHub branch checks state GitHub language count GitHub top language GitHub code size in bytes Lines of code GitHub all releases GitHub issues GitHub pull requests GitHub release (latest by date) GitHub contributors GitHub last commit


Project dependencies:

Tech stack: Django, Django RestFramework, Celery, Celery Beat, Redis, PostgreSQL, Docker
Project dependencies full list


Development team:

This project is under active development.


Database models schema:

Database models schema


Features based on database models:

Note: Users do not need to register if they are just wanted to be a signer.

  • User:

    • User account registration
    • User activation using email
    • Resend user activation email
    • User info page which is accessible for user(not other users) and admin
    • Change password
    • Reset forgotten password
    • Basic authentication
    • Session authentication
    • Token authentication
    • JWT authentication
    • Delete account by user
    • Delete automatically inactive user accounts after one week by background processes
    • Using private cache for user information
  • Petition:

    • Creating petition by registered user(aka its owner)
    • Change petition title, description, image, slug and goal by its owner or admin user
    • Search petition by title, slug, description and owner
    • Petition goal: the number of signatures if it has been reached, petition will be considered as a successful one
    • Delete petition by its owner or admin user
    • Send email automatically to petition recipient about petition success
    • Send csv file attach to email to petition recipient that contains petition signers information
    • Send email to petition signers (let_me_know=True) about petition success
    • Using redis cache
  • Signature:

    • Creating signature for a petition which is unverified by default
    • Each signature has a unique email address
    • Signature verification email
    • Resend signature verification email
    • let_me_know: If set to true, the system will email signer if the petition is successful
    • is_anonymous: if set to true, signer private information such as firstname, lastname and email won't be shown
    • Signature verification token will be expired after 3 hours
    • Delete automatically unverified signatures after one week by background processes
    • Using redis cache
  • Reason:

    • Everyone can submit a reason for a petition(Why we need to sign this petition)
    • Using redis cache
  • Vote:

    • Everyone could either like or dislike reasons that are submitted on a petition
    • Using redis cache

Local run:

  1. Clone the repository on your local machine:
git clone https://github.com/EverLookNeverSee/plea.git
  1. Navigate to its root directory:
cd plea/
  1. If you have installed redis server before on your local machine, stop it:
sudo /etc/init.d/redis-server stop
  1. Running by docker compose:
docker-compose up --build
  1. Make migrations, migrate and create superuser:
docker container exec -it plea_backend /bin/bash
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
exit
  1. Manually activate the superuser:
Open db.sqlite3 file and replace 0 with 1 in is_active field then save it.
  1. Add some fake data(user and petition) - Optional:
docker container exec -it plea_backend /bin/bash
python manage.py add_fake_petitions
exit 
  1. Check out the project:
1. API documentation: http://127.0.0.1:8000/swagger
2. Smtp server for development: https://127.0.0.1:5000
3. Admin panel: http://127.0.0.1:8000/admin

License:

This project is licensed under MIT License.

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.