This project is an implementation of a social network website for making posts and following users, built using Django and JavaScript.
This web application allows users to:
- Post text-based updates to a global feed.
- Follow and unfollow other users to customize their feed.
- "Like" and "Unlike" posts dynamically.
- Edit their own posts without reloading the page.
- View detailed user profiles with follower and following counts.
- Navigate through posts using a server-side pagination system.
⚙️ To run this project locally, follow these steps:
-
Clone the repository:
git clone [https://github.com/saidbaraou/network.git](https://github.com/saidbaraou/network.git) cd network -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On macOS and Linux # venv\Scripts\activate # On Windows
-
Install the dependencies:
pip install -r requirements.txt
-
Make migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser (for admin access):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Open your web browser and navigate to
http://127.0.0.1:8000/to view the application.
- All Posts: A feed showing all posts from all users, ordered by newest first.
- Following Feed: A dedicated view showing only posts from users the current user follows.
- Profile Page: Displays a user's post history, follower count, and following count.
- Edit Post: Inline editing functionality using JavaScript and the Fetch API.
- Like System: Asynchronous like/unlike toggle with real-time counter updates.
- Pagination: Efficiently displays 10 posts per page to improve performance.
- Data Integrity: Database-level constraints to ensure a user can only like a post once.
This project could be further enhanced with features such as:
- Image and video upload support for posts.
- Direct messaging system between users.
- Real-time notifications for likes and new followers.
- Hashtag support and trending topic discovery.
- Dark mode and customizable user themes.