Skip to content

A fully functional blog building tool built using Python and the Flask microframework, in conjunction with Google App Engine.

Notifications You must be signed in to change notification settings

BenjaminFraser/FlaskGAEBlogBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create a blog application built with GAE and Flask - The Big Borogu

Set-Up Instructions:

  1. Update the value of application in app.yaml to the app ID you have registered in the App Engine admin console, which you would like to use to host your instance of this sample.
  2. Run the app with the devserver using dev_appserver.py DIR, and ensure it's running by visiting your local server's address (by default localhost:8080.)
  3. (Optional) Host the application using the GoogleAppEngine launcher, by creating a new project from an existing set of files, and importing the Big Borogu library. Deploy your application through running the app, and visiting localhost:8080 (or whatever port number you have designated).

The Big Borogu Description:

The Big Borogu is an online blog creation tool, whereby users can register for free, create, edit and delete blog posts, and read and interactive with other community member posts.

After creation of an account, a user may create a post of their own, which can be edited and/or deleted at any time. Other users may view and comment on another users blog post, along with being able to upvote or downvote the selected post, although a user cannot like/unlike thier own posts.

The HTML and CSS structure of the application has been built upon the Materialize framework - A modern responsive front-end framework based on Material Design.

The application features a rich text editor for creation of user posts, implemented using the open source JavaScript editor Quill.

User alerts and notifications are provided within the app through the use of SweetAlert.


Files Included:

  • app.yaml: App configuration.
  • blog.py: Main blog handler classes, functions and url routes for blog functionality.
  • models.py: Entity definitions for Users and Posts, including class helper methods.
  • account_func.py: Helper functions for the creation and validation of hash strings, secure values and account related functionality.
  • index.yaml: Common types of query run by the app, so that the Google App Engine application can obtain results very quickly. /templates: templates directory, providing the Jinja2 HTML templates for each page generated by the web application. /static: The resource files required by the app for operation, including external libraries, css and JavaScript files.

This project provides you with the following required directory and files:

    The_Big_Borogu/
    ├── README.md
    ├── blog.py
    ├── account_func.py
    ├── models.py
    ├── app.yaml
    ├── index.yaml  
    ├── static/
        ├── css/
            ├── materialize.css
            ├── materialize.min.css
            ├── index.css
            ├── quill.snow.css
            ├── sweetalert.css
        ├── images 
        ├── js/
            ├── materialize.js
            ├── materialize.min.js
            ├── quill.js
            ├── sweetalert.min.js
    ├── templates/
        ├── JINJA2 PAGE TEMPLATES

Models Included:

  • User

    • Stores unique username, password and email address (optional). Note: username will always be made to start with a capital letter.
    • Stores additional information on liked post keys, disliked post keys, followed user keys and followers.
    • Each liked keys property uses a list of strings, corresponding to the post keys that the user liked/disliked or users that are followed.
  • Post

    • Post entity to store the details of each post created.
    • Stores information about each posts subject, content, date created, date modified, creator username, user liked keys, user disliked keys and comments.
    • Contains many class methods for post functionality, including post deletion, post like/dislike actions, post query and render.

Design Decisions

  • There are a whole host of means in which this blog application can be improved, which could be done rapidly through employing the use of effective frameworks such as Django or Flask, which then have a whole range of additional libraries and features for simplifying otherwise complicated tasks. I chose not to adopt that approach for this project however, since I wanted to experience the long winded and educational approach of learning the hard things from the bottom up, including creation of cookies, implementing a secure login system and creation of global session variables to use throughout all Jinja2 templates.
  • Rather than create a very simple post creation textarea form for user blog posts, I chose to create a full functioning rich text editor, since I felt this is an absolutely critical feature of a blog, allowing much more versatile and creative posts, albeit at a much higher complexity price for designing the application.
  • I created helper functions within models.py for both User and Post entities, as a means of making the entire blog functionality less complex for performing common actions such as liking/unliking posts and querying posts related to a user profile.

To-do for the future:

  • Convert the application to Flask, for efficient url Routeing and easing of trivial operations, such as global session variables and security enhancement.
  • Create a secure login system by implementing OAuth 2.0 and G+/Facebook.
  • Allow customization of personal user pages, through creation of a template entity, which stores the users personal configurations for their blog(s).
  • Allow user image uploads, so that post content and images for each post are actually related to the user, rather than a generic default image.

CREATOR

Benjamin Fraser

Credit to Udacity for the skeleton Python Google App Engine code. Built using Python and Google App Engine. Credit to Materialize framework for the HTML and CSS frontend of the application, Quill.js for the rich text editor functionality and SweetAlert for the custom JS user alerts.


About

A fully functional blog building tool built using Python and the Flask microframework, in conjunction with Google App Engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published