This repository contains the backend implementation for a social media application using FastAPI. The backend provides endpoints for user authentication, posting, commenting, and other social media functionalities.
- User Authentication (Signup, Login)
- Create, Read, Update, Delete (CRUD) operations for posts
- Like and Unlike posts
- JWT token-based authentication
- FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
- SQLAlchemy: SQL toolkit and Object-Relational Mapping (ORM) library for Python.
- PostgreSQL: A powerful, open source object-relational database system.
- JWT: JSON Web Tokens for secure user authentication.
-
Clone the repository
git clone https://github.com/Vishak-V/Social-Media-Backend-FastAPI.git cd Social-Media-Backend-FastAPI -
Create and Activate a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Set up the PostgreSQL database
Create a PostgreSQL database and update the DATABASE_URL in the config.py file with your database credentials.
-
Start the FastAPI server
uvicorn main:app --reload
The server will be available at http://127.0.0.1:8000