Skip to content

lrmn7/mewwme-patreon-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎵 Mewwme Premium API

A centralized premium management API built for the Mewwme Music Bot ecosystem, powered by Patreon integration.

Official Bot Website: https://meww.me


📖 Overview

Mewwme Premium API was developed by Mewwme Development to handle premium subscriptions, Patreon OAuth integration, and automated guild premium management across multiple Mewwme bots.

This API acts as the core service responsible for:

  • Managing Patreon subscription tiers
  • Assigning premium status to Discord guilds
  • Handling Patreon webhook events
  • Synchronizing subscription changes automatically
  • Logging events via Discord webhooks

It was specifically designed to support the internal infrastructure of the Mewwme Music Bot.


✨ Features

  • 🔐 Patreon OAuth2 authentication
  • 🏆 Premium tier management (Silver / Gold)
  • 🏠 Guild premium activation & tracking
  • 🔄 Automatic Patreon webhook handling
  • 📡 Discord webhook logging
  • 🗄️ Database integration via Prisma ORM

⚠️ Development Status

This project is no longer actively maintained.

Please note:

  • The API was built exclusively for the Mewwme Music Bot infrastructure
  • Self-hosting is not officially supported
  • Issues and pull requests will not be reviewed
  • Custom deployments are unsupported

The repository remains open-source under GPL-3.0 for transparency and archival purposes.


📜 License

Licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for full details.


🧩 Prerequisites

Before running this project, ensure you have:

  • Node.js v16 or higher
  • npm
  • PostgreSQL (or another supported database)
  • Patreon Developer Application
  • Discord Webhook URL (for logging)

🚀 Installation

1️⃣ Clone the Repository

git clone https://github.com/lrmn7/Mewwme-Patreon-Api.git
cd Mewwme-Patreon-Api

2️⃣ Install Dependencies

npm install

3️⃣ Configure Environment Variables

Copy the example environment file:

cp .env.example .env

Update the required variables:

PORT=4000
DB_PROVIDER=postgresql
DATABASE_URL=your-database-url

PATREON_CLIENT_ID=your-patreon-client-id
PATREON_CLIENT_SECRET=your-patreon-client-secret
PATREON_REDIRECT_URI=your-oauth-callback-url
PATREON_CAMPAIGN_ID=your-patreon-campaign-id

DISCORD_LOG_WEBHOOK=your-discord-webhook-url

⚠️ Never commit your .env file to version control.


4️⃣ Run Database Migrations

npx prisma migrate dev

5️⃣ Start the Development Server

npm run dev

📡 Usage

Once running:

  1. Use the authentication endpoints to connect Discord users to Patreon.
  2. Activate or deactivate premium guilds via the premium endpoints.
  3. Allow Patreon webhooks to automatically update subscription status.
  4. Monitor system logs through the configured Discord webhook.

🔌 API Endpoints

🔐 Authentication

  • GET /auth/patreon?discordId=<ID> Redirect user to Patreon OAuth

  • GET /auth/patreon/callback OAuth callback endpoint


💎 Premium Management

  • POST /premium/servers Activate premium for a guild
{
  "discordId": "user_id",
  "guildId": "guild_id"
}
  • DELETE /premium/servers Deactivate premium for a guild
{
  "discordId": "user_id",
  "guildId": "guild_id"
}
  • GET /premium/show?discordId=<ID> Show user's premium status

  • GET /premium/check?discordId=<ID>&guildId=<ID> Check if a guild has premium access


🔔 Webhooks

  • POST /webhooks/patreon Patreon webhook endpoint for subscription events

Automatically handles:

  • New pledges
  • Tier upgrades/downgrades
  • Cancellations
  • Expired subscriptions

🏆 Premium Tiers

Tier Premium Guild Slots
Silver 2 guilds
Gold 4 guilds

🔐 Security Best Practices

  • Never expose API secrets
  • Store sensitive credentials in environment variables
  • Keep dependencies updated
  • Restrict webhook endpoints appropriately
  • Use HTTPS in production

🧠 Architecture Purpose

This API was created to:

  • Centralize premium logic
  • Reduce duplication across multiple bot instances
  • Automate Patreon subscription management
  • Maintain consistency across the Mewwme ecosystem

About

A centralized premium management API built for the Mewwme Music Bot ecosystem, powered by Patreon integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors