Skip to content

tahfimism/posta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Posta

A sleek social media platform for sharing, connecting, and vibing.

Screenshot_4-7-2025_224138_127 0 0 1


Core Vibe

Posta lets users drop short text posts, follow others, and engage with content in a slick, dynamic interface. Create, edit, and like posts without clunky page reloads.


Features

1. Auth:

  • ๐ŸŸข Register: New users join the party.
  • ๐Ÿ” Login/Logout: Secure sign-in and sign-out.

2. Post Power

  • โœ๏ธ Create: Authenticated users post from the main or profile page.
  • ๐Ÿ“œ View All: Paginated feed of everyone's posts.
  • โœ๏ธ Edit: Tweak your posts dynamically with JS.
  • โค๏ธ Like/Unlike: Like or unlike posts with real-time count updates.

3. Social Sparks

  • ๐Ÿ‘ค Profiles: Show off your posts, followers, and following stats.
  • ๐Ÿค Follow/Unfollow: Connect or disconnect from user profiles.
  • ๐Ÿ“ฐ Following Feed: Chronological posts from those you follow.

4. Smooth Frontend

  • โšก Dynamic Frontend: JavaScript + Fetch API for seamless post creation, editing, liking, and following.
  • No page refreshes, just pure flow.

Tech Breakdown

Backend (Django)

  • Models:
    • ๐Ÿง‘ User: Extends AbstractUser with a followers/following system.
    • ๐Ÿ“ Post: Tracks content, author, timestamp, likes, and likers.
  • Views & URLs:
    • Function-based views for HTML rendering (index, profile, login).
    • API endpoints (edit_post, like_post, follow_user) return JsonResponse.
  • Security:
    • ๐Ÿ”’ @login_required locks down sensitive views.
    • ๐Ÿ›ก๏ธ @csrf_exempt for API endpoints, secured by session checks.
    • Post edits verify ownership.
  • Pagination:
    • ๐Ÿ“„ 10 posts per page for "All Posts", "Following", and profiles.

Frontend

  • ๐ŸŽจ Templates: Django Templating with layout.html for consistency.
  • ๐Ÿ’… Styling: Bootstrap for a clean, responsive look.
  • ๐Ÿš€ JavaScript (network/static/network/index.js):
    • Handles dynamic actions (edit, like, follow) with the fetch API.
    • Updates DOM for instant feedback.

API Endpoints

Powering the dynamic frontend with REST-like vibes:

  • POST /new_post/: Drop a new post.
  • PUT /edit_post/<int:post_id>: Update your post.
  • PUT /like_post/<int:post_id>: Toggle post likes.
  • PUT /follow/<int:user_id>: Toggle follow status.
  • GET /load_posts/<str:filter>: Fetch posts (not primary JS logic).

Built for speed, style, and connection. Postaโ€™s where itโ€™s at.

About

Social media site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published