Git Product home page Git Product logo

flask-book-project's Introduction

python-flask-mongoengine-docker-starter

Language License Repo size

This is a starter or boilerplate to create RESTful API with Python and MongoDB using Flask microframework. The project uses Docker (docker-compose) for easy to use, encapsulated and safe environment.

Stack

  • Python 3
  • Flask
  • Flask-RESTPlus
  • Mongoengine
  • Unittest
  • Docker
  • Swagger

Usage

Install Docker if you don't have it yet and run the container:

$ docker-compose up

It will run both Web and Mongodb containers in Development environment on localhost:5100. For other environments change ENV in docker-compose.yml:

web:
   ...
    environment:
      - ENV=Testing

You can use Development, Production or Testing or add your own environment in api/config.py.

Structure

Here is a folder and file structure with explanation.

├── Dockerfile
├── LICENSE
├── README.md
├── api
│   ├── app.py - Entry point of application
│   ├── config.py - Configuration with environments
│   └── v1 - API version 1
│       ├── database
│       │   └── models.py - All data models app uses
│       └── resources
│           ├── routes.py - List of namespaces for routing
│           └── todos.py - Example Todo resource
├── docker-compose.yml
├── requirements.txt - Dependencies
└── tests
    └── text_base.py - Example test file

Documentation

Thanks to handy decorators this boilerplate will generate Swagger with documentation on the fly. By default Swagger runs on / so you should see it on http://localhost:5100. Read more here.

Swagger

Testing

You can run tests easily within Docker container:

docker-compose run web python tests/test_base.py

License

See LICENSE file.

flask-book-project's People

Contributors

coderj001 avatar michaljach 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.