Skip to content

Dr00pyd00/Level-2-Project-Fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Level 2 Project – FastAPI Blog API

Description

This is a API project build with FastAPI et PostfgreSQL, you can :

  • Register, add user (JWT Authentication)
  • Create, Read, Updated and Delete posts
  • Likes system
  • Main page can filter the post (likeds, owners)
  • Use Alembic for updated the database

Installation

1. Cloner le projet

git clone git@github.com:Dr00pyd00/Level-2-Project-Fastapi.git
cd Level-2-Project-Fastapi

2. Create virtual env:

python -m venv venv
source venv/bin/activate   # Linux/Mac
venv\Scripts\activate      # Windows

# install dependences:
pip install -r requirements.txt

3.Setup Environnements for variables:

Create .env File in the root and :

DATABASE_URL=postgresql://user:password@localhost:5432/blog_db
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

4. Start running server:

uvicorn app.main:app --reload
# or use fastapi dev tool:
fastapi dev

API url :

Swagger Docs


Routes:

Users:

  • POST Create user
  • POST Login : give access token

Posts:

  • POST Create a post
  • GET get all posts ( possible filter 'liked' / 'owner' )
  • Get get one post by ID
  • PUT update a post by ID
  • DELETE delete a post by ID

Likes:

  • POST toogle like button: like or unlike

Technos:

  • FastAPI
  • SQLAlchemy + Alembic
  • PostgreSQL
  • JWT Auth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published