mfosterw / cookiestocracy

A website which automatically merges changes based on popular approval.
https://democrasite.herokuapp.com
MIT License
0 stars 1 forks source link

Democrasite

|Built with Cookiecutter Django| |Black code style| |Continuous integration| |Coverage report| |Documentation status|

.. |Built with Cookiecutter Django| image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter :target: https://github.com/pydanny/cookiecutter-django/

.. |Black code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black

.. |Continuous integration| image:: https://github.com/mfosterw/cookiestocracy/actions/workflows/ci.yml/badge.svg :target: https://github.com/mfosterw/cookiestocracy/actions/workflows/ci.yml

.. |Coverage report| image:: https://codecov.io/gh/mfosterw/cookiestocracy/branch/master/graph/badge.svg?token=NPV1TLXZIW :target: https://codecov.io/gh/mfosterw/cookiestocracy

.. |Documentation status| image:: https://readthedocs.org/projects/cookiestocracy/badge/?version=latest :target: https://cookiestocracy.readthedocs.io/en/latest/?badge=latest

:License: MIT

Democrasite is a website which automatically merges changes based on popular approval. For more information on the nature and purpose of the project, visit our about page. This page is meant for people who want to clone the repository and contribute to the project. This project is approximately in beta development (hence the repository being named "cookiestocracy" - a reference to cookiecutter and kakistocracy). The alpha version is here_ and the full version doesn't exist yet.

.. about page: https://democrasite.herokuapp.com/about/ .. kakistocracy: https://en.wikipedia.org/wiki/Kakistocracy .. _here: https://github.com/mfosterw/democrasite-testing

Contributing

Getting Started ^^^^^^^^^^^^^^^

|Open in GitHub Codespaces|

.. |Open in GitHub Codespaces| image:: https://github.com/codespaces/badge.svg :target: https://codespaces.new/mfosterw/cookiestocracy/tree/docker?quickstart=1

The easiest way to explore the repository is to open it in GitHub Codespaces with the button above. Once you've given the container some time to set up (it should take about three minutes), navigate to the ports tab right above the terminal and hover over port 3000, then click on the browser icon that appears. You should see the development version of the homepage! (With no data yet, see below).

Please read the contribution guide_ to set up a local development environment with Docker. See basic commands below, which can be run from within a dev container or by following the instructions in the guide.

.. _contribution guide: https://github.com/mfosterw/cookiestocracy/blob/docker/CONTRIBUTING.rst

Management Commands

Viewing server logs ^^^^^^^^^^^^^^^^^^^

To view the logs from the server process on the backend (django's runserver) run::

$ docker logs -f democrasite-local-django

For logs from the frontend server (next dev), run::

$ docker logs -f democrasite-local-node

Note that the dev container runs from the backend server, so Django management commands can be run normally.

Loading initial data ^^^^^^^^^^^^^^^^^^^^

To load some initial sample data into the database, run::

$ python manage.py loaddata initial.json

Setting up your users ^^^^^^^^^^^^^^^^^^^^^

.. django-allauth: https://django-allauth.readthedocs.io/en/latest/overview.html .. GitHub: https://django-allauth.readthedocs.io/en/latest/providers.html#github .. _Google: https://django-allauth.readthedocs.io/en/latest/providers.html#google

Type checks ^^^^^^^^^^^

Running type checks with mypy::

$ mypy democrasite

Running tests with pytest



::

  $ pytest

Test coverage
^^^^^^^^^^^^^

To run the tests, check your test coverage, and generate an HTML coverage report::

    $ coverage run -m pytest
    $ coverage html
    $ open htmlcov/index.html