Skip to content

Repository files navigation

Fame Social Network

A Django-based social network integrating a fame (skill profile) system to combat misinformation — built as a university project for the Big Data Engineering course at Saarland University (Summer 2026, Prof. Dr. Jens Dittrich).

The skeleton application (data models, basic views, fake data generation, magic AI classifier) was provided by the university. All feature implementations listed below were written by me.

The base skeleton is © Prof. Dr. Jens Dittrich, Saarland University, licensed under CC BY-NC 4.0.


Concept

Every user has a fame profile — a set of skill levels across expertise areas (e.g. "Quantum Physics: Pro", "Sports: Bullshitter"). Posts are classified by a topic-detection algorithm and cross-checked against the author's fame profile. Users who post misinformation have their fame lowered automatically; persistent offenders are banned.


What I Implemented

API (socialnetwork/api.py)

Post submission logic (submit_post)

  • Posts are blocked from publishing if the author has negative fame in any of the post's expertise areas
  • When a post gets a negative truth rating, the author's fame in that area is automatically lowered to the next level
  • If the expertise area is new to the user's profile, a "Confuser" entry is added
  • If fame cannot be lowered further, the user is banned: is_active set to False, all their posts unpublished, session terminated
  • When fame drops below Super Pro (100), the user is automatically removed from the corresponding community

Bullshitters (bullshitters)

  • Returns a dictionary mapping each expertise area to a ranked list of users with negative fame in that area
  • Sorted by fame level ascending (worst first), ties broken by date_joined descending

Community system (join_community, leave_community)

  • Users with fame ≥ Super Pro (numeric value 100) in an expertise area can join that area's community
  • Community membership is tracked via a ManyToMany relationship on SocialNetworkUsers

Community mode timeline (timeline)

  • Standard mode: shows posts from followed users
  • Community mode: shows only posts where both the author and the viewer share at least one community, using a correlated subquery (EXISTS) for efficiency

Similar users (similar_users)

  • Computes a similarity score between the logged-in user and every other user
  • Score = fraction of the user's expertise areas where the fame values differ by ≤ 100
  • Results returned as an annotated QuerySet sorted by similarity descending, ties broken by date_joined

Views (socialnetwork/views/html.py)

  • Bullshitters page — renders api.bullshitters() grouped by expertise area
  • Similar users page — renders api.similar_users() as a ranked table with links to fame profiles
  • Community controls — join, leave, and toggle community mode; all update the timeline immediately
  • Timeline — extended to show current mode, joinable communities, and communities the user is already in

Templates

  • timeline.html — community mode toggle button, "My Communities" panel with leave buttons, "Communities You Can Join" panel with join buttons
  • bullshitters.html — grouped table per expertise area, sorted by fame level
  • similar_users.html — ranked table with similarity score and link to each user's fame profile
  • base.html — added navigation links for Bullshitters and Similar Users
  • index.html (URIs page) — added links to all implemented HTML views

Skills Demonstrated

  • Relational database design — multi-table inheritance, ManyToMany with custom through-tables, self-referencing foreign keys (expertise area hierarchy)
  • Django ORMannotate, Case/When, Exists, OuterRef, select_related, Q objects, correlated subqueries
  • Query optimisation — avoided N+1 queries using select_related and bulk lookups; used EXISTS instead of JOINs where only existence matters
  • Database consistency — understood atomicity issues in multi-step operations (ban + unpublish + post save)
  • Django auth — session management, is_active flag, login/logout flow

Installation

You need pipenv:

pip install --user pipenv
pipenv install        # creates virtualenv and installs dependencies (Python 3.12)
pipenv shell          # activates the virtualenv

Running

# Recreate database, migrations, and fake data
bash recreate_models_and_data.sh

# Start the development server
python manage.py runserver
# → http://127.0.0.1:8000/

Tests

python manage.py test

Tests use the fixture database_dump.json. Login credentials for the test user: a@b.de / test.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages