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.
- 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
- 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
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"]
- Python 3.13
- About 2 GB of free disk space for Python packages and the AI model
-
Create and activate a virtual environment:
python3 -m venv .runtime source .runtime/bin/activate -
Install the dependencies:
pip install -r requirements.txt
-
Create the local environment file:
cp .env.example .env
-
Replace the example
SECRET_KEYin.envwith a random value:python -c "import secrets; print(secrets.token_hex(32))" -
Start the application:
python main.py
-
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.
.
├── main.py
├── requirements.txt
├── website/
│ ├── __init__.py
│ ├── auth.py
│ ├── models.py
│ ├── views.py
│ └── templates/
└── instance/ # Local SQLite data; ignored by Git
The virtual environment, downloaded model, .env, SQLite database, and IDE
settings are intentionally excluded from Git.
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.