Code Monkey home page Code Monkey logo

kettle's Introduction

Kettle

Kettle is a web app created using flask, SQLAlchemy, bootstrap, and apscheduler. The applications purpose is to schedule weekly-repeating events that activate a servo that turns on a tea kettle. While the current use of the web app is quite specific, it could be used in many other ways where a user database and an event scheduler are needed.

Functionality

The web app uses sqlite Data Base with SQLAlchemy handling it (The db could be switched to PostgreSQL for production). The db holds the apscheduler events, the events but in a different location for displaying them, and the Users. The apscheduler event currently uses a Cron like style for their scheduling. When the event hits its activation date-time it calls a function, and in my case it is the runKettle() method which turns on the servo that flips the kettle switch. This method could be replaced with whatever you have in mind that you would like to run. More info about APscheduler.

The main functions the webapp features in the most recent version:

  • scheduling weekly-repeating events
  • deleting events
  • turning the Kettle on at the press of a button
  • updating your user profile (picture, email, username)

Demo

Home Page When Logged in, with events scheduled Home Page

The State page where you create events State Page

Register Page Register Page

Login Page Login Page

Account Page Account Page

Future Features

  • single day/date-time scheduling
  • ability to update an event
  • reset password via email link

Setup

  1. To setup first start by making sure you have python 3 installed
  2. Download and install the required modules used. This can be done by using pip/pip3 on the requirements.txt file. While in the Kettle directory on linux/mac you can use
    pip3 install -r requirements.txt
    to install the modules.
  3. You need to edit the path to the site.db in the code. In routes.py on line 14 you will find
    sched.add_jobstore('sqlalchemy', url='sqlite://///Users/user/Programs/site.db')
    You must change the /Users/user/Programs/site.db to your path to the site.db file.
  4. That is all the setup! Now just run python3 run.py and enjoy!

Resetting DB

To reset the db go to the directory the app folder is in. Next open python3 and import the db from the app:
from app import db
Then delete all the tables by
db.drop_all()
Next add all the tables back and you're all set!
db.create_all()

Acknowledgements

  • BootStrap code snippets where used in the making of this project
  • To find the python modules I used in this project see the requirements.txt file
  • This project was inspired by Corey Schafer's Flask Series

kettle's People

Contributors

imgbotapp avatar john-trager avatar

Stargazers

 avatar

Watchers

 avatar

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.