Code Monkey home page Code Monkey logo

minibloggingapp-test's Introduction

MiniBloggingApp-test

Version 1.0.0

A dockerized mini blogging flask api application that allows you to create,access, update and delete blogposts.

Documentation

Before you get started, there are several things you need to get hold of before spinning up the application.

Tech Stack

  • Flask micro-framework for building API.
  • Postgresql for database.
  • Pytest for tests implementation.
  • Docker and Docker compose for containerization.

Make sure to checkout the API documentation YAML file in the root folder of this repo.

Features

  • Containerized with docker
  • Tests implementation
  • Token based authentication

Here is a list of the endpoints and operations allowed:

/register
    - post
/login
    - post
/logout
    - get
/blog/<int:blog_id>
    - get
    - put
    - delete
/blogposts
    - post
    - get

Authentication

with regards to authentication, token based authentication is implemented with cookies being the JWT token location. So to access a protected endpoint, make sure to attach a cookie named access_token_cookie with the JWT as value in the cookie header.

Running the App

Fork the repository and clone it in your local machine. Navigate into the root folder and open a terminal there and run the following command.

docker compose up

Running Tests

To run tests using pytest, run the app in detached mode, then open an interactive terminal in the flask api container and run pytest

docker compose -f docker-compose.test.yml up --build -d

docker exec -it $FlaskApiContainername/ID pytest

minibloggingapp-test's People

Contributors

bryanmwaniqi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.