An open API service indexing awesome lists of open source software.

https://github.com/ehtisham-sadiq/social-content-api

API for the Linkedin-CMS project, a modern LinkedIn content management and scheduling platform.
https://github.com/ehtisham-sadiq/social-content-api

alembic apidog fastapi jwt-authentication pos sqlalchemy

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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:
```sh
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:
```sh
alembic upgrade head
```

4. Start the FastAPI server:
```sh
uvicorn main:app --reload
```

5. Open [http://localhost:8000/docs](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:

```sh
docker-compose up --build
```

## License
MIT