Skip to content

Repository files navigation

OpenX Icon    OpenX Logo

Communities without boundaries.
A modern, Reddit-like social platform built with FastAPI.

Python Version FastAPI


Quick Start

Get up and running in seconds.

# Clone & install
git clone https://github.com/QluxLab/OpenX.git
cd OpenX
uv sync

# Run
uv run uvicorn src.app:app --reload --host 0.0.0.0 --port 8000

Docker:

docker build -t openx .
docker run -p 8000:8000 -v openx_data:/app/.data openx

What is OpenX?

OpenX is a self-hosted social platform inspired by Reddit. Create branches (communities), share posts, engage through comments, and build your own corner of the internet.

The Flow

graph LR
    A[User] -->|Auth| B(OpenX API)
    B -->|Create| C[Branches]
    B -->|Publish| D[Posts]
    B -->|Upload| E[Media CDN]
    C --> F[Community Feed]
    D --> F
    F -->|Subscribe| G[RSS Feeds]
    B -->|Integrate| H[MCP Server]
    style B fill:#8B5CF6,color:#FFF,stroke:#FFF
    style C fill:#3776AB,color:#FFF
    style E fill:#009688,color:#FFF
Loading

Features

Capability Description
Authentication Secret key-based auth with recovery keys and HttpOnly cookies.
Branches Subreddit-style communities with moderation tools and audit logs.
Posts Text, image, and video posts with threaded comments.
Media Uploads Image and video uploads served via CDN.
RSS Feeds Global, branch, and user-specific syndication.
MCP Server AI assistant integration via Model Context Protocol.

Configuration

Variable Default Description
OPENX_DEBUG false Enable debug mode
OPENX_DB_URL sqlite:///.data/openx.db Database URL
OPENX_CDN_URL http://localhost:8000/cdn CDN base URL
OPENX_CDN_PATH ./.data/uploads Upload storage path
OPENX_TRUSTED_PROXIES Comma-separated proxy IPs

API Reference

Authentication
Method Endpoint Description
POST /api/auth/new Create account
POST /api/auth/verify Login
POST /api/auth/recovery Recover account
POST /api/auth/logout Logout
Branches
Method Endpoint Description
POST /api/branch/create Create branch
GET /api/branch/{branch} Get branch info
POST /api/branch/{branch}/posts Create post
GET /api/branch/{branch}/posts List posts
Posts
Method Endpoint Description
POST /api/user/posts/ Create
GET /api/user/posts/{id}/ Read
PATCH /api/user/posts/{id}/ Update
DELETE /api/user/posts/{id}/ Delete
Comments
Method Endpoint Description
POST /api/comments/{post_id} Create
GET /api/comments/{post_id} List
DELETE /api/comments/{comment_id} Delete
Media
Method Endpoint Description
POST /api/media/upload Upload
GET /api/media/list List
DELETE /api/media/{id} Delete
RSS Feeds
Endpoint Description
/feed.rss Global feed
/b/{branch}.rss Branch feed
/u/{username}.rss User feed

Project Structure

src/
├── app.py                 # Application entry
├── api/
│   ├── cdn.py             # CDN endpoint
│   ├── rss.py             # RSS feeds
│   ├── mcp/               # AI integration
│   └── v0/                # API v0
│       ├── auth/
│       ├── branch/
│       ├── user/
│       ├── comment/
│       └── media/
├── core/
│   ├── security.py        # Crypto & hashing
│   ├── rate_limit.py
│   ├── middleware.py      # CSRF, headers
│   └── db/                # Models
└── frontend/
    ├── static/            # CSS, JS
    └── templates/         # Jinja2

Tech Stack

Component Technology
Runtime Python 3.13+
Framework FastAPI
Database SQLAlchemy (SQLite)
Templates Jinja2
Server Uvicorn

Testing

uv run pytest              # Run tests
uv run pytest --cov        # With coverage

Contributing

Pull requests welcome.

  1. Fork it
  2. Branch it (git checkout -b feature/something-new)
  3. Commit it
  4. Push it
  5. Open a PR

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages