A social photo-sharing web application built with Django and HTMX for dynamic interactions. Users can create accounts, share photos, and interact with posts through comments and replies.
- User Accounts: Create and manage user profiles.
- Photo Sharing: Upload and share photos with customizable posts.
- Comments & Replies: Engage with posts through comments and nested replies.
- Messaging: Send and receive encrypted messages between users.
- Django: Framework for server-side logic and database management.
- HTMX: Enhances user interactions with dynamic updates without full page reloads.
- Cryptography: Used for encrypting and decrypting messages.
-
Tag
- Categorizes posts.
- Fields:
name
,image
,slug
,order
. - Meta: Ordered by
order
.
-
Post
- Represents a photo post.
- Fields:
title
,artist
,url
,author
,image
,body
,likes
,tags
,created
,id
. - Meta: Ordered by creation date.
-
LikedPost
- Tracks which users liked which posts.
- Fields:
user
,post
,created_at
.
-
Comment
- Represents a comment on a post.
- Fields:
author
,parent_post
,body
,likes
,created_at
,id
. - Meta: Ordered by creation date.
-
LikedComment
- Tracks which users liked which comments.
- Fields:
user
,comment
,created_at
.
-
Reply
- Represents a reply to a comment.
- Fields:
author
,parent_comment
,body
,likes
,created_at
,id
. - Meta: Ordered by creation date.
-
LikedReply
- Tracks which users liked which replies.
- Fields:
user
,reply
,created_at
.
- Profile
- Extends the default
User
model with additional details. - Fields:
user
,realname
,image
,email
,location
,bio
,created
,gender
. - Methods:
__str__()
: Returns the user associated with the profile.avatar
: Returns the URL of the profile image or a default image.name
: Returns the real name or username.
- Extends the default
-
InboxMessage
- Represents a message sent between users.
- Fields:
sender
,Conversation
,body
,created_at
. - Methods:
body_decrypted
: Decrypts the message body.
- Meta: Ordered by creation date.
-
Conversation
- Represents a conversation between users.
- Fields:
id
,participants
,lastmessage_created
,is_seen
. - Meta: Ordered by last message creation date.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd <project-directory>
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser (optional):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the app at
http://localhost:8000
.
- Encryption Key: Set
ENCRYPT_KEY
in your Django settings to ensure secure message encryption.