Skip to content

About

Full-stack Flask blog platform with authentication, saved posts, and private local AI summarization

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

BlogMaster

Python Flask AI Usage

A full-stack Flask application for publishing and discovering blog posts, with account management, saved posts, and private, on-device AI summarization. Post content stays on the local machine instead of being sent to an external AI API.

Features

  • Register, sign in, and manage a profile
  • Create, edit, delete, and save blog posts
  • Summarize posts longer than 200 words
  • Run the summarization model locally without sending post content to an API

Technology

  • Backend: Python, Flask, Flask-Login, Flask-SQLAlchemy
  • Database: SQLite with SQLAlchemy models
  • Frontend: Jinja templates, Bootstrap, JavaScript
  • AI: Hugging Face Transformers, PyTorch, DistilBART
  • Security: Password hashing, CSRF protection, protected routes, secure cookie defaults, and environment-based secrets

How it works

flowchart LR
    Browser["Browser / Jinja UI"] --> Flask["Flask routes"]
    Flask --> Auth["Flask-Login"]
    Flask --> DB["SQLite / SQLAlchemy"]
    Flask --> AI["Local DistilBART model"]
    AI --> Cache["Project-local model cache"]
Loading

Requirements

  • Python 3.13
  • About 2 GB of free disk space for Python packages and the AI model

Local setup

  1. Create and activate a virtual environment:

    python3 -m venv .runtime
    source .runtime/bin/activate
  2. Install the dependencies:

    pip install -r requirements.txt
  3. Create the local environment file:

    cp .env.example .env
  4. Replace the example SECRET_KEY in .env with a random value:

    python -c "import secrets; print(secrets.token_hex(32))"
  5. Start the application:

    python main.py
  6. Open http://127.0.0.1:5000.

The sshleifer/distilbart-cnn-6-6 model downloads into .model-cache the first time summarization is used. The first summary may take longer while the model loads; subsequent summaries are faster. Downloads are pinned to an immutable model revision for reproducibility and supply-chain safety.

For local development, set FLASK_DEBUG=1. When serving over HTTPS, set SESSION_COOKIE_SECURE=1.

Project structure

.
├── main.py
├── requirements.txt
├── website/
│   ├── __init__.py
│   ├── auth.py
│   ├── models.py
│   ├── views.py
│   └── templates/
└── instance/              # Local SQLite data; ignored by Git

Local files

The virtual environment, downloaded model, .env, SQLite database, and IDE settings are intentionally excluded from Git.

Usage

Copyright (c) 2026 krishy0305. All rights reserved.

This repository is public for portfolio review and evaluation only. No permission is granted to copy, modify, distribute, sublicense, sell, or reuse the code without prior written permission. See LICENSE.

About

Full-stack Flask blog platform with authentication, saved posts, and private local AI summarization

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages