Skip to content

Express Article is a Backend for Blog app with various endpoints including user management, Blog and User Dashboard powered by Mongodb as the database

Notifications You must be signed in to change notification settings

Siddharth-Xenon/ExpressArticle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EXPRESS Article RESTAPi with FastAPi

Express Article is a Backend for Blog app with various endpoints including user management, Blog and User Dashboard powered by Mongodb as the database

Deployement

The API is deployed on Render and can be accessed at https://expressarticle.onrender.com.

SETUP

  • Set Up a Virtual Environment
    • For Windows:
      python -m venv my_venv
      .\my_venv\Scripts\activate
      
    • For Unix or MacOS:
      python3 -m venv venv
      source venv/bin/activate
      
  • Install the necessary dependencies
pip install -r requirements.txt  
  • Create an .env file
MONGO_USER=sidsolanki920
MONGO_PASS=8493
  • Run the server
cd ./app
uvicorn src:main:app --reload
  • If everything went fine, Success message will be logged and server will listen on port 8000

Usage

Endpoints

1. Authentication
  • Path: /login
  • Methods: POST (Login)
  • Authorization: None
  • Description: User login
     
  • Path: /register
  • Method: POST
  • Authorization: None
  • Description: Register a new user
2. User
  • Path: /user/update
  • Method: PUT
  • Authorization: Requires a valid JWT token.
  • Description:  
  • Path: /user/profile
  • Method: GET
  • Authorization: Requires a valid JWT token.
3. Blogs
  • Path: blog/dashboard
  • Method: GET
  • Authorization: Requires a valid JWT token.
     
  • Path: /blogs?page=..&limit=.. Page and limit are intergers for pagination
  • Methods: GET
  • Authorization: None
     
  • Path: /blogs/retrieve/{blog_id} blog_id corresponds to unique id of the blog
  • Method: GET
  • Authorization: None
     
  • Path: /blogs/create
  • Method: POST
  • Authorization: Requires a valid JWT token.
     
  • Path: /blogs/update/{blog_id} blog_id corresponds to unique id of the blog
  • Method: PUT
  • Authorization: Requires a valid JWT token and should be the author
     
  • Path: /blogs/remove/{blog_id} blog_id corresponds to unique id of the blog
  • Method: DELETE
  • Authorization: Requires a valid JWT token and should be the author

Authorization and Access Permissions are done with FastApi Dependencies

Docker

To run it as a container, Simply Run

docker-compose up

If current user is in docker group, Following is enough

docker-compose up

About

Express Article is a Backend for Blog app with various endpoints including user management, Blog and User Dashboard powered by Mongodb as the database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published