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.
- 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
- Python 3.10+
- PostgreSQL
- (Optional) Redis for caching/rate limiting
-
Install dependencies:
pip install -r requirements.txt
-
Set up your
.envfile in thebackenddirectory (see below for required variables). -
Run Alembic migrations to set up the database:
alembic upgrade head
-
Start the FastAPI server:
uvicorn main:app --reload
-
Open http://localhost:8000/docs for API documentation.
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
app/- Main FastAPI app, routers, models, schemas, logicalembic/- Database migrationsmiddleware/- Custom middleware (rate limiting, logging)requirements.txt- Python dependencies
You can use the provided docker-compose.yml for local development:
docker-compose up --buildMIT