Integration
Privclaw
A self-hostable AI plugin marketplace with built-in payments, wallet, and admin dashboard
README
# PrivClaw
> A self-hostable AI plugin marketplace with built-in payments, wallet, and admin dashboard. Deploy in 30 seconds with Docker.
[](LICENSE)
[](https://www.docker.com/)
[](https://www.python.org/)
[](https://nextjs.org/)
[](https://www.postgresql.org/)
[](CONTRIBUTING.md)
---
## Why PrivClaw?
- **Full Commercialization** â Built-in Alipay payment, wallet system, revenue sharing, and withdrawal. Not a toy project.
- **One-Click Deploy** â `docker compose up -d` launches the entire stack in 30 seconds.
- **Production-Grade Architecture** â FastAPI + Next.js 15 + PostgreSQL + Redis + Celery, cleanly layered.
- **Comprehensive Documentation** â Detailed architecture docs, local implementation guide, and auto-generated API docs.
- **Full-Text Search** â PostgreSQL TSVECTOR-powered plugin search with fuzzy matching.
- **Security First** â CORS, rate limiting, security headers, JWT dual-token auth (HS256/RS256), bcrypt password hashing, AES-256-GCM sensitive data encryption.
## Quick Start
```bash
git clone https://github.com/privclaw/privclaw.git
cd privclaw
cp .env.example .env
docker compose up -d
```
Then visit:
- **Frontend**: http://localhost:3000
- **API Docs**: http://localhost:8000/docs
- **MinIO Console**: http://localhost:9001
### Demo Accounts
After running `make seed`, you'll have 3 demo accounts:
| Role | Email | Password |
|------|-------|----------|
| Admin | `[email protected]` | `Admin123456` |
| Developer | `[email protected]` | `Demo123456` |
| Buyer | `[email protected]` | `Demo123456` |
## Screenshots
| Home Page | Plugin Marketplace | Admin Dashboard |
|-----------|-------------------|-----------------|
|  |  |  |
| Plugin Detail |
|---------------|
|  |
## Feature Checklist
### Core Features
- [x] User Authentication (JWT dual token: access + refresh, HS256/RS256)
- [x] User Management (roles: buyer / developer / admin)
- [x] Plugin Marketplace (CRUD + version management + file upload)
- [x] Full-Text Search (PostgreSQL TSVECTOR)
- [x] Category System (tree structure)
- [x] Order System (create, list, auto-close on timeout via Celery)
- [x] Alipay Payment (face-to-face QR code + async callback)
- [x] Wallet Balance Payment
- [x] Wallet System (recharge, withdrawal, transaction records)
- [x] Admin Dashboard (user management, plugin review, order management, withdrawal review)
- [x] Object Storage (MinIO for dev / Aliyun OSS for production)
- [x] Docker Compose (development + production)
- [x] HTTPS (Nginx with self-signed cert + HSTS)
- [x] Rate Limiting (Nginx: auth 3r/m, API 30r/s, frontend 50r/s)
- [x] Security Headers (X-Frame-Options, CSP, HSTS, etc.)
- [x] Sensitive Data Encryption (AES-256-GCM)
- [x] CI/CD Pipeline (GitHub Actions + ruff + pytest coverage)
### In Progress
- [ ] WeChat Pay Integration
- [ ] Plugin Review System Frontend UI
- [ ] Admin Dashboard Data Visualization
- [ ] Refresh Token Rotation
### Planned
- [ ] Refund Workflow
- [ ] Rating & Review System
- [ ] Dark Mode
- [ ] Notification System
- [ ] Monitoring & Alerting
## Architecture
```
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Nginx (443/80) â
â SSL + Reverse Proxy + Rate Limit â
ââââââââââââââââŹâââââââââââââââââââââââŹââââââââââââââââââââââââ
â â
ââââââââźâââââââ âââââââââźâââââââ
â Frontend â â Backend â
â Next.js 15 â â FastAPI â
â (3000) â â Gunicorn Ă4 â
â standalone â â (8000) â
âââââââââââââââ ââââââââŹââââââââ
â
ââââââââââââââââââźâââââââââââââââââ
â â â
ââââââââźâââââââ ââââââââźâââââââ ââââââââźâââââââ
â PostgreSQL â â Redis â â MinIO â
â (5432) â â (6379) â â (9000) â
âââââââââââââââ ââââââââŹâââââââ âââââââââââââââ
â
ââââââââźâââââââ
â Celery â
â Worker â
âââââââââââââââ
```
### Tech Stack
| Layer | Technology |
|-------|-----------|
| **Frontend** | Next.js 15 + React 19 + TypeScript 5 + TailwindCSS 4 |
| **Backend** | FastAPI 0.115.6 + Python 3.12 + SQLAlchemy 2.0 (async) |
| **Database** | PostgreSQL 16 (full-text search with TSVECTOR) |
| **Cache/Queue** | Redis 7 (Celery broker + token management) |
| **Async Tasks** | Celery 5.4.0 (order timeout auto-close) |
| **Object Storage** | MinIO (dev) / Aliyun OSS (production) |
| **Payment** | Alipay SDK (sandbox & production) |
| **State Management** | Zustand (auth persistence) + React Query (API caching) |
| **UI Components** | Radix UI + Lucide React |
| **Reverse Proxy** | Nginx (HTTPS + rate limiting + security headers) |
| **Containerization** | Docker Compose (development + production) |
## Documentation
- [API Docs](http://localhost:8000/docs) â Auto-generated Swagger UI
- [Contributing Guide](CONTRIBUTING.md) â How to contribute
- [Code of Conduct](CODE_OF_CONDUCT.md) â Community guidelines
- [Security Policy](SECURITY.md) â Reporting vulnerabilities
- [Changelog](CHANGELOG.md) â Version history
## Development
### Prerequisites
- Docker & Docker Compose
- Python 3.12+ (for running scripts locally)
- Node.js 20+ (for frontend development)
### Common Commands
```bash
# Initialize environment
make init
# Start all services
make dev
# Run database migrations
make migrate
# Seed demo data
make seed
# Run tests
make test
# View logs
make logs
# Stop all services
make down
# Production deployment
make prod
```
### Project Structure
```
privclaw/
âââ backend/ # FastAPI backend
â âââ app/
â â âââ api/v1/ # RESTful API routes
â â âââ core/ # Config, security, dependencies
â â âââ models/ # SQLAlchemy ORM models
â â âââ schemas/ # Pydantic validation schemas
â â âââ services/ # Business logic layer
â â âââ tasks/ # Celery async tasks
â â âââ scripts/ # Data seed scripts
â âââ alembic/ # Database migrations
â âââ tests/ # Pytest test suite
â âââ Dockerfile
âââ frontend/ # Next.js frontend
â âââ src/
â â âââ app/ # App Router pages
â â âââ components/ # UI components
â â âââ hooks/ # React Query hooks
â â âââ lib/ # Utilities
â â âââ stores/ # Zustand state management
â â âââ types/ # TypeScript type definitions
â âââ Dockerfile
âââ deploy/ # Deployment configs
â âââ nginx/ # Nginx reverse proxy
â âââ postgres/ # Database init scripts
âââ docker-compose.yml # Development environment
âââ docker-compose.prod.yml # Production environment
âââ Makefile # Build commands
```
## Contributing
We welcome contributions of all kinds! Please read our [Contributing Guide](CONTRIBUTING.md) to get started.
### Good First Issues
Look for issues labeled [`good-first-issue`](https://github.com/privclaw/privclaw/labels/good-first-issue) to find beginner-friendly tasks.
### Contributors
Thanks to all contributors who have helped make PrivClaw better:
<a href="https://github.com/privclaw/privclaw/graphs/contributors">
<img src="https://contrib.rocks/image?repo=privclaw/privclaw" />
</a>
## License
This project is licensed under the [MIT License](LICENSE).
## Support
If you find PrivClaw useful, please consider giving it a star! Your support motivates us to keep improving.
[](https://star-history.com/#privclaw/privclaw&Date)
---
## About Me
**19 years old, a college student passionate about AI, just getting started with AI development.**
## Contact
| Platform | Details |
|----------|---------|
| WeChat | `GDDYSQ1234` |
| Email | [[email protected]](mailto:[email protected]) |
integration
Comments
Sign in to leave a comment