Skip to content

krapetcz/simple-flask-blog-api-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Blog REST API

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.


Features

  • 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

Technologies

  • Flask
  • Flask-SQLAlchemy
  • Flask-Migrate
  • Flask-JWT-Extended
  • Flask-Marshmallow
  • Marshmallow-SQLAlchemy
  • Flask-CORS
  • python-dotenv
  • Pytest

Installation & Setup

1. Clone the repository

git clone https://github.com/krapetcz/simple-flask-blog-api-backend.git
cd simple-flask-blog-api-backend

2. Create and activate a virtual environment

python3 -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Create a .env file in the root folder

SECRET_KEY=your_secret_key
JWT_SECRET_KEY=your_jwt_secret_key

5. Run the application

flask run

CLI Commands

To create a new user from the terminal:

flask create-user <username> <password>

License

This project is licensed under the MIT License.

About

RESTful API for a simple blog application built with Flask, JWT authentication, and SQLAlchemy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages