Skip to content

Dockerized mini social network API on Django REST Framework, PostgreSQL database and user activity imitation bot

Notifications You must be signed in to change notification settings

bohdan-yatsyna/SocioLink

Repository files navigation

SocioLink API


I've developed this REST API for a mini social network named "SocioLink", using Python and Django Rest Framework. It supports user registration, login, post creation, and post likes/unlikes, along with daily like analytics and user activity tracking. PostgreSQL is employed for effective and reliable database. Additionally, an automated bot is included to simulate user activities. Feel free to explore!

🔧 Technologies used:


  • Django Rest Framework
  • Django ORM
  • PostgreSQL
  • Docker

🧾 Features


  • JWT authentication 🔒
  • Detailed Documentation of all endpoints on "http://127.0.0.1:8000/api/doc/swagger/"
  • Totally Dockerized
  • Different permissions for different actions (allows user sign-ups, logins, post creations, and liking/unliking of posts. It also provides daily analytics on likes and user activity insights, such as the last login and request made.)

💾 Installation:


1. Clone the repository:

git clone https://github.com/bohdan-yatsyna/SocioLink
cd SocioLink

2. Create and activate virtual environment with requirements install:

🖥 Windows:

python -m venv venv
venv\Scripts\activate

💻 Linux/MacOS:

python -m venv venv
source venv/bin/activate

3. 🗝 Set up environment variables (using .env):

  • Create an empty .env file in the root folder of the project.
  • Copy the entire content of the .env.sample to your .env file.
  • Modify the placeholders in the .env file with your preferable environment variables.

4. 🐳 Run it with DOCKER:

  • DOCKER should be installed and opened.
docker-compose up --build

!!! Note, test data will be automatically loaded to the database !!!

Feel free to use next user credentials to test my app:

email: admin@admin.com
password: TestOne1.

🗝 For creating own admin user:

  • Check actual container id of the application with docker ps
  • Enter it to the next command and run docker exec -it <container_id> python manage.py createsuperuser

🗝 For creating standard user next endpoints will help:

  • User creating - send a POST request to /api/users/signup/
  • Obtain token - send a POST request to /api/users/login/

🗝 For Authorization:

  • Install ModHeader extension and create Request header "Authorize" with value: Bearer <Your access token>

🗝 For Bot parametrization:

  • Change bot/config.json with appreciable parameters

🕶 DEMO

Documentation with all endpoints:

sample_DOCUMENTATION

About

Dockerized mini social network API on Django REST Framework, PostgreSQL database and user activity imitation bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages