Git Product home page Git Product logo

flaks-graphene-experimental's Introduction

graphene-flask-example

Example of an API GraphQL using Graphene, [Flask GraphQL](https:/ /github.com/graphql-python/flask-graphql) and Graphene-SQLAlchemy.

Installation

Virtualenv

Installation

  virtualenv --python python3 venv
  source venv/bin/activate
  pip install -U pip
  pip install -r requirements-dev.txt

Tox

Installation

tox

Docker-Compose

Installation

docker-compose up #create and run web and db containers
docker-compose run --service-ports --name user_api_flask_web web --rm #allow application server to stop on breakpoints
docker-compose exec web bash #open the web container terminal
docker-compose exec db mysql #open mysql CLI in db container

Setting the local environment

Create a local .env file based on the .env.sample file.

Run from local server

  python run.py #run local server on port 3000

Database versioning

The application uses Flask-Migrate to do database versioning.

First create the database for the development and test environments.

mysql -e "create database user_db;"
mysql -e "create database user_db_test;"

Right away:

python manage.py db migrate #create migration if there is a change in the database schema
python manage.py db upgrade #run database migrations

Routes


GET /api/healthcheck

GET /api/graphql

Execution of unit tests

pytest

Linter

flake8 tests user_api

flaks-graphene-experimental's People

Contributors

doggino avatar

Watchers

 avatar

flaks-graphene-experimental's Issues

๐Ÿงš๐Ÿค– Pixeebot Activity Dashboard

DashList

๐Ÿ‘‹ This dashboard summarizes my activity on the repository, including available improvement opportunities.

Recommendations

Last analysis: Aug 10 | Next scheduled analysis: Aug 17

Open

โœ… Nice work, you're all caught up!

Available

โœ… Nothing yet, but I'm continuing to monitor your PRs.

Metrics

What would you like to see here? Let us know!

Resources

๐Ÿ“š Quick links
Pixee Docs | Codemodder by Pixee

๐Ÿงฐ Tools I work with
SonarCloud | SonarQube | CodeQL | Semgrep

๐Ÿš€ Pixee CLI
The power of my codemods in your local development environment. Learn more

๐Ÿ’ฌ Reach out
Feedback | Support


โค๏ธ Follow, share, and engage with Pixee: GitHub | LinkedIn | Slack

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.