Skip to content

angad-singhh/BlogApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RESTful API for Blog APP

This project allows you to perform CRUD operation on Blog, add comment to a blog, like and dislike the blog with User registration. The API made using Python-FastAPI, MongoDB as database.

High level ER Diagram

Screenshot 2024-09-16 213953

Setting up locally

Clone this repository locally by using the below link:

https://github.com/angad-singhh/BlogApp.git

Create a virtual environment and Install the required dependencies :-

pip install -r requirements.txt

Run the application server on port 8000:

fastapi dev main.py 

Data Models

Blog Model

class Blog(BaseModel):
    title: str
    authorID: str
    content: str
    tags: list[str]
    curr_date: str
    blog_id: 

Comment and Like Model

class Comments(BaseModel):
    content: str
    user_id: str
    comment_id: str
    blog_id: str


class Likes(BaseModel):
    user_id: list[str] = []
    blog_id: str

User Model

class User(BaseModel):
    name: str
    email: EmailStr
    user_id: str

API Endpoints

Documentation for API endpoints and schemas can be accessed on:

http://localhost:8000/docs

Blog Endpoints

Screenshot 2024-09-16 203803

Comment Endpoints

Screenshot 2024-09-16 203815

Like Endpoints

Screenshot 2024-09-16 203826

User Endpoints

Screenshot 2024-09-16 203842

Connect with ME:

angad-singhh

angad.singh2605@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages