Giter VIP home page Giter VIP logo

flask_mvc_github_example_project's Introduction

flask_mvc_github_example_project

an example project for working with branches and files in your Github repo using Flask webapp / api

10000 ft. overview:

alt text

purpose of this Flask project is to demonstrate:

  1. how to deliver the same features in both api endpoints and static html forms in one Flask project
  2. how Flask can be used with the MVC design pattern with the controller imported as Flask blueprints
  3. how Flask can deal with Github integration using the Github API v3 (used as the model "persistence" layer in the MVC design pattern)
  4. api endpoint pytest testing using the requests library
  5. ability of such a web application to gracefully fail on Github integration exceptions

screenshots of the web ui

alt text

alt text

how to setup your environment:

  1. git clone this repo
  2. setup a virtual environment for this project
  3. create a Github personal access token: login to Github and go to settings - developer settings - Personal access tokens - Generate a new token
  4. generate a random flask secret app key
  5. setup your environment variables like:
github_token = <your github token value>
flask_secret_key = <your generated flask secret key> 
  1. setup your github repository name, the "files playground" folder and other settings in flaskr/project_variables/settings.py
  2. your startup configuration should look like this:

alt text

*disclaimer: this example project codebase comes as is, in a production ready application, besides other things, you should use the OAuth protocol for the Github login, this library can get you started: https://github-flask.readthedocs.io/en/latest/

flask_mvc_github_example_project's People

Contributors

datahappy1 avatar pprud 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.