A simple Blogging Backend app created with Fast API

Overview

BLOGG Log
This is a simple blogging app backend built with FastAPI. This project is created to simulate a real CRUD blogging system. It is built to be used by several system hence adopting the REST APIs aproach. Just like all REST APIs you can perform all functions of this system using the endpoints we created. Everything is simple and easy to use no need to read the code to understand, though you can still jump in there to make some modifications.

Work FLow License: MIT

Requirements


How to install


  • Download and install python.

    The versin should be greater than or equal to version 3.6
  • Clone the project unto your pc.

git clone https://github.com/lokaimoma/BLOGG.git
  • Change directory to the project directory.

cd BLOGG
  • Create a virtual environment.

    • Windows
    python -m venv venv
    
    • Linux and Mac OS
    python3 -m venv venv
  • Activate the virtual environment.

    • Windows
      • cmd
      .\venv\Scripts\activate
      
      • powershell
      .\venv\Scripts\Activate.ps1
      
    • Linux and Mac OS
    source venv/bin/activate
  • Install all the requirements.

pip install -r requirements.txt
  • Set an environmental variable pointing to you database url (KEY = DATABASE_URL). Check DOCS director for how to set the variable.
FORMAT: DATABASE_URL=sqlite+aiosqlite:///db-dev.sqlite

Read this file for other database formats and requirements to install.

  • Deactivate the environment with the command below.
deactivate
  • Reactivate the environment again. Check above for plateform

    specific steps.
  • Run this command to create the database

alembic upgrade head
  • You can now run the program with the command below.

    • Windows
    python engine.py
    
    • Linux and Mac OS
    python3 engine.py
    
  • By default the app runs on localhost:8000

Documentation


To read the docs for api, start the app and open the location http://localhost:8000/docs to read detailed documentation of the endpoints and how to use them.

License


      
MIT License

Copyright (c) 2021 Owusu Kelvin Clark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
Simple FastAPI Example : Blog API using FastAPI : Beginner Friendly

fastapi_blog FastAPI : Simple Blog API with CRUD operation Steps to run the project: git clone https://github.com/mrAvi07/fastapi_blog.git cd fastapi-

Cube-CRUD is a simple example of a REST API CRUD in a context of rubik's cube review service.
Cube-CRUD is a simple example of a REST API CRUD in a context of rubik's cube review service.

Cube-CRUD is a simple example of a REST API CRUD in a context of rubik's cube review service. It uses Sqlalchemy ORM to manage the connection and database operations.

This code generator creates FastAPI app from an openapi file.

fastapi-code-generator This code generator creates FastAPI app from an openapi file. This project is an experimental phase. fastapi-code-generator use

Easily integrate socket.io with your FastAPI app 🚀

fastapi-socketio Easly integrate socket.io with your FastAPI app. Installation Install this plugin using pip: $ pip install fastapi-socketio Usage To

Instrument your FastAPI app

Prometheus FastAPI Instrumentator A configurable and modular Prometheus Instrumentator for your FastAPI. Install prometheus-fastapi-instrumentator fro

Easily integrate socket.io with your FastAPI app 🚀

fastapi-socketio Easly integrate socket.io with your FastAPI app. Installation Install this plugin using pip: $ pip install fastapi-socketio Usage To

Instrument your FastAPI app

Prometheus FastAPI Instrumentator A configurable and modular Prometheus Instrumentator for your FastAPI. Install prometheus-fastapi-instrumentator fro

FastAPI Skeleton App to serve machine learning models production-ready.
FastAPI Skeleton App to serve machine learning models production-ready.

FastAPI Model Server Skeleton Serving machine learning models production-ready, fast, easy and secure powered by the great FastAPI by Sebastián Ramíre

A minimal Streamlit app showing how to launch and stop a FastAPI process on demand
A minimal Streamlit app showing how to launch and stop a FastAPI process on demand

Simple Streamlit + FastAPI Integration A minimal Streamlit app showing how to launch and stop a FastAPI process on demand. The FastAPI /run route simu

