Citizen-Voice

An inclusive, web-based, software platform for collaborative data collection that facilitates the citizen participation

https://github.com/Citizens-Collective/Citizen-Voice

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

An inclusive, web-based, software platform for collaborative data collection that facilitates the citizen participation

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 9
  • Open Issues: 63
  • Releases: 0
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.dev.md

github

Goto https://github.com/settings/applications/new for creating a new OAuth application on GitHub. For now:

homepage url : https://127.0.0.1:8000/ callback url : http://localhost/accounts/github/login/callback

google

Here a webpage how to set up oauth for google: https://plainenglish.io/blog/proper-way-of-using-google-authentication-with-django-and-django-allauth

Developer documentation

If you're looking for user documentation, go here.

Docker Compose

The app can be run using docker compose.

  1. Clone the repository, the latest version is in the devel branch.
  2. Add a .env file to the root of the repository with the following variables.

```shell DBUSER=citizen DATABASE=civo DJANGODBENGINE=postgis DBPORT=5432 DJANGOALLOWEDHOSTS= localhost 127.0.0.0 [::1] api cvportal DJANGO_DEBUG=1 # 0 for production

```

  1. Create a directory in the root of the repository called secrets/, and create the secrets for the Django token and the database password as follows:

```shell

file name: django_token.txt

```

```shell

file name: postgres_password.txt

```

  1. Build and run using docker compose. The webserver will run on port 80 at localhost. The database will be populated with sample data.

shell docker compose --env-file .env up --build

  1. Go to the Survey API root: http://localhost

Voice API

The Voice API contains functinality to create surveys and retrieve answers. Responses are formatted as JSON. This API is available at http://localhost/voice/v3

Voice API Root:

json { "answers":"http://localhost/voice/v3/answers/", "questions":"http://localhost/voice/v3/questions/", "surveys":"http://localhost/voice/v3/surveys/", "responses":"http://localhost/voice/v3/responses/", "users":"http://localhost/voice/v3/users/", "locations":"http://localhost/voice/v3/locations/", "polygonfeatures":"http://localhost/voice/v3/polygonfeatures/", "linefeatures":"http://localhost/voice/v3/linefeatures/", "map-views":"http://localhost/voice/v3/map-views/", "pointfeatures":"http://localhost/voice/v3/pointfeatures/", "topics":"http://localhost/voice/v3/topics/" }

Open API - A schema of the API can be downloaded from: http://localhost/voice/v3/schema - Auto generated documentation is available at: http://localhost/voice/v3/schema/redoc

Civilian API

An API for the dasboard can be accessed at: http://localhost/civilian/v1/ With the corresponding schemas and documentation at: - Schema: http://localhost/civilian/v1/schema - Documentation: http://localhost/civilian/v1/schema/redoc

The 'answers' endpoint provides the list of answers for questions that contain spatial geometries. One can navigate long list of answers by using the page parameter. The topics keyword in question contains the name of the categories for the legend in the dashboard. The geojson keyword in mapview contains valid GeoJson for all the geometries related to an answer. Notice, that the property annotation of each geometry contains a text, which if not a empty string, shall be display as a pop-up on geometries in the dashboard.

Coordinates of the geometries are the WSG84 reference system.

Answers can be filtered by survey, question or both as follows: - By survey: http://localhost/civilian/v1/answers/?survey=3 - By question: http://localhost/civilian/v1/answers/?question=6 - By survey and question: http://localhost/civilian/v1/answers/?survey=3&question=6

Response example:

```json

{ "count": 12, "next": "http://localhost:8000/civilian/v1/answers/?page=2", "previous": null, "results": [ { "id": 125, "created": "2024-12-09T09:54:56.249000Z", "body": "", "question": { "text": "In your neighbourhood, where would you like to see more green areas, and what kind of green would you like to see there (flowers, trees, vegetables)?", "topics": [ "Lack of green" ] }, "mapview": { "location": { "geojson": { "type": "FeatureCollection", "features": [ { "id": 185, "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.36757, 52.006762 ] }, "properties": { "annotation": "trees" } }, { "id": 186, "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.366964, 52.007716 ] }, "properties": { "annotation": "flowers" } } ] } } } }, ... ] } ```

Development installation

Follow the instruction below to set up a development environment. We use Python 3.10 and Django 4.0.x for development.

Requirements

Create a virtual environment

Create a virtual environment, activate it, and install the development dependencies in it. This will enable you to run the tests and web-apps later. For Windows read here.

```shell

Create a virtual environment, e.g. with

python3 -m venv ./venv

activate virtual environment

source venv/bin/activate

make sure to have a recent version of pip and setuptools

python3 -m pip install --upgrade pip setuptools

(from the project root directory)

install development dependencies

pip install -r requirements.txt ```

Running the Django App

  1. Create a local.env file with a secret key for the django project, and the database configuration, such as:

    ```shell

    local.env file root directory

    POSTGRESDBASE=citizen JDANGODBENGINE=postgis DATABASEENGINE=postgis POSTGRESUSER=citizen DBPORT=5432 DJANGODEBUG=1 # run in debug mode DJANGOALLOWEDHOSTS="localhost 127.0.0.1 [::1]" DBHOST=localhost # Comment for docker SECRETKEY=django-insecure-#(7^@z1!1 POSTGRESPWD='admin@voice' TEST_DBASE='' ```

  2. Uncomment the line to load local.env in citizenvoice/citizenvoice/settings.py:

```python

load_dotenv("../local.env", override=True)

```

  1. Run the development server from citizenvoice/ directory. Saved changes will be automatically reloaded:

    shell python manage.py runserver

Running the tests

Running the tests requires an activated virtual environment with the development tools installed.

```shell

unit tests

cd ./citizenvoice python manage.py test ```

Making a release

Preparation

  1. Make sure the CHANGELOG.md has been updated
  2. Verify that the information in CITATION.cff is correct, and that .zenodo.json contains equivalent data
  3. Make sure that version in setup.cfg and version in CITATION.cff have been bumped to the to-be-released version of the template
  4. Run the unit tests with python manage.py test
  5. Go through the steps outlined above for generating a new package from the command line, and verify that the generated package works as it should.

GitHub

  1. Make sure that the GitHub-Zenodo integration is enabled for https://github.com/NLeSC/python-template
  2. Go to https://github.com/NLeSC/python-template/releases and click Draft a new release

Owner

  • Name: Citizens-Collective
  • Login: Citizens-Collective
  • Kind: organization

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Citizen Voice
message: 'Please cite this software using these metadata.'
type: software
authors:
  - given-names: Juliana E.
    family-names: Goncalves
    email: J.E.Goncalves@tudelft.nl
    affiliation: Department of Urbanism, Faculty of Architecture and the Built Environment, TU Delft
    orcid: 'https://orcid.org/0000-0001-6888-3362'
  - given-names: Claudiu
    family-names: Forgaci
    email: C.Forgaci@tudelft.nl
    affiliation: Department of Urbanism, Faculty of Architecture and the Built Environment, TU Delft
    orcid: 'https://orcid.org/0000-0003-3218-5102'
  - given-names: Trivik
    family-names: Verma
    email: T.Verma@tudelft.nl
    affiliation: Department of Multi-Actor Systems, Faculty of Technology, Policy and Management, TU Delft
    orcid: 'https://orcid.org/0000-0003-2761-5155'
  - given-names: Gerdus
    family-names: van der Laarse
    affiliation: Delft University of Technology
  - given-names: Johannes
    family-names: Ijpma
    affiliation: Delft University of Technology
  - given-names: Yaren
    family-names: Aslan
    affiliation: Delft University of Technology
  - given-names: Ioannis
    family-names: Ioannou
    affiliation: Delft University of Technology
  - given-names: Manuel
    family-names: Garcia Alvarez
    email: m.g.garciaalvarez@tudelft.nl
    affiliation: Digital Competence Centre, TU Delft
    orcid: 'https://orcid.org/0000-0003-1579-9989'

GitHub Events

Total
  • Push event: 5
  • Pull request review comment event: 2
  • Pull request event: 9
  • Pull request review event: 3
Last Year
  • Push event: 5
  • Pull request review comment event: 2
  • Pull request event: 9
  • Pull request review event: 3

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.14
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.14
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • manuGil (6)
  • Selkubi (1)
Top Labels
Issue Labels
Pull Request Labels
bug (2) enhancement (2) documentation (1)

Dependencies

requirements.txt pypi
  • Django ==4.0.6
  • asgiref ==3.5.2
  • attrs ==21.4.0
  • iniconfig ==1.1.1
  • packaging ==21.3
  • pluggy ==1.0.0
  • py ==1.11.0
  • pyparsing ==3.0.9
  • pytest ==7.1.2
  • python-dotenv ==0.20.0
  • sqlparse ==0.4.2
  • tomli ==2.0.1
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/django-ci.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • postgis/postgis 14-master docker
frontend/yarn.lock npm
  • 947 dependencies
.github/workflows/docs.yml actions
  • sphinx-notes/pages v3 composite
