Skip to content

hatredholder/Social-Network

Repository files navigation

Pybook - Social Network

Pytest Coverage Status

An open-source Social Network project called Pybook written in Django.

✨ Features

  • Authentication
  • Adding as a Friend
  • Post Feed
  • Profile Pages
  • Messaging between Users
  • Like and Comment on Posts
  • Notifications on Friend Requests
  • Search Users

🔎 Preview

image

📖 Instructions

Clone this repository, cd into it

git clone https://github.com/hatredholder/Social-Network.git
cd Social-Network

Start a new Virtualenv, activate it, install Python module requirements on it

virtualenv myenv
source myenv/bin/activate
pip install -r requirements/base.txt

Create a PostgreSQL database

CREATE DATABASE socialnetworkdb;

Create a .env file with enviroment variables of APP_SECRET, DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT

APP_SECRET=your_very_very_secure_secret_key
DB_NAME=socialnetworkdb
DB_USER=user
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432

Apply migrations to the database and run the Django server

python manage.py migrate 
python manage.py runserver

🧪 Testing

To use the tests you need to install local module requirements first, to do that, use:

pip install -r requirements/local.txt

To run the tests and check the coverage use:

pytest --cov

To generate an HTML coverage report use:

pytest --cov-report html:cov_html --cov

And finally to test the code quality (see if there are any PEP8 errors) use:

flake8

💻 Technologies

Frontend: CSS, Semantic UI

Backend: Django, a tiny bit of JavaScript

Database: PostgreSQL

Tests: Pytest, Pytest-Django

📋 To Do

Click to Open
  • Update comment delete button;

  • Add comments form to profile detail view;

  • Change messenger url from pk to slug;

  • Add 100% coverage tests;

  • Add followers count to profile detail;

  • Move to a local database instead of a online server;

  • Make navbar sticky;

  • Refactor all code (add comments everywhere they're needed, make sure all code is formatted by PEP8);

  • Add delete comment functionality;

  • Add messenger/chat functionality;

  • Add search bar functionality;

  • Add follow user functionality;

  • Hide posts of people that user doesn't follow/didn't add as a friend;

  • Add a welcome page for non-authorized users;