Skip to content

CS50x Final Project - Simple web application as To-Do list built with Python and Flask

License

Notifications You must be signed in to change notification settings

g-k-coder/CS50x-Final-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Done

About project

This is my CS50x final project. I often forget to do simple errands or to do something. The very simple goal of a to-do list is to get my tasks done; often it is a simple activity like putting your sheets back on the bed or booking my next trip. Often a list is all that is necessary to meet that simple goal. The best way to manage a list is simply to put everything on the list as a priority to do. If it is something you had to do, and it took me a minute to get that done, it should be marked as a basic task; in this way, everything is a priority.

DONE is a web application that works as a To-Do list.
The functionalities of the application are:

  • Registration: Mandatory, functionalities of the application are available only if the user is registered.
  • Password change: After registering, users can alter their password only if the current password is provided.
  • Add: Append the new item to the ToDo list.
  • Edit: After adding an item to the list, the user can edit it.
  • Done: Removes the item from the list.

Prerequisites

What things you need to install the software and how to install them.
A step-by-step instructions that tell you how to get the project running.

Open your terminal and follow the instructions:

# Instructions are for Debian-Ubuntu Operating Systems

$ sudo apt update && sudo apt upgrade
# Downloads and installs the updates for each outdated package and dependency on your system

$ sudo apt-get install python3 python3-dev
# Downloads and installs the latest version of Python 3

$ sudo apt-get install python3-pip
# Downloads and installs the PIP

$ pip3 install Flask
# Downloads and installs Flask

$ pip3 install Flask-Session
# Downloads and installs Flask-Session
# Flask-Session adds server-side session support to Flask application

$ sudo apt install sqlite3
# Downloads and installs SQLite3

$ pip3 install cs50
# Downloads and installs CS50 library for Python

$ sudo pip3 install style50
# Downloads and installs style50 for Python

$ sudo apt-get install astyle
# Downloads and installs Artistic Style

$ sudo pip install --upgrade style50
# Upgrades style50


Prerequisites - Recommendation

Visual Studio Code, also commonly referred to as VS Code, is a source-code editor made by Microsoft with the Electron Framework, for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. (source: Wikipedia)


Cloning

Copy and paste git --version to your terminal to check if you have Git installed on your system.
If your terminal returns a Git version as an output, that confirms you have Git installed on your system and you can skip the first step below.
If not, you have to download and install Git.

$ sudo apt-get install git
# Downloads and installs Git

$ git clone https://github.com/g-k-coder/project-50.git
# Clones the GitHub repository to your machine

Coding style test

Check if the code is aesthetically pleasing and easy to read. Navigate to the project's directory, open terminal and follow the instructions below:

$ style50 *.py
# Example

$ style50 *.py
Results generated by style50 v2.7.5
::::::::::::::
app.py
::::::::::::::
Looks good!
But consider adding more comments!
::::::::::::::
helpers.py
::::::::::::::
Looks good!
But consider adding more comments!

Deployment

How to deploy this on a live system: Navigate to the project's directory, open terminal and follow the instructions below:

$ export FLASK_APP=app.py
$ flask run

Built With

  • Flask - Web framework
  • Python 3 - Programming language
  • HTML5 - Markup Language
  • CSS - Style Sheet Language
  • Bootstrap - CSS Framework
  • SQL - Query Language For Database Manipulation
  • CS50 - CS50's Library For Python

Succint project breakdown per file

  • "static" directory - contains static files such as CSS files, JavaScript files and images
    • logo_icon.ico - icon displayed in the HTML head, i.e., browser tab
    • style.css - CSS file defining the look-and-feel of each web page, i.e., each HTML file
  • "templates" directory - contains only HTML documents
    • edit.html - web page where users modify their tasks on the To-Do list
    • error.html - displays the image and the text of an error which caused them to be redirected to this page
    • index.html - "homepage"
    • layout.html - skeletal structure of the web page, in order to keep the code in the DRY principle
    • login.html - users input their username and password
    • password_change.html - allows the users to change their password
    • register.html - page containing username field, and two password fields, so that users can confirm their password
    • todo.html - the web page where most of the web application functionalities happen, e.g. add to the list, remove from it, edit the items on the list
  • app.py - Python code making all of the functionalities happen
  • done.db - Relational database containing tables of users, and their To-Do lists
  • helpers.py - Ensures that user is logged in and checks for errors
  • requirements.txt - Text file containing the list of all Python libraries and modules imported in the Python code


Author of the project

Author of the template

About

CS50x Final Project - Simple web application as To-Do list built with Python and Flask

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published