Skip to content

Repository files navigation

social-content-api (Linkedin-CMS Backend)

This is the backend API for the Linkedin-CMS project, a modern LinkedIn content management and scheduling platform. Built with FastAPI, SQLAlchemy, Alembic, and PostgreSQL.

Features

  • User authentication (JWT)
  • LinkedIn OAuth integration
  • Post creation, editing, scheduling, and analytics
  • Bulk upload and scheduling
  • Template management
  • Redis caching and rate limiting
  • RESTful API with OpenAPI docs

Getting Started

Prerequisites

  • Python 3.10+
  • PostgreSQL
  • (Optional) Redis for caching/rate limiting

Installation

  1. Install dependencies:

    pip install -r requirements.txt
  2. Set up your .env file in the backend directory (see below for required variables).

  3. Run Alembic migrations to set up the database:

    alembic upgrade head
  4. Start the FastAPI server:

    uvicorn main:app --reload
  5. Open http://localhost:8000/docs for API documentation.

Environment Variables

Create a .env file in the backend directory with the following variables:

DATABASE_URL=postgresql://postgres:postgres@localhost/linkedin_content_manager
SECRET_KEY=your_secret_key
CORS_ORIGINS=http://localhost:3000
LINKEDIN_CLIENT_ID=your_linkedin_client_id
LINKEDIN_CLIENT_SECRET=your_linkedin_client_secret
LINKEDIN_REDIRECT_URI=http://localhost:8000/api/linkedin/callback
REDIS_URL=redis://localhost:6379/0
REDIS_ENABLED=False

Project Structure

  • app/ - Main FastAPI app, routers, models, schemas, logic
  • alembic/ - Database migrations
  • middleware/ - Custom middleware (rate limiting, logging)
  • requirements.txt - Python dependencies

Running with Docker

You can use the provided docker-compose.yml for local development:

docker-compose up --build

License

MIT

About

API for the Linkedin-CMS project, a modern LinkedIn content management and scheduling platform.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages