Coder Social home page Coder Social logo

iogt's Introduction

IoGT

Internet of Good Things (IoGT) is developed as a public good under a BSD-2 open-source license.

The development uses the Python programming language, building on the Django server-side web framework combined with the Wagtail content management system.

IoGT 2.x requires:

  • Wagtail 3.0.3
  • Django 3.2
  • Python 3.9+
  • PostgreSQL (14+), MySQL and SQLite (3.38+) as database backends

Getting started

The easiest way to get started is to run IoGT using Docker. Make sure you have Docker Desktop installed, or at the very least the Docker Engine and Docker Compose (which are included in Docker Desktop).

Check out the code.

git clone https://github.com/unicef/iogt.git
cd iogt

Create the database. By default, an SQLite database will be created. This will take a few minutes on the first run because the IoGT container image needs to be created from scratch.

docker compose run --rm django python manage.py migrate

Create a superuser account for administration purposes.

docker compose run --rm django python manage.py createsuperuser

Compile .po language files stored in locale/

docker compose run --rm django python manage.py compilemessages

Start the server.

docker compose up -d

Check the logs.

docker compose logs -f

Once running, navigate to http://localhost:8000/ in your browser. Log in to the admin UI at http://localhost:8000/admin/ - use the superuser name and password you created earlier.

Shut everything down.

docker compose down

Optional

Setting up test data

It is possible to automatically populate the database with example data for a basic test site.

docker compose run --rm django python manage.py create_initial_data

Optionally, create the main menu automatically as well.

docker compose run --rm django python manage.py autopopulate_main_menus

Configuring the Chatbot

Follow instructions here

Content transfer between sites

Articles can be transferred from other IoGT sites - details.

Adding new localizable strings to the code base

