Social network where you can share your thoughts and sell or buy whatever you want.
Explore the docs »
Table of Contents
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.
- Token authentication
- Publication operations
- Commentary operations
- Python
- MongoDB
- FastApi
- Cloudinary
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>
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
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.
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
.