Comments
  • :adhesive_bandage: Use custom response

    :adhesive_bandage: Use custom response

    From start I was getting errors on serializing my models to jSON so I serialize them normally before passing it through the JSON response. This caused it to add extra slashes to the strings (as in escaping the ""). To prevent this am now using the Response object to create my custom response passing in the media type application/json. image

    opened by lokaimoma 0
  • CVE-2022-40023 (High) detected in Mako-1.1.4-py2.py3-none-any.whl

    CVE-2022-40023 (High) detected in Mako-1.1.4-py2.py3-none-any.whl

    CVE-2022-40023 - High Severity Vulnerability

    Vulnerable Library - Mako-1.1.4-py2.py3-none-any.whl

    A super-fast templating language that borrows the best ideas from the existing templating languages.

    Library home page: https://files.pythonhosted.org/packages/f3/54/dbc07fbb20865d3b78fdb7cf7fa713e2cba4f87f71100074ef2dc9f9d1f7/Mako-1.1.4-py2.py3-none-any.whl

    Path to dependency file: /requirements.txt

    Path to vulnerable library: /requirements.txt

    Dependency Hierarchy:

    • alembic-1.6.5-py2.py3-none-any.whl (Root Library)
      • :x: Mako-1.1.4-py2.py3-none-any.whl (Vulnerable Library)

    Found in base branch: main

    Vulnerability Details

    Sqlalchemy mako before 1.2.2 is vulnerable to Regular expression Denial of Service when using the Lexer class to parse. This also affects babelplugin and linguaplugin.

    Publish Date: 2022-09-07

    URL: CVE-2022-40023

    CVSS 3 Score Details (7.5)

    Base Score Metrics:

    • Exploitability Metrics:
      • Attack Vector: Network
      • Attack Complexity: Low
      • Privileges Required: None
      • User Interaction: None
      • Scope: Unchanged
    • Impact Metrics:
      • Confidentiality Impact: None
      • Integrity Impact: None
      • Availability Impact: High

    For more information on CVSS3 Scores, click here.

    Suggested Fix

    Type: Upgrade version

    Release Date: 2022-09-07

    Fix Resolution: Mako - 1.2.2


    Step up your Open Source Security Game with Mend here

    security vulnerability 
    opened by mend-bolt-for-github[bot] 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/run_test.yml (github-actions)
    • requirements.txt (pip_requirements)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 7 Pull Requests:

    Update dependency aiounittest to v1.4.2
    • Schedule: ["at any time"]
    • Branch name: renovate/aiounittest-1.x
    • Merge into: main
    • Upgrade aiounittest to ==1.4.2
    Update dependency sqlalchemy to v1.4.41
    • Schedule: ["at any time"]
    • Branch name: renovate/sqlalchemy-1.x
    • Merge into: main
    • Upgrade sqlalchemy to ==1.4.41
    Update dependency alembic to v1.8.1
    • Schedule: ["at any time"]
    • Branch name: renovate/alembic-1.x
    • Merge into: main
    • Upgrade alembic to ==1.8.1
    Update dependency fastapi to v0.85.0
    • Schedule: ["at any time"]
    • Branch name: renovate/fastapi-0.x
    • Merge into: main
    • Upgrade fastapi to ==0.85.0
    Update dependency uvicorn to v0.18.3
    • Schedule: ["at any time"]
    • Branch name: renovate/uvicorn-0.x
    • Merge into: main
    • Upgrade uvicorn to ==0.18.3
    Update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: main
    • Upgrade actions/checkout to v3
    Update actions/setup-python action to v4
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-setup-python-4.x
    • Merge into: main
    • Upgrade actions/setup-python to v4

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
Owusu Kelvin Clark
Mobile Web and backend Developer
Owusu Kelvin Clark
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python Examples. The beyonic APIs Doc Reference: https://apidocs.beyonic.com/ To start using the Beyonic API Python API, you need to start

Harun Mbaabu Mwenda 46 Sep 1, 2022
MS Graph API authentication example with Fast API

MS Graph API authentication example with Fast API What it is & does This is a simple python service/webapp, using FastAPI with server side rendering,

Andrew Hart 4 Aug 11, 2022
Ansible Inventory Plugin, created to get hosts from HTTP API.

ansible-ws-inventory-plugin Ansible Inventory Plugin, created to get hosts from HTTP API. Features: Database compatible with MongoDB and Filesystem (J

Carlos Neto 0 Feb 5, 2022
Fast, simple API for Apple firmwares.

Loyal Fast, Simple API for fetching Apple Firmwares. The API server is closed due to some reasons. Wait for v2 releases. Features Fetching Signed IPSW

null 11 Oct 28, 2022
Dead simple CSRF security middleware for Starlette ⭐ and Fast API ⚡

csrf-starlette-fastapi Dead simple CSRF security middleware for Starlette ⭐ and Fast API ⚡ Will work with either a <input type="hidden"> field or ajax

Nathaniel Sabanski 9 Nov 20, 2022
Sample-fastapi - A sample app using Fastapi that you can deploy on App Platform

Getting Started We provide a sample app using Fastapi that you can deploy on App

Erhan BÜTE 2 Jan 17, 2022
Qwerkey is a social media platform for connecting and learning more about mechanical keyboards built on React and Redux in the frontend and Flask in the backend on top of a PostgreSQL database.

Flask React Project This is the backend for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Peter Mai 22 Dec 20, 2022
LuSyringe is a documentation injection tool for your classes when using Fast API

LuSyringe LuSyringe is a documentation injection tool for your classes when using Fast API Benefits The main benefit is being able to separate your bu

Enzo Ferrari 2 Sep 6, 2021
An alternative implement of Imjad API | Imjad API 的开源替代

HibiAPI An alternative implement of Imjad API. Imjad API 的开源替代. 前言 由于Imjad API这是什么?使用人数过多, 致使调用超出限制, 所以本人希望提供一个开源替代来供社区进行自由的部署和使用, 从而减轻一部分该API的使用压力 优势

Mix Technology 450 Dec 29, 2022
Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.

Jupter Notebook REST API Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as

Invictify 54 Nov 4, 2022