r3gor / fastapi-publication-api

Social network where you can share your thoughts and sell or buy whatever you want.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Publications API

Social network where you can share your thoughts and sell or buy whatever you want.
Explore the docs »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Documentation

About The Project

Social network where you can share your thoughts and sell or buy whatever you want. This API handles publications and commentaries. It uses token-based authentication which are provided by the Users API.

Features

  • Token authentication
  • Publication operations
  • Commentary operations

Tech used

  • Python
  • MongoDB
  • FastApi
  • Cloudinary

Getting Started

Prerequisites

In order to get started and run the project you have to meet certain prerequisites:

  • Python 3.8 or newer
  • A MongoDB cluster
  • A Cloudinary account

Next, create a .env file and fill the next fields

MONGODB_URI=<mongodb_uri>
SECRET_KEY=<jwt_secret>
ALGORITHM=<hashing_algorithm>
CLOUD_NAME=<cloudinary_cloud>
API_KEY=<cloudinary_public_key>
API_SECRET=<cloudinary_secret_key>

Installation

First, create an environment and activate it

python -m venv env
./env/Scripts/Activate.ps1

Install the dependencies

python -m venv env
pip install -r requirements.txt

Usage

Run the project with uvicorn

uvicorn --port 5000 --host 127.0.0.1 main:app --reload

If everything is in order you can now make requests to localhost:5000.

You can also check the documentation here.

Documentation

FastAPI comes with Swagger out of the box and generates the documentation for all your endpoints. You can check the generated documentation on localhost:5000/docs.

About

Social network where you can share your thoughts and sell or buy whatever you want.


Languages

Language:Python 100.0%