/todo-list

✔️ simple todo list, JS frontend, facebook OAuth, mysql storage, docker

Primary LanguageHTMLMIT LicenseMIT

Todo List

simple todo list with JS frontend, facebook OAuth, mysql storage, docker

Demo

https://cecinestpasun.site/todo

Screen Shot

Description

This is a basic todo app demonstrating some of my full stack skills

Environment

  • Server

    • host: Amazon AWS EC2 instance
    • OS: Linux Ubuntu 16.04.3 LTS (xenial)
    • firewall: ufw 0.35
    • SSL Cert: Let's Encrypt certbot 0.19.0
  • Languages

  • Apps

    • web server: nginx/1.4.6
    • application server: Flask==0.12.2, Jinja2==2.9.6
    • web server gateway: gunicorn (version 19.7.1)
    • OAuth: Facebook
  • Database

    • database: mysql Ver 14.14 Distrib 5.7.18
    • docker dev DB: mysql latest
  • style:

    • python: pycodestyle==2.3.1
    • web static: W3C Validator
    • JavaScript: semistandard 11.0.0

Releases

v1: Static

$ ./app.py

v2: Storage Model

  • This is the current release
  • Facebook OAuth - MySQL DB Storage Engine - Docker

This Release uses Facebooks OAuth for Authentication & MySQL database as a storage model for all user tasks. There is also setup instructions and configurations to use Docker database for development. This is the current release.

$ git clone "https://github.com/johncoleman83/todo-list.git"

Usage

  • instructions for OAuth & Docker DB storage model (current release)

  • (1) Setup Docker development database

(Facebook Application settings need to be configured with localhost)

  • pull latest docker mysql image from docker hub
$ docker pull mysql:latest
  • start todo-mysql container
$ docker run --name todo-mysql --detach --env MYSQL_ALLOW_EMPTY_PASSWORD='yes' \
	--env MYSQL_DATABASE='todo_dev_db' --publish 3306:3306 mysql:latest
  • Note:

    • wait 7 seconds to make sure the container and mysql is ready
    • the next 2 commands require mysql server to be installed to execute them
    • make note of the LOCAL_IP used to bind to the docker container
      • Linux: 172.17.0.2
      • mac OS: 0.0.0.0
  • verify container was created successfully

$ docker ps -a
CONTAINER ID   IMAGE         ...  ...  STATUS           PORTS                    NAMES
51cc1b82aef8   mysql:latest  ...  ...  Up 44 seconds    0.0.0.0:3306->3306/tcp   todo-mysql
  • verify database exists
$ docker exec [CONTAINER ID] echo 'SHOW DATABASES;' | mysql -h[LOCAL_IP] -uroot
  • (2) Configure ENV Variables (Optional)

    • APP_HOST
    • APP_PORT
    • TODO_KEY
    • TODO_USER
    • TODO_PWD
    • TODO_DB_HOST
    • TODO_MYSQL_DB
  • (3) execute todo app backend app server

$ TODO_DB_HOST=[LOCAL_IP] python3 -m web_app.app

Testing

unittest

  • This project uses python library, unittest to run tests on all python files.
  • All unittests are in the ./tests.
  • Run tests with this command:
$ TODO_DB_HOST=[LOCAL_IP] python3 -m unittest discover -v ./tests/

Terms of use and Privacy Statement

https://github.com/johncoleman83/todo-list/blob/master/PRIVACY_STATEMENT.md

License

MIT License