Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msoedov/flask-graphql-example
Example GraphQL application with Flask, pypy/python3 and MongoDB
https://github.com/msoedov/flask-graphql-example
flask graphql mongodb python
Last synced: 10 days ago
JSON representation
Example GraphQL application with Flask, pypy/python3 and MongoDB
- Host: GitHub
- URL: https://github.com/msoedov/flask-graphql-example
- Owner: msoedov
- License: mit
- Created: 2015-11-27T20:43:21.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T03:49:10.000Z (almost 8 years ago)
- Last Synced: 2024-12-02T16:57:50.255Z (21 days ago)
- Topics: flask, graphql, mongodb, python
- Language: Python
- Size: 343 KB
- Stars: 55
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Example of small GraphQL app with Flask + Python3/PyPy3 + MongoDb
[![Build Status](https://travis-ci.org/msoedov/flask-graphql-example.svg?branch=master)](https://travis-ci.org/msoedov/flask-graphql-example)
[![Code Issues](https://www.quantifiedcode.com/api/v1/project/44eede68b96745bdafee5a8a208ea3c3/badge.svg)](https://www.quantifiedcode.com/app/project/44eede68b96745bdafee5a8a208ea3c3)### Quick start with docker
```shell
docker-compose build
docker-compose up
```Optionally populate database
```shell
docker-compose run web pypy3 manage.py init
```And then open http://localhost:5000/ui
![Demo screen](https://sc-cdn.scaleengine.net/i/1abd73bf614838ef8cae5a35093ca3cd1.png)
### Development workflow
Create a virtual environment with Python3 or PyPy3
Make sure you have running MongoDb instance either on localhost or
```shell
export DB_PORT_27017_TCP_ADDR='ip address'```
Likewise you can use containerized Mongo but you will need to setup env variables as well
```shell
docker-compose build
docker-compose up db
```Then you can install deps and run the python app
```
make req
python api.py
```#### Miscellaneous
Auto format your code
```shellmake format
```Nosetests with reload
```shell
make watch
```