Skip to content

dc8156046/fastapi-multi-user-blog-system

Repository files navigation

Multi-User Blog System

A multi-user blog system built with Python FastAPI, SQLAlchemy, and PostgreSQL, allowing users to create and manage blog categories, posts, comments, and likes.

Deployed on Render

https://fastapi-multi-user-blog-system.onrender.com

Features

  • User registration and authentication
  • Create, read, update, and delete blog categories and posts
  • Like and unlike blog post
  • Comment on posts with support for images
  • Like comments and track likes count
  • Secure API endpoints with JWT authentication

Tech Stack

  • Backend: FastAPI
  • Database: PostgreSQL
  • ORM: SQLAlchemy
  • Authentication: JWT (JSON Web Tokens)
  • Environment Management: Dotenv

Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Install Dependencies

pip install -r requirements.txt

Setup Environment Variables

Create a .env file in the root directory and add the following variables:

DATABASE_URL=postgresql://username:password@localhost:5432/fastapi_blog
SECRET_KEY=your_secret_key_here

Running the Application

You can run the application using Uvicorn:

uvicorn main:app --reload

Prerequisites

Make sure you have the following installed:

  • Python 3.7+
  • PostgreSQL
  • pip

Clone the Repository

git clone https://github.com/dc815606/fastapi-multi-user-blog-system.git
cd fastapi-multi-user-blog-system

Releases

No releases published

Packages

No packages published

Languages