This is a Flask-based REST API for a blog system. It supports user authentication via JWT, article management (CRUD), and image associations with articles. The backend is built using Flask, SQLAlchemy, Marshmallow, and Flask-JWT-Extended.
- User authentication with JWT (login, token generation)
- Article creation, reading, updating, and deletion (CRUD)
- User-based article ownership and access control
- Relational SQLite database using SQLAlchemy models
- Input validation and serialization using Marshmallow
- CLI command for creating users
- CORS enabled for frontend integration
- Suitable for local development and testing
- Flask
- Flask-SQLAlchemy
- Flask-Migrate
- Flask-JWT-Extended
- Flask-Marshmallow
- Marshmallow-SQLAlchemy
- Flask-CORS
- python-dotenv
- Pytest
git clone https://github.com/krapetcz/simple-flask-blog-api-backend.git
cd simple-flask-blog-api-backend
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
SECRET_KEY=your_secret_key
JWT_SECRET_KEY=your_jwt_secret_key
flask run
To create a new user from the terminal:
flask create-user <username> <password>
This project is licensed under the MIT License.