Skip to content

heavsta/flasky-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Flasky Blog

Description:

A simple blog built along with the Flask framework.

UI partly done with the css framework Bulma.

The app has been restructured with Blueprints for better readability.

Design choices:

  • User session management handled with Flask-Login.
  • Encryption of passwords with the Flask-Bcrypt extension.
  • Forms were created with the WTForms library.
  • SQLite Database built with the Flask-SQLAlchemy extension.
  • Email sending through Flask-Mail - 15min token generated each time requested.

Installation:

Install with pip:

$ pip install -r requirements.txt

To run the app correctly you will need to set up a couple environment variables:

  • SECRET_KEY
  • SQLALCHEMY_DATABASE_URI #i.e. "sqlite:///flasky_blog.db"
  • EMAIL_USER
  • EMAIL_PWD

Run: flask run

Application Structure

.
├── app
│   ├── articles
│   │   ├── forms.py
│   │   ├── __init__.py
│   │   ├── routes.py
│   │   └── utils.py
│   ├── categories
│   │   ├── forms.py
│   │   ├── __init__.py
│   │   └── routes.py
│   ├── config.py
│   ├── errors
│   │   ├── handlers.py
│   │   └── __init__.py
│   ├── flasky_blog.db
│   ├── __init__.py
│   ├── main
│   │   ├── __init__.py
│   │   └── routes.py
│   ├── models.py
│   ├── static
│   │   ├── article_img
│   │   ├── favicon.ico
│   │   ├── profile_img
│   │   │   ├── default.jpg
│   │   ├── script.js
│   │   └── styles.css
│   ├── templates
│   │   ├── account.html
│   │   ├── create_category.html
│   │   ├── create_post.html
│   │   ├── errors
│   │   │   ├── 403.html
│   │   │   ├── 404.html
│   │   │   └── 500.html
│   │   ├── index.html
│   │   ├── layout.html
│   │   ├── list_category.html
│   │   ├── list_post.html
│   │   ├── login.html
│   │   ├── post.html
│   │   ├── register.html
│   │   ├── reset_request.html
│   │   ├── reset_token.html
│   │   └── user.html
│   └── users
│       ├── forms.py
│       ├── __init__.py
│       ├── routes.py
│       └── utils.py
├── flasky_blog.db
├── README.md
├── requirements.txt
└── run.py

Improvements that could be done:

  • Implement a search bar
  • Let the user filter posts by categories
  • Integrate Flask-Admin to let the main admin of the blog to easily control the db