Skip to content
Taveras Solutions · Go to home
Book a diagnostic

Public codePython / Django

SocialStarter

A Django template for building a social network.

It ships the core pieces of a social network: posts, a feed, followers, likes, comments, direct messages, and real-time notifications. Use it to start a product or to study how a social network works inside.

Stars
30
Forks
14
Language
Python / Django
License
No license (all rights reserved)
SocialStarter feed with the post composer, a post with comments, and the quick links sidebar.
30
GitHub stars
14
repository forks
9
Django apps, one per responsibility
2024
year the code went public

The challenge

Anyone who wants to launch their own community, or understand how a social network works inside, runs into many pieces that depend on each other: accounts, followers, posts, likes, comments, messages, and notifications. Starting from scratch means weeks solving what every network has already solved.

Tutorials usually cover a single piece, like a feed or a login, but not how all of them connect in one project.

What we built

SocialStarter splits each responsibility into its own Django app: users, relationship, posts, feed, interactions, messaging, notifications, and settings. Each has its own models and views, and they connect without getting tangled, so the code is easy to read and any part is easy to swap.

Sign-in uses django-allauth. Posts take text, an image, or a video, and the feed loads five at a time as you scroll. Followers work through requests that get accepted, and direct messages are grouped into conversations with an inbox and an unread count.

Notifications arrive in real time: a Django Channels consumer opens a per-user group over WebSocket and pushes each notice and the unread count without a page reload. The interface uses Tailwind and Alpine.js, with no separate frontend framework.

What it looks like

Feed with posts from demo users, likes, and comments.
The feed: post, comment, and like from the same screen.
Profile with cover, avatar, bio, post and follower counts, and follow and message buttons.
Profile with a cover, followers, and a direct path to messages.
List of notifications for likes, comments, follows, and messages, with an icon per type.
Notifications by type, delivered live over WebSocket.
Direct message conversation between two demo users.
Direct messages grouped into conversations.

WHO IT'S FOR

  • Developers who want a Django base for a community, a social forum, or an internal network, without writing followers, messages, and notifications from scratch.
  • Students and teams who want to see how the pieces of a social network connect in a real, readable project.

WHAT IT DOES

  • Signup and login with django-allauth.
  • Posts with text, images, or video, and a feed that loads more as you go.
  • Likes and comments on every post.
  • Followers with requests that get accepted.
  • Direct messages between users, with an inbox and conversations.
  • Real-time WebSocket notifications with Django Channels, plus theme, language, and privacy settings.

How it's built

  1. Accounts and relationships django-allauth for access and the relationship app for following and accepting requests.
  2. Posts and feed The posts and feed apps store content and serve it in chronological order, five at a time.
  3. Interactions The interactions app handles likes and comments on each post.
  4. Messaging The messaging app groups messages into conversations between participants.
  5. Notifications A Django Channels consumer opens a group per user and pushes notifications and the unread count.

Stack

DjangoPythonWebSocketsTailwindAlpine.jsRedis

Why we built it

It started as a template for building social networks and as material for understanding how they work inside, with each responsibility in its own app.

Getting started

git clone https://github.com/eriktaveras/SocialStarter.git && cd SocialStarter
pip install -r requirements.txt
python manage.py migrate && python manage.py createsuperuser
python manage.py runserver

WHAT WE LEARNED

  • One Django app per responsibility makes the project understandable from its folder list, and lets you change one piece without touching the rest.
  • Real time changes the infrastructure: WebSocket notifications need Django Channels and Redis in production, not just a web server.
  • Generic names in views need care: passing a variable called messages to the template hides the Django messages framework notices.

Need something like this built for you?

We use these same tools in our client projects.