cerbot/Dockerfile docker
  • cerbos/cerbot v2.11.0 build
citizenvoice/Dockerfile docker
  • python 3.11-alpine3.20 build
frontend/Dockerfile docker
  • node 22.8.0-alpine3.20 build
frontend/package.json npm
  • @nuxtjs/eslint-config-typescript ^12.0.0 development
  • autoprefixer ^10.4.13 development
  • eslint ^8.27.0 development
  • eslint-plugin-nuxt ^4.0.0 development
  • openapi-typescript ^6.7.5 development
  • postcss ^8.4.21 development
  • sass ^1.58.0 development
  • @mdi/font ^7.1.96
  • @nuxt-alt/auth ^3.1.7
  • @nuxt-alt/http ^1.7
  • @nuxtjs/tailwindcss 6.13.2
  • @pinia/nuxt ^0.5.0
  • @vue-leaflet/vue-leaflet ^0.8.4
  • @vueuse/nuxt ^11.1.0
  • dayjs ^1.11.6
  • leaflet ^1.9.3
  • leaflet-draw ^1.0.4
  • leaflet-draw-toolbar ^0.3.0-alpha.1
  • leaflet-toolbar ^0.4.0-alpha.2
  • nuxt ^3.13.2
  • nuxt-api-party ^2.0.10
  • pinia ^3.0.1
  • ramda ^0.28.0
  • typescript ^5.6.3
  • uuid ^10.0.0
  • vee-validate ^4.9.5
  • vite ^5.4.9
  • vite-plugin-vuetify ^2.0.4
  • vue ^3.5.0
  • vue-toastification ^2.0.0-rc.5
  • vuedraggable ^4.1.0
  • vuetify ^3.7.3
  • yup ^1.4
citizenvoice/requirements.txt pypi
  • Django <5.2
  • GDAL ==3.8
  • PyJWT ==2.8.0
  • PyYAML ==6.0.1
  • attrs ==23.1.0
  • cryptography ==41.0.7
  • defusedxml ==0.7.1
  • django-allauth ==65.5.0
  • django-bulk-update-or-create ==0.3.0
  • django-cors-headers ==4.3.1
  • django-extensions ==3.2.3
  • django-rest-knox ==4.2.0
  • djangorestframework ==3.15.0
  • djangorestframework-gis ==1.1
  • drf-spectacular ==0.26.5
  • inflection ==0.5.1
  • jsonschema ==4.20.0
  • jsonschema-specifications ==2023.11.2
  • numpy ==2.1.1
  • oauthlib ==3.2.2
  • psycopg ==3.2.5
  • pycparser ==2.21
  • python-dotenv ==1.0.0
  • python3-openid ==3.2.0
  • pytz ==2023.3.post1
  • referencing ==0.31.1
  • requests ==2.31.0
  • requests-oauthlib ==1.3.1
  • rpds-py ==0.13.2
  • setuptools ==68.2.2
  • uritemplate ==4.1.1
  • wheel ==0.42.0
  • whitenoise ==6.9.0
docs/requirements.txt pypi
  • Jinja2 ==3.1.5
  • MarkupSafe ==3.0.2
  • PyYAML ==6.0.2
  • Pygments ==2.19.1
  • Sphinx ==8.2.0
  • alabaster ==1.0.0
  • anyio ==4.8.0
  • babel ==2.17.0
  • certifi ==2025.1.31
  • charset-normalizer ==3.4.1
  • click ==8.1.8
  • colorama ==0.4.6
  • docutils ==0.21.2
  • h11 ==0.14.0
  • idna ==3.10
  • imagesize ==1.4.1
  • markdown-it-py ==3.0.0
  • mdit-py-plugins ==0.4.2
  • mdurl ==0.1.2
  • myst-parser ==4.0.1
  • packaging ==24.2
  • requests ==2.32.3
  • roman-numerals-py ==3.0.0
  • setuptools ==75.8.0
  • sniffio ==1.3.1
  • snowballstemmer ==2.2.0
  • sphinx-autobuild ==2024.10.3
  • sphinx-rtd-theme ==3.0.2
  • sphinxcontrib-applehelp ==2.0.0
  • sphinxcontrib-devhelp ==2.0.0
  • sphinxcontrib-htmlhelp ==2.1.0
  • sphinxcontrib-jquery ==4.1
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==2.0.0
  • sphinxcontrib-serializinghtml ==2.0.0
  • starlette ==0.46.0
  • typing_extensions ==4.12.2
  • urllib3 ==2.3.0
  • uvicorn ==0.34.0
  • watchfiles ==1.0.4
  • websockets ==15.0