The note-taking app for cat lovers.
See MeowNotes live at: http://ekhattar.pythonanywhere.com/
For more details, see the technical paper in the wiki and the video.
MeowNotes is a Python-based web app written with Flask and an SQLite database.
It can be run on the uWSGI server that implements the WSGI python server specification.
The live version of MeowNotes is deployed and hosted from pythonanywhere.
For local development, the make utility provides an easy way to setup MeowNotes with predefined commands.
With regards to quality, testing is done with pytest and pylint is used for static code checks.
MeowNotes makes use of the following: Bootstrap, Font Awesome, and Cat as a Service.
Structure of this repo
.
βββ Makefile "shortcut" tasks to setup and run MeowNotes
βββ README.md primary info on how to setup, run, etc
βββ documentation
βΒ Β βββ "SS2019 - SE 01 Final Project - Concept.pdf" first concept ideation for the project
βΒ Β βββ diagrams technical diagrams of MeowNotes
βΒ Β βΒ Β βββ ...
βΒ Β βββ flask-routes.png screenshot of flask routes output
βΒ Β βββ screenshots screenshots of MeowNotes pages
βΒ Β βββ ...
βββ meownotes main app directory
βΒ Β βββ __init__.py main Flask app file
βΒ Β βββ config.py app configuration
βΒ Β βββ dbquery.py main backend file to communicate with db
βΒ Β βββ meownotes-schema.sql schema showing structure of MeowNotes db
βΒ Β βββ meownotes.db SQLite3 db
βΒ Β βββ pawprint.py Flask blueprint for MeowNotes app
βΒ Β βββ static static files
βΒ Β βΒ Β βββ css styling
βΒ Β βΒ Β βΒ Β βββ bootstrap-4.3.1 Bootstrap CSS
βΒ Β βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βΒ Β βββ fonts.css custom font imports
βΒ Β βΒ Β βΒ Β βββ main.css MeowNotes custom css
βΒ Β βΒ Β βββ fonts custom font (Montserrat) files
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ img MeowNotes image assets (logo, favicon)
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ js js
βΒ Β βΒ Β βββ bootstrap-4.3.1 Bootstrap JS
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ jquery-3.3.1.slim.min.js Bootstrap JS dependency
βΒ Β βΒ Β βββ main.js MeowNotes custom js
βΒ Β βΒ Β βββ popper.min.js Bootstrap JS dependency
βΒ Β βββ templates MeowNotes HTML templates
βΒ Β βΒ Β βββ ...
βΒ Β βββ test test folder
βΒ Β βΒ Β βββ ...
βΒ Β βββ utils.py additional helper functions for MeowNotes
βββ venv (virtual environment, not committed to repo)
βΒ Β βββ ...
βββ .pylintrc config file for pylint
βββ wsgi.py uWSGI server configuration file
- python3
- virtualenv
pip3 install virtualenv- recommended: make
- needed only if want to use the tasks defined in the
Makefileas shortcuts
- needed only if want to use the tasks defined in the
General setup
# Clone the repo
git clone https://github.com/ekhattar/MeowNotes.git
# Change directory
cd MeowNotesAfter this point, you have two options.
You can setup the environment for MeowNotes using make if you have it:
# in the MeowNotes dir
make installYou can also do everything without make:
# Create the virtual env
python3 -m venv venv
# Start the virtual env
source venv/bin/activate
# Install flask and other dependencies in the virtual env
pip install flask
pip install python-dateutil
# Optional: install if want to run with wsgi server locally
pip install uwsgi
# Dev dependency only for testing
pip install pytest
pip install pylint(Re)create the database; danger, will delete existing contents and create new tables!
# Option 1: using make
make fresh-db
# Option 2: without using make
# Start the virtual env
source venv/bin/activate
export FLASK_APP=meownotes
flask initdbThis mode has live reload on change as well as additional logging output in the console including the prepared SQL queries and results; can use either make or "manually" run the necessary commands to start.
See MeowNotes at localhost:5000/.
Start dev/debug mode with make:
# In the MeowNotes folder
make run-debugStart manually:
# Start the virtual env
source venv/bin/activate
# Set env var to see extra debug output
export MEOWNOTES_DEBUG=True
# Start in debug mode (live reload on change)
python3 meownotes/__init__.pyThis mode suppresses the additional logging output and starts on a different port.
See MeowNotes at localhost:8000/.
This port is defined in the Makefile and can be changed there.
Start with make:
# In the MeowNotes folder
make run-prodStart manually:
# Start the virtual env
source venv/bin/activate
# Start the app
export FLASK_APP=meownotes
flask runUsing the uWSGI server:
# In the MeowNotes folder
make run-wsgiTests are found in meownotes/tests; run like so:
# in the root folder MeowNotes
make testTo use pylint (configured in the .pylintrc file):
# in the root folder MeowNotes
make lint- sign up / login (from the landing)
- logout (from the menu bar)
- view a random cat (from the menu bar)
- create a new note with a title, tags, and content (from the dashboard)
- edit an existing note (from the single note view)
- delete an existing note (from the dashboard, search, or single note view)
- download an existing note (from the single note view)
- search for a note by its title, tags, and/or content (from the menu bar)
- filter the search to limit to a specific field (from the search results page)
You can use make to see the routes defined:
make see-routesHere is a more detailed description:
/GETshow the langing (login/sign-up page)
/catGETshow the cat page with a random cat
/loginGETredirect to the dashboard if signed inPOSTeither login or create a new account; if password is wrong for an existing account, the landing page is rerendered with the warning message; if the password is right or a new account is created, redirect to the dashboard
/logoutGETremove the username from the session and redirect to the landing
/dashboardGETshow the dashboard page with the user's notes
/viewGETshow the view page for the given note by id
/downloadGETnote data sent as raw text file to download
/updateGETredirect to the/viewpage for this notePOST(DB) update the note with the given id from the form
/createGETshow the create pagePOST(DB) create a new note
/deleteGETredirect to dashboardPOST(DB) delete the note with the given id from the form
/searchGETshow empty search results pagePOSTshow populated search results
/filterGETredirect to (empty) search results pagePOSTrender search results with filters applied
Note: all GET requests additionally to the above redirect to the landing (login page) if the user is not logged in
- Flask documentation
- database connection: http://flask.pocoo.org/docs/1.0/tutorial/database/
- blueprints: http://flask.pocoo.org/docs/1.0/tutorial/views/
- testing: http://flask.pocoo.org/docs/1.0/testing/
- flashing: http://flask.pocoo.org/docs/1.0/patterns/flashing/