After adding new strings to the code base that are user-facing (see https://docs.djangoproject.com/en/4.0/topics/i18n/translation/ ), follow the following process:

  1. Run ./manage.py translation_tracking
  2. Review and update common/translation_utils/translation_status.csv. Strings that only appear in the admin backend don't need to be tagged as translate, only those that face users. See here for details.
  3. Rerun ./manage.py translation_tracking

This process updates PO files as necessary and compiles a list of strings that appear in the translation manager in the admin backend.

Remark: The file common/translation_utils/translations.csv is NOT updated in the process. Even though it has a column "is in use", its data is currently not updated automatically, and similarly, new strings are not added automatically.

Apache Superset Setup and Configuration

Page caching

Page caching is provided by Wagtail Cache and is deactivated by default. To start caching pages, follow the activation intructions.

Elasticsearch

To use Elasticsearch as a search backend instead of the relational database see the setup instructions.

Migrating content from IoGT v1

Follow instructions here

Add/Update Package

Follow instructions here

Running Tests

Run the following commands:

make tests
make selenium-test

In parallel, for example, with 4 processes:

IOGT_TEST_PARALLEL=4 make test
IOGT_TEST_PARALLEL=4 make selenium-test

More details of the Selenium tests can be found in the Selenium test README.

iogt's People

Contributors

alihassanc5 avatar azahid89 avatar bart-merix avatar cbunicef avatar chrismarsh82 avatar dannyparsons avatar dependabot[bot] avatar edmoss345 avatar ehmadzubair avatar falsefruit avatar fourmeta-old avatar geoo89 avatar hashim-rana-hub avatar isedwards avatar istride avatar kishokanth-netizen avatar m-paczkowski-mrx avatar mbilalhameed avatar michaelclapham avatar mwrobel-merixstudio avatar rafalnater avatar rauniyarsriyans avatar saxix avatar sheralim012 avatar usmanali99 avatar volloholic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iogt's Issues

As CMS Admin I can manage site settings

Existing Features to Keep:

  • Logo editing
  • Checkbox to show only translated pages
  • GA and FB Analytics Links
  • Content Rotation Settings
  • Social Media Footer Page Links
  • Social Media Article Sharing Buttons

Unsure about Existing Features / Need to Investigate:

  • Article tag settings
  • Service directory API settings

Features to Add:

  • Color Scheme

Draft Sections and Articles are shown in navigation

Sections and Articles that have not been published are currently being shown on the home page and in the navigation (but a 404 error is given when the article is clicked since the Article has not been published).

Basic search

Users should be able to search for content.

  • Users can enter search terms in input box in the site header.
  • Users are shown a page of results.
  • Search index should use Elasticsearch as a backend.

As a CMS Editor I can add a single featured content to a Section

Sections should have a "Featured Content" field which allows for the selection of one page (article, survey, poll, quiz etc.) that is within that section. This is optional, a section doesn't have to have a featured content.

On the site, the featured content would then be displayed at the top of the section page before anything else (subsections, child articles).

As CMS Editor, I can edit features of sections

Sections and subordinate sub-sections should have the same features for customization. These should include:
0. Title
1. Image (which appears at the top of the section's landing page)
This is an image selection from the image gallery and allows for single image upload
image

2. Commenting state (open / closed)
As is.
3. Slug
This is an editable field that is pre-populated with the title of the section
4. Page title
This one line field determines the title that appears in the tab on your web browser. It is editable but prepopulated with the title of the Section.
5. Search description
This feature does not currently function or aid in improved search results on the site, but it should
6. Tags
This feature does not currently function, but should.
7. Color Setting
This is currently done very poorly. Users should be able to select from a color wheel or insert a hex color
image
the color sets the style for the whole section
image
image

8. Activate Up Next & Recommended Articles
image
9. Scheduled Publishing
image
10. Icon This is a new feature. The updated site design requires the use of icons to assist users w/ navigating through sections. Use of icons aims to ease the user experience for low literacy audiences. Icons should be pre-loaded into all sites from the icon library and available for selection. COs should have the toption to upload their own icons, too.

As a front-end user, when I click on a link that takes me off of the IoGT site, a pop-up may appear that alerts me that I'm leaving a free-data environment.

When users accessing IoGT on a whitelisted IP address click on links to leave the site, such as a link to a WHO article, they should receive a pop up alert that they may incur data charges. In the CMS, administrators should be able to toggle this feature off and on. This pop-up language should be included in the multi-language support of the site.
Screenshot_20210218-202312

Standard Wagtail CMS Installation

This repository will be used for the development of version 2 of Internet of Good Things (IoGT).

First task - replace the current contents of this old repo with a standard Wagtail 2.12 install and enable Wagtail v2 API.

The intention is to document even these initial steps to allow everyone in the project to follow along with the process. Some other work for the v2 backend has already begun in parallel and will be brought over to this official repository.

Improvements to IoGT design

  • Tidy up current CSS for different media types
  • Work with client to improve the overall design
  • Ensure that navigation works for users who have JavaScript disabled (e.g. users of some feature phones)

As a CMS editor, I can configure robust surveys to allow front-end users to share insights or learnings.

Surveys should allow for a feature image to appear of surveys.
Surveys should allow for editable description to appear at the start of surveys.
Surveys should allow for the following field options:

  • Single line text
  • Multi line text
  • Positive number
  • Number
  • Date
  • Date / time
  • Email
  • Checkbox (i.e. 1 option, check to consent)
  • Checkboxes (i.e. check all that apply)
  • Radio buttons (multiple choice with only 1 answer)
  • Drop Down (multiple choice with only 1 answer)

Positive number, radio buttons & drop down should provide options for skip logic within the survey configuration.

  • All fields should be marked as required or optional (with optional as the default).
  • All fields should have an associated "Admin Name" which relates to the CSV file header when exporting survey results.
  • All fields should have optional, editable information / help texts (e.g. "check all that apply") which appear on HTML view as italic, light gray text and in javascript enabled views as an "i" with a circle around it. Text will appear on hover.

Polls, surveys and quizzes should have

  • All existing validation / error messages when surveys are saved and required fields are not met. Such as adding a field without an admin name or adding a multiple choice field but not assigning any options.
  • Editable submit and homepage button text that edits either the button to select when beginning a survey or submitting a survey. By default these read "start" and "submit" - and should be incorporated in the translation solution to ensure that all features of the site are translated appropriately.
  • the option of sitting either within a parent section or sub-section or as a child to an article. The option to have a click-button to begin or direct display (either onto the body of the article as an optional content module or in the parent section or sub-section) should be available.
  • the option to require login or accept anonymous responses
  • the option to allow multiple responses per user or not
  • the ability to format the confirmation page to include text ,images, media, and links as an article.
  • Scheduled publishing options (post and expiry date)

User account registration / management

Visitors of IoGT sites should be able to sign-up for an account to allow for personalisation and community involvement.

  • Visitors should be able to create a user account for themselves.
  • As part of the sign-up process visitors may be asked a set of questions, which may be different for each site, and may be optional or mandatory.
  • Users should be able to change details of their account (name, username, password)
  • Users should be able to initiate a password reset process.

Publish content to multiple sites

  • Automated process to make content available in single tentant sites

Requirement: Develop content and ready in multiple languages, then push Spanish version to Spain, Mexico etc. (in draft - in an orphaned section because countries organise content differently). The pushed version is a copy and doesn't make it's way back to the central editor, it can be edited/customised locally.

  • Multi tentant site - simple system to author for multiple site simultaneously (causes issues)

Implementation of analytics

Implement Google Analytics and/or investigate a suitable alternative.

Currently access to Google Analytics is not giving updated/full information.

Some results are not currently appearing in Google Analytics and are being manually added to data studio.

  • Frequently visited sections
  • Types device
  • User time on site
  • Bounce rate

RapidPro is is using PowerBI.

There is a Google Analytics -> PBI plugin.

Poll and survey data analytics

As CMS Editor I can move content pieces (sub-sections, articles, polls, surveys, quizzes) on the site

The current reorganization feature in the CMS works well. CMS editors can select any content from the site and move it and all subordinate pages:
image
When "Move" is selected, you're taken to a page where you can navigate to the parent section or sub-section that you want to move content to.

It might be better, however, to have a master site heirarchy that allows editors to drag-and-drop sub-sections around. This would be easier for site managers at country office level to manage independently.

Comments

Registered users should be allowed to comment on content.

  • Commenting can be enabled or disabled on any page.
  • Users can post comments.
  • Users can reply to comments.
  • Users can 'like' comments.
  • Moderators can review, filter and export comments.
  • Moderators can provide custom or canned responses to comments.
  • Community moderators can flag inappropriate comments.
  • Moderators should be alerted to flagged comments.

Design clean-up

The existing markup and styling was copied over from Preact SPA that was developed by fairly inexperienced developers. Before further development of the front-end, it would be beneficial to review the existing markup and styles. Some deficiencies have been identified already:

  • HTML duplicated to cater for different device types
  • Inconsistent media queries, targeting slightly different device breakpoints
  • CSS is not very well organised (might benefit from BEM methodology)

There may be other issues, and suggestions for improvement would be welcome for our consideration.

The app is designed to work primarily on low-end devices (feature phones and budget smartphones), but should support all devices. There is also a requirement for the app to be fully functional on devices/browsers that do not support JavaScript.

As CMS editor, I can add / edit / save to draft / publish articles with robust features for promotion.

As CMS editor,
I can add articles to any parent section or sub-section. Article features which currently exist and should remain include:

  • Title
  • Feature Image
  • Tags
  • Body (with pre-formatted features for lists, numbered lists, text, images, media, and page links)
  • Commenting Settings
  • Recommended Articles
  • [ ] Recommended Section (Edit by @dannyparsons: Not needed, see response from Laurie: Better to have a single recommendation and the editor can pick whether the link takes the user to a section or article)
  • [ ] Featuring in Homepage (Edit by Danny: in discussion with Laurie agreed that this moves to a setting on the homepage instead of setting on each article)
  • Status (Publish, Draft, Unpublished)
  • Privacy
  • Edit Lock
  • Go Live Date Time / Unpublish Date Time

Features which should be removed include:

  • Article > Content > Subtitle
  • Article > Promote > Feature in Latest
  • Article > Promote > Featuring in Section

TBD Existing Features with Unknown Functionality
-Social Media
-Tags for navigation
-Reaction Questions

  • Article > Promote > Topic of the Day
  • Article > Promote > Metadata
  • Article > Promote > Common Page Configuration > Show in Menus
  • Article > Promote > Common Page Configuration > Search Description

Features which should be enhanced include:

  • Style code should be able to be overwritten in the body
  • Additional formatting options for body text including multiple header formats (right now, there's only H1 which makes text bold)
  • Adding a video or audio file should include an upload option, like as in images. Right now, you have to first load the files in the media section and then they can be accessed when editing pages)
  • Hyperlinking text to internal or external pages. Right now, inserting a page link results in the page title appearing. This is not editable. The editor should be able to link text such as "Learn more about vaccines." and link to the page "About Vaccines."
  • The CMS editor should be able to insert an image and have the image appear as a hyperlink.

New Features Include:

  • Add a body feature to embed a survey directly on the page - not necessarily at the bottom.

Nice to have Features (v3.0 beyond) include:

  • Explore multi-column formatting for desktop view

Features to Keep in New CMS

Definitely keep:

Maybe keep:

  • Settings > Sites - I believe this may allow one to test locally and modify the site that the [LIVE] box goes to – it may be worth keeping if we can figure out how to use it
  • Settings > Persona - this may be a way to collect data about what subsets of users are looking at. If that's the case, this would probably be worth keeping
    https://pypi.org/project/molo.usermetadata/

Use Wagtail 2.11.x (Long Term Support release)

Modify the wagtail version in requirements.txt to use the Wagtail Long Term Support (LTS) release.

This is a minor code change, but it requires all developers to delete their local test database db.sqlite3 (so that Wagtail migrations can only be applied up to the LTS release) - and also update or delete their virtual environment.

The new requirement should be:
wagtail==2.11.*

As CMS Editor I can reorganize site content

This includes both the reorganization of articles, sub-sections, banners, and footers to appear in a specific order (currently done via drag-and-drop within the parent section) AND also includes moving content from one section or sub-section to another. Content moving is fine as-is, but in v3.0 and beyond it would be good to see a content hierarchy or tree within the CMS that allows for easier drag-and-drop reorganization.

As a CMS editor, I can enable polls to allow for anonymous submissions.

Currently, polls function to allow users to vote and receive immediate feedback: how did their answer stack up against their peers or other community members? However, the current CMS requires users to be logged in before voting in a poll. The current CMS allows for anonymous survey submissions, but not polls. Polls should be configured to allow anonymous submissions but restrict multiple submissions from the same device.

Polls, surveys and quizzes should have

  • the option of sitting either within a parent section or sub-section or as a child to an article. The option to have a click-button to begin or direct display (either onto the body of the article as an optional content module or in the parent section or sub-section) should be available.
  • the option to require login or accept anonymous responses
  • the option to allow multiple responses per user or not
  • the ability to format the confirmation page to include text ,images, media, and links as an article.

Offline access for users with intermittent network access

For users with intermittent network access it would be very useful to download content for offline use. Users with devices/browsers which implement features of Progressive Web Applications (PWA) could take advantage of Service Workers to enable this.

We would like to offer users a choice of how much content to cache for offline use:

  • bare minimum: core assets + article text (no article images) for previously visited articles
  • all content for previously visited articles
  • bulk download of all content

Customisable homepage

The homepage should be editable to be able to choose which articles/surveys/polls/quizzes appear on the homepage.

Currently this is done through editing the article by going to Promote > FEATURING IN HOMEPAGE

Instead, the desired functionality is for this to be done by editing the homepage and not by having to go to each individual article. Selecting items for the homepage should be done in a similar way as "Recommended Articles" are chosen where you can add articles/surveys/polls/quizzes through a search and be in a specific order.

As a CMS editor, I can load banner images such that content is promoted / featured on the IoGT homepage.

Examples of current sites relying on banners include:
ec.goodinternet.org
zw.goodinternet.org
sa.goodinternet.org
pacific.goodinternet.org

In the CMS, a banner section allows the editor to add, remove, & reorganize banners. Current banner upload screen is pasted below. All fields remain.

Adding subtitle text results in the appearance of text at the bottom of the rotating banner on java-enabled sites.

Features to drop include:
Settings > Show in Menu
Settings > Search Description
Promote

image

As a CMS editor, I can bulk upload images and organize them with folders or tags.

As CMS editor, I can visit the "Images" gallery in the CMS and bulk upload images. The image gallery currently only alllows for tags to be added after images are loaded and tags must be added 1 at a time. Tags should be bulk-added as part of the upload process. If possible, it would be ideal to have better organization options for images. The bulk upload feature works well right now, but navigating through images when you want to add them onto an article is more complicated.

image

As an example, when I edit an article and attempt to add an image to the body or as a feature image, I must manually scroll through the entire library to find the image unless tags have been added to filter results. Improved navigation through this image gallery would be ideal.

image

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.