Git Product home page Git Product logo

kid-o's Introduction

Kid-O

Build Status

Kid-O

Kid-O helps Non-Profit children’s aid orgs keep an overview of their children.

Google Impact Challenge 2018 award winner

Google Impact Challenge Award

Winner of C-Base Hack 'N Tell HACK OF THE MONTH PRIZE

Contents

Overview

Kid-O solves these common problems for aid workers:

  • keeping accurate and up-to-date information about each child in a central sharable CMS
  • managing child profiles without internet access (via SMS)
  • structures a child's information in an easily editable format
  • organizes information such as name, age, home situation, school year etc.
  • makes it easy to visualize a child's home location on a map even when no address is available
  • makes it easy to add the orresponding godparent to the child profile, if available

Kid-O will be tested by the children's aid project Dominiño in the Dominican Republic.

Technologies & Stack

Backend

Python, Flask, SQLAlchemy, PostgreSQL

Flask extensions: Flask-Login, Flask-Bcrypt, Flask-WTForms, Flask-SQLAlchemy, Flask-Seasurf.

Testing: unittest.

Frontend:

JavaScript, jQuery, AJAX, Jinja2. HTML5, CSS3, Twitter Bootstrap (html/css/js framework), RWD (responsive web design).

APIs:

Mapbox.js(OpenStreetMaps), Twilio.

Features

  • Shows children's profiles

  • Previews, compresses and uploads images

  • Saves new or updated home location data from the map into the database and shows it on the map.

  • Flask app routes requests to the database and manages form validation via Flask-WTForms.

  • Enables search by first-, last-, both names, part of the name or school year.

Security with Bcrypt and Flask-Login
  • Encrypt and verify user passwords using hashes.

  • Secure user sessions let users stay logged in.

APIs
  • Twilio API integration allows users to create new child profiles through a text message, including the photo of the child(through MMS). No internet is required.
  • Mapbox.js allows users to save home location by clicking the location on the map rather than having to type in an address.
Data visualization and interaction
  • Shows what information is missing from the child's profile in the overview page.

  • Requests missing information in the child's profile.

  • Child's home location shown and editable on a map.

  • Child's age is calculated from their birth date.

  • Users can preview the image that will be uploaded to the child's profile.

  • Custom responsive web design (RWD) using CSS3.

In-depth use cases

Overview page

  • List's a short preview of the children's profiles
  • Icons are displayed in green or red depending on what information in the child's profile is filled out or if there is information missing
  • The heading title bar displays in green or red depending on available information
  • The search function can search for any part of the child's name and stays fixed to the top side of the page for accessibility
  • The "add child" button on the top right of the page makes it easy to add a new child to Kid-O
  • Bottom navigation stays fixed for easier accessibility

Child page

  • Shows the child's information in a structured, editable format
  • When adding or editing a child's profile, the selected photo of the child is displayed as a preview on the page.
  • If a photo of the child is missing, Kid-O displays a standard image.
  • If information is missing, Kid-O displays requests to fill out the missing info on the profile pages.
  • Child's age is calculated from their birth date.

Users can:

  • Sign in/sign out/sign up (create an account)
  • Add a child profile to Kid-O. They can add basic information such as name, birth date, the child's guardian name, home situation etc.
  • Edit a child's profile
  • Add the child's home location on a map
  • Update the child's home location
  • Search for a child on the search form at the top of the page
  • Add a child's profile through SMS/MMS including the child's photo

Future plans

Verify existence of child when creating a new profile

Currently, the existence of the child been added to Kid-O is not verified. I plan to warn the user with a popup suggesting a possible child if the new child's name is similar to an existing child in the system.

Upload child photos to Amazon S3

For demo purposes, I save the photos of the children on my hard disk. I plan to upload them to Amazon S3.

Lazy Load

In order to limit the use of data, I want to include a Lazy Load to only preview a certain amount of children's profiles at a time.

Alerts for upcoming appointments/due updates

I plan to use the Twilio API to send a text message/email to the aid workers when a child's profile has not been updated for a specific amount of months.

Additional security

To prevent brute-force hacking attempts, I will add an increasing time delay after multiple failed login attempts.

Monitor which user edited which child's profile

Allow users to see their stats on their user profile pages, e.g. how many updates they have made, which child profile they last worked on, etc.

Real time updates

Currently, the page must be refreshed to show updated children's profiles. This should be updated to happen in real-time with server-sent events.

Add messaging system

Many children's aid projects have godparents who sponsor children. I want to add a messaging system that makes it easier for the volunteers to send up-to-date information about the children to their godparents.

Technical choices

Security

In any login system, security is important. I wanted to ensure that user passwords couldn't be stolen, especially considering that most people re-use their passwords all over the place (despite warnings against such a practice). Bcrypt offers a simple but effective encryption and verification system using hashes, requiring only a few lines of code.

