Skip to content

A microblog-style Flask web app with user accounts, posts, full-text search, live translation, and social follow/unfollow. Deployed on Render.

Notifications You must be signed in to change notification settings

Mengtongg/Flask-Webpage

Repository files navigation

Microblog-Style Flask Web

Features

  • User auth: registration, login, logout, email password reset
  • Profiles: avatar, bio, last-seen, follower counts
  • Posts: create, pagination
  • Search: Elasticsearch full-text search on posts
  • Live translation: Microsoft translation API
  • Social: follow/unfollow users, personalized timeline
  • Security: CSRF protection, hashed passwords
  • Production-ready: .env, logging, error pages, deploy on Render

Live Demo

Screenshots

Home Page Home
Translate Function in Explore Page Translate
Search Function Search function
Profile
Profile
Edit Profile
Edit profile
Follow/Unfollow
Follow Unfollow
Sign In
Sign in
Register
Regiester
Password Reset
Password Reset

Tech Stack

  • Flask (routes,templates)
  • Flask-SQLAlchemy (ORM)
  • Flask-WTF (forms/CSRF)
  • Flask-babel (Text translation)
  • Flask-mail (emails)
  • Flask-moment (time)
  • Flask-Migrate (schema changes)
  • Flask-Login (auth)
  • Elasticsearch (Search)
  • Jinja2 (views)
  • Bootstrap (UI)
  • Gunicorn (depoly)
  • Render (deploy)

Prerequisites

  • python-3.11.9
  • pip

Project Structure

app/ package with blueprints:

  • auth (login, logout, register, reset password)
  • main (home, explore, posts, profiles, follow)
  • errors (errorhandler)

Local Developement

  1. Clone & create venv
  2. Create .env
  3. Initialize DB
  4. Flask run

Search (Elasticsearch)

  • Local: if ELASTIC_HOST is set (http://localhost:9200) and ES is running, the app indexes/searches with ES.
  • Render: If ES is not available: indexing is safely skipped and search falls back to a simple SQL LIKE so the UI still works. No crashes.

Email (Password Reset)

  • Local: set EMAIL_ENABLED=1, http://localhost:8025
  • Render: set EMAIL_ENABLED=0, most real email providers require a verified account (often paid or limited free tier)

Translator (Live Translation)

  • Microsoft translator in Azure
  • MS_TRANSLATOR_KEY=your-translator-key

Deploy to Render

  1. Push to GitHub
  2. Pick your repo
  3. Build command: pip install -r requirements.txt
  4. Start command: bash start.sh
  5. Manage environment

Attribution

Built by following <Tutorial Title/Author/Link> with custom features

About

A microblog-style Flask web app with user accounts, posts, full-text search, live translation, and social follow/unfollow. Deployed on Render.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages