Giter Site home page Giter Site logo

socialmediaapi's Introduction

Social Media API

Social Media API built using FastAPI

Public REST API

https://fastapi-social-media-api.herokuapp.com/

Features

  1. OAuth Authentication using JWT Token and Expiry Time.
  • Login with credentials.
  1. User :-
  • Create a user.
  • Get all users.
  • Get a specific user by its id.
  • Update a user.
  • Delete a user.
  1. Post :-
  • Get all posts.
  • Get a specific post by its id.
  • Things only Registered and Authorized User can perform.
    • Create a post.
    • Update a post.
    • Delete a post.
  1. Vote :-
  • Only Register and Authorized User's can Vote on any post.

Local Setup

  1. Create a virtual environment using the command :-
  virtualenv venv
  1. Now install all the requirements using the command :-
  pip3 install -r requiremnts.txt
  1. Now add the .env file in the root directory and add values to the folloing keys :-
  DATABASE_HOSTNAME=
  DATABASE_PORT=
  DATABASE_PASSWORD=
  DATABASE_NAME=
  DATABASE_USERNAME=
  SECRET_KEY=
  ALGORITHM=
  ACCESS_TOKEN_EXPIRE_MINUTES=
  1. Now just run the command :-
    uvicorn app.main:app --reload
  • Lets Break this command in pieces to understand this uvicorn command.
    • Uvicorn is an ASGI web server implementation for Python. Learn more about Uvicorn
    • app is the parent directory for the main file (Note :- any other name can also be given to the directory as well as to the main file).
    • app.main:app at last app is the instance of the fastAPI.
    • --reload flag is used so that if any changes occur server gets reload by itself and the changes could get visible.

socialmediaapi's People

Contributors

hitesh22rana avatar

Stargazers

 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.