Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network

FastAPI Social Network

Overview

FastAPI Social Network is a simple social media platform built with FastAPI, SQLAlchemy, and PostgreSQL. It supports user authentication, posting, commenting, liking, and notifications.

Features

  • User Registration and Authentication (JWT)
  • Create, Read, Update, Delete (CRUD) Posts
  • Comment on Posts
  • Like/Unlike Posts
  • User Profiles
  • Notifications for User Actions

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/fastapi-social-network.git
    cd fastapi-social-network
  2. Create and activate a virtual environment:

    python -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up the database and environment variables:

    • Create a .env file in the root directory and add your database URL and secret key:
      DATABASE_URL=postgresql://user:password@localhost/dbname
      SECRET_KEY=your_secret_key
      
  5. Run the database migrations:

    alembic upgrade head
  6. Start the FastAPI server:

    uvicorn app.main:app --reload
  7. Access the API documentation at http://127.0.0.1:8000/docs.

Project Structure

fastapi_social_network/
├── app/
│   ├── __init__.py
│   ├── main.py
│   ├── models.py
│   ├── schemas.py
│   ├── crud.py
│   ├── database.py
│   ├── dependencies.py
│   └── security.py
├── images/
│   └── social_network.jpg
├── .env
├── requirements.txt
└── README.md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages