GithubHelp home page GithubHelp logo

social-network-api's Introduction

Social Network API

this is a simple REST API-based social network in Django where Users can sign up and create text posts and view, like, and unlike other Users’ posts.

Used Technical Tools

  • Django for the project.
  • Django-rest-framework library for API.
  • JWT for user authentication.
  • Celery for tasks.
  • Abstractapi for email validation, geolocation and holiday purposes.

General Requirements

Setup (macOS & Linux)

To try the project, set up a virtual environment and install the listed dependencies:

$ python3 -m pip install virtualenv
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ python3 -m pip install -r requirements.txt

Setup (Windows)

To try the project, set up a virtual environment and install the listed dependencies:

$ py -m pip install --user virtualenv
$ py -m venv venv
$ .\venv\Scripts\activate
(venv) $ py -m pip install -r requirements.txt

Once you've installed all the dependencies, you need to start three processes that need to run at the same time:

  1. API
  2. Redis
  3. Celery

To get all of them running, open three different terminal windows and start them one-by-one:

API:

(venv) $ python manage.py runserver

Redis server:

$ redis-server

Celery:

(venv) $ python -m celery -A social worker -l info

Project Docs

  • The API endpoints should be now running under http://127.0.0.1:8000/swagger (if port 8000 is available)

Authentication

  • Create account from: http://127.0.0.1:8000/user/register/.
  • Go to http://127.0.0.1:8000/user/login/ to get user token.
  • Then go to swagger authorize part and type: Bearer <YOUR_ACCESS_TOKEN>, now you are logged in.

Run Tests

  • To Run unit tests : python3 manage.py test.

Admin Dashboard

  • To access Admin dashboard : http://127.0.0.1:8000/admin and the admin credentials are: [email protected], admin@1234

social-network-api's People

Contributors

aliharby12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.