Here’s a README.md
you can use for your fusion-api
project:
Fusion API is a modular Flask-based framework designed to simplify building OAuth2-compatible APIs with JWT authentication, user management, and extensible versioned route handling.
- ✅ JWT authentication with token revocation and expiration
- 🔐 Support for API Key, Basic Auth, and JSON-based login
- 🧑💼 Admin-only routes and token/user management
- 🧠 Usage logging for auditing and analytics
- 🌐 Environment-based configuration with
.env
- 🦺 Optional Slack notifications on startup or events
- 🧱 Easily extensible with Flask Blueprints
git clone https://github.com/GameFusion/fusion-api.git
cd fusion-api
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create a .env
file (if not already) and set:
API_DOMAIN_NAME=api.yourdomain.com
JWT_SECRET_KEY=your_jwt_secret
JWT_TOKEN_EXPIRY_HOURS=2
# SSL paths
SSL_CERT_PATH=/path/to/fullchain.pem
SSL_KEY_PATH=/path/to/privkey.pem
# Slack (optional)
SLACK_BOT_TOKEN=xoxb-xxx
SLACK_CHANNEL=general
# PostgreSQL
DATABASE_URL=postgresql://user:pass@host:port/dbname
python main.py
Or with SSL:
python main.py --ssl
File | Description |
---|---|
main.py |
Main app entry point and route setup |
database.py |
Handles DB connections and operations |
slack_message.py |
Sends Slack messages via bot integration |
startup_notifier.py |
Sends Slack message when app boots |
user_manager.py |
Create and manage users/API keys |
requirements.txt |
Python dependencies |
/api/v1/auth/login
: Login via API Key, Basic Auth, or JSON/api/v1/auth/logout
: Revoke current JWT token/api/v1/routes
: List all routes/api/v1/test
: Test endpoint (no auth)/api/v1/ping
: Check if API is alive/api/v1/admin/...
: Admin endpoints (users, tokens, usage)
curl -X POST https://api.yourdomain.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin", "password":"secret"}'
This project is MIT Licensed.
Would you like a badge section or GitHub Actions workflow added to it as well?