Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pvnm4/Social-Media-Backend/llms.txt

Use this file to discover all available pages before exploring further.

The Social Media Backend is a production-ready REST API built with FastAPI, PostgreSQL, and SQLAlchemy. It provides everything you need to power a social media application: user registration and authentication, full CRUD for posts, and a vote/unvote system — all secured with JWT bearer tokens.

Quickstart

Run the API locally in under 5 minutes with a working PostgreSQL connection.

API Reference

Explore all endpoints — authentication, users, posts, and votes.

Configuration

Set up environment variables for your database, JWT secret, and more.

Deployment

Deploy to Render.com with a free PostgreSQL database in minutes.

What’s included

Authentication

OAuth2 password flow with JWT bearer tokens and bcrypt password hashing.

Posts

Create, read, update, and delete posts with ownership enforcement.

Votes

Vote and unvote on posts with conflict detection and aggregated counts.

Users

Register users with email validation and fetch user profiles by ID.

Database Migrations

Alembic-managed schema migrations for safe, version-controlled changes.

Architecture

Layered FastAPI + SQLAlchemy architecture with Pydantic v2 validation.

Tech stack

LayerTechnology
FrameworkFastAPI 0.136+
DatabasePostgreSQL via psycopg2
ORMSQLAlchemy 2.0
MigrationsAlembic
AuthPyJWT + passlib (bcrypt)
ValidationPydantic v2 + pydantic-settings
ServerUvicorn
The API requires Python 3.14+ and a running PostgreSQL instance. See Local Deployment to get your environment set up.

Build docs developers (and LLMs) love