Projects · Built

MoodShare

A small social app for sharing short thoughts and moods, following people, and reading a personalized feed.

PythonFlaskSQLAlchemyTailwind CSSSQLite / PostgreSQLJWT
MoodShare screenshot

Overview

What it does

MoodShare lets people share short posts, follow other users, and see a personalized feed. Posts are limited to 140 characters in the current API.

How it works

Architecture

Web interface

  1. Browser
  2. Flask routes and Jinja templates
  3. SQLAlchemy models
  4. SQLite or PostgreSQL

REST API

  1. API client
  2. Flask API blueprint and JWT check
  3. SQLAlchemy models
  4. SQLite or PostgreSQL

Data

Data model

  • User → Post is one-to-many; each post stores its author's user_id.
  • User ↔ User follows are stored in the followers association table.
  • User ↔ Post likes are stored in the likes association table.

Interfaces

API design

  • POST /api/auth/login issues a JWT for an API client.
  • GET /api/posts returns paginated posts; POST /api/posts creates one.
  • POST and DELETE /api/posts/{id}/like add or remove a like.
  • The API blueprint applies token authentication to protected routes.

Implementation

Design notes

The codebase separates page routes, API routes, and SQLAlchemy models. The Flask app factory registers the API blueprint and exempts its token-authenticated routes from form CSRF checks.