Sign inSign up

onyxwizard/flask-api-blog

By onyxwizard

โ€ขUpdated over 1 year ago

๐Ÿ” Cybersecurity Knowledge Blog [API] with Flask, JWT Auth, and Docker support

Image
Languages & frameworks
API management
0

225

onyxwizard/flask-api-blog repository overview

โ ๐Ÿ“˜ Repository Overview

โ ๐Ÿš€ Flask API Blog โ€“ Cybersecurity Knowledge Base

A RESTful Flask API for managing cybersecurity entries โ€” built with JWT authentication, admin role, SQLite, and ready for deployment on Kubernetes, Docker Compose, or standalone.

โ ๐Ÿ” Features

FeatureDescription
๐ŸŒ REST API/api/login, /api/entries, /api/entries/<id>
๐Ÿ”’ JWT AuthenticationSecure login and token-based access
๐Ÿ‘ค Admin RoleProtect entry creation/editing/deletion
๐Ÿ’พ SQLite DBAuto-created on startup
๐Ÿงฑ Docker ReadyUse with Docker, Minikube, or Compose

โ ๐Ÿ› ๏ธ How to Use

โ Pull the Image
docker pull onyxwizard/flask-api-blog
โ Run It Locally
docker run -p 5000:5000 onyxwizard/flask-api-blog

Then visit:

๐Ÿ‘‰ http://localhost:5000โ 

โ ๐Ÿงช Test API Endpoints

โ Login via API
curl -X POST http://localhost:5000/api/login \
     -H "Content-Type: application/json" \
     -d '{"username":"admin", "password":"admin123"}'
โ Add Entry

Use the token from above:

curl -X POST http://localhost:5000/api/entries \
     -H "Authorization: Bearer YOUR_JWT_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"title":"XSS", "category":"Vulnerabilities", "content":"Cross-site scripting attack.", "user_id":1}'

โ ๐Ÿ“ฆ Optional: With Volume Mounting

For live-reload during development:

docker run -p 5000:5000 -v $(pwd):/app onyxwizard/flask-api-blog

โ ๐Ÿงฉ Want to Contribute?

Feel free to fork this project and improve it!

โ Ideas:
  • Add Swagger/OpenAPI docs
  • Implement refresh tokens
  • Migrate to PostgreSQL
  • Build a React frontend

๐Ÿ”— GitHubโ 

โ ๐Ÿš€ Done!

Tag summary

Content type

Image

Digest

sha256:9d94eeff4โ€ฆ

Size

124.5 MB

Last updated

over 1 year ago

docker pull onyxwizard/flask-api-blog