I chose Flask-Login to manage secure user sessions when they login. This Flask extension is well-known, well-documented, reliable, and offers exactly what I needed to implement that feature.

PostgreSQL

I chose to use PostgreSQL to make use of the powerful SQLAlchemy ORM and ensure scalability.

Flask-WTForms

Partway through the project, I discovered Flask-WTForms, a Flask extension that offers form creation and validation. I switched to this method for all future forms on the site because of its simple and effective form management and validation options.

OpenStreetMaps

My app will be deployed for the Non-Profit Dominiño in the Dominican Republic. For this reason, I decided to use OpenStreetMaps instead of Google Maps, since OpenStreetMaps offers much better coverage of the infrastructure in the Dominican Republic than Google Maps.

Custom CSS

Using CSS3, I customized the checkboxes and select dropdowns. I didn't like their default appearances, and wanted to change their colors and styles to better match that of the website.

I used Bootstrap for certain things, like button shapes and the navbar.

JQuery

I used JQuery to dynamically shrink the navbar header on scroll by adding a CSS class to the nav element. I also used JQuery to allow the user to drop a pin on the home location of the child in the map.

Code structure

All my routes are in one file, views.py, and my database models are in a separate models.py file. I dabbled with child base views in child.py. The Twilio API-related route is at the bottom of views.py.

On the overview page, I used Jinja to show alerting icons depending on what information is missing in the children's profile. The users are also asked to fill out missing information in the child's profile page. On the frontend, rather than recode my nav bar for every web page, I used Jinja templates to simplify the process by extending from a base.html file that contains the nav bar.

Screenshots

Overview of the children

Overview of the children

Display of missing information on the child profile preview

Display of missing information on the child profile preview

Child profile

Child profile

Add child profile

Add child profile

Edit child profile

Edit child profile

Deactivate child profile

Deactivate child profile

Show hidden child profiles in overview

Hidden child profile

Delete child profile

Delete child profile

Add and delete godparents to child profile

Add Delete godparents

Search function

Search by name: Search by name

Search by school class: Search by class

Map

Map

Login

Login

Signup with form validation

Sign up

Want to contribute?

  1. You'll need your own API keys for Twilio!
  2. Install Postgres

For Mac users, you can install Postgres.app and PSequel for creating connecting to postgres superuser, create database user & password and actual database through a GUI interface. Here is a medium post in how you can create a user and database through command line

  1. Fork github project

    Run the following commands

    1. git clone [email protected]:vanesa/kid-o.git && cd kid-o
    2. virtualenv --no-site-packages -p `which python3` venv
    3. source ./venv/bin/activate
    4. pip install -r requirements-frozen.txt
    5. python setup_database.py
    6. npm install -g less
    7. bash ./run.sh
    8. Go to http://localhost:5000 in your browser to use the app
  2. Make sure tests pass

    Run the following commands

    1. pip install -r requirements-test.txt
    2. pytest

kid-o's People

Contributors

alanhamlett avatar darrylbalderas avatar vanesa 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kid-o's Issues

Make children model attributes dynamic

Via admin, should be able to add new field to children object of type multiple choice single answer, text, paragraph, multiple choice multiple answer, checkbox, radio select. Each attribute/field will have name, type, value, is_required. That way new child attributes can be added without writing new code, should be as simple as adding a new "question" when creating a google form.

Contribution

Hey Vanesa,

I'd like to contribute to this project. Is there anything you'd like me to do?

Create Lazyload

Look into the best JS Lib for Lazy load and integrate it.

Decide between Heroku + Netlify vs DigitalOcean, or support deploying to both

We use the Flask-Static-Compress extension to minify and bundle our static JS and LESS files. Heroku is nice, but we don't want to check these bundled files into git. We could use Netlify to automate running Flask-Static-Compress and host the static bundles, then point our Flask app running on Heroku to use Netlify's CDN as the STATIC_URL in our HTML/Jinja2 templates.

Or, we could use a linux virtual machine from DigitalOcean and run Flask-Static-Compress when deploying to the server and just host the bundles on the droplet's filesystem.

Heroku + Netlify is free unless we get more than 10k rows in our database, then it starts at $50/mo. Heroku will also sleep (turn off the server) after not being used for a while, so initial visits to the website will be slow around 10s. Paying $7/mo prevents dynos from sleeping. Heroku + Netlify automates the build/deploy process and they manage OS updates for us, but having no local filesystem is the downside... or upside.

DigitalOcean is $5/mo with practically unlimited (25GB) rows in the db, since it doesn't limit rows only SSD storage space. It's performance would be better than Heroku, but requires manually managing the server with OS updates and configuring our own build/deploy process.

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.