Skip to content

guiklose/simple-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 Social Network Fullstack Application – CS50W

A simple social network application built with Django during the Harvard CS50w course.

📐 Specification

📝 New Post

  • Signed-in users can write and submit a new post via a text area and a submit button.
  • This can be implemented either:
    • At the top of the All Posts page (as in the provided screenshot), or
    • On a separate New Post page.

📰 All Posts

  • The “All Posts” page (linked in the navigation bar) shows all user posts.
  • Posts should be:
    • Ordered most recent first.
    • Include:
      • Poster’s username
      • Content
      • Date/time posted
      • Number of likes (initially 0)

👤 Profile Page

  • Clicking a username leads to their profile page.
  • This page displays:
    • Number of followers
    • Number of people the user follows
    • The user’s posts in reverse chronological order
  • If the visitor is signed in and viewing another user’s profile:
    • Display a “Follow” or “Unfollow” button.
  • ⚠️ A user should not be able to follow themselves.

👥 Following

  • The “Following” page (in the nav bar) shows posts made by users that the current user follows.
  • Page should:
    • Work like All Posts, but filtered to followed users.
    • Be available only to signed-in users.

📄 Pagination

  • Pages showing posts must display 10 posts per page.
  • If more than 10:
    • Show a “Next” button to view older posts.
    • If not on the first page, show a “Previous” button.

✏️ Edit Post

  • Users can click an “Edit” button/link on their own posts.
  • Upon clicking:
    • Post content turns into a textarea.
    • User can edit and save changes.
  • Use JavaScript to update the content asynchronously (without full page reload).
  • 🔐 Ensure that only the original poster can edit their post.

❤️ Like / Unlike

  • Users can toggle a “Like” or “Unlike” button on any post.
  • On click:
    • Use JavaScript fetch to update the like count asynchronously.
    • Post’s displayed like count should update without reloading the page.

⚙️ Setup Instructions

Follow these steps to set up and run the Django project locally:

📁 1. Clone the Repository

git clone <https://github.com/guiklose/simple-network.git>
cd <simple-network>

🐍 2. Create and Activate a Virtual Environment

🔵 On macOS/Linux:
python3 -m venv venv
source venv/bin/activate
🟢 On Windows (CMD):
python -m venv venv
venv\Scripts\activate

📦 3. Install Dependencies

pip install -r requirements.txt

🛠️ 4. Apply Migrations

python manage.py makemigrations
python manage.py migrate

👤 5. Create a Superuser (Optional, for Admin Interface)

python manage.py createsuperuser

🚀 6. Run the Development Server

python manage.py runserver

Open your browser and go to: http://127.0.0.1:8000/

About

A simple social network application built with Django during the Harvard CS50w course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published