Coder Social home page Coder Social logo

flask-rest-boilerplate's People

Contributors

collinbrown95 avatar nedga055 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

collinbrown95

flask-rest-boilerplate's Issues

Auto generate version file

The version file is used to help track the latest release of the application and the git commit that was used to created it. It could be used in a couple of different contexts:

  1. Identifies the version info for a release package in case we need to provide the code for an individual release.
  2. Add application version information to log file.
  • Add a script that will auto-generate a version.json file.
  • Use git describe to get the current release tag.
  • Use git rev-parse HEAD to get the latest commit tag for the current branch.
  • Output the results to a version.json file which should look like:
{
"version": "1.1.3",
"git_commit": "90jdf09u029jdjsf093j209jdksljfs"
}

Example bash script can be found in the ROEC API repo. However, it may be beneficial to flask_script Command and make it available via manage.py.

Verify packages

  • Verify that all included packages are included in the list of approved packages and versions.
  • Update any dependencies accordingly.
  • Update environment.yml to only allow packages from the approved package repositories.

Run tests in separate console

Tests may be dependent on the server running.

Because of this, we should:

  • run the server in another window.
  • make sure a server is run.

Generate test reports on running tests

We need to provide reports on the result of running tests, particularly on deployment, so that each "build" can show what tests were run and their status.

This can be achieved by creating a custom Python Unittest Test Runner.

  • Copy 'object_test_runner.py' from the ROEC API into app/test
  • Get License from the original repo and add it to the header under the attribution. Also specify that alterations from the original have been made.
  • Use ObjectTestRunner to run tests from the manage.py:test command instead of the base TextTestRunner.
  • Create report.py in app/test with a Report class that is initialized the resulting object from ObjectTestRunner.
  • Add generate_json_report in report.py as part of the Report class that converts the object from ObjectTestRunner as necessary and saves to a JSON file in the reports directory.
  • Add generate_markdown_report in report.py as part of the Report class that converts the object from ObjectTestRunner as necessary and saves to a markdown file in the reports directory.

For the last two, see generate_json_report in helpers.run.tests.py from the ROEC API.

Add waitress wsgi server for production environments

  • Install waitress
  • Update run command in manage.py to run via serve(app) instead of app.run() (serve is imported from waitress)
  • Add run_dev command to manage.py and change the main to call run_dev
  • Verify app is run on host and port specified in the config

Add `run_server` option to `app.sh`

  • Add an option to run the server to the app.sh script. -r or --run
  • Include sub-option for the environment dev/prod, should default to dev
  • Before running the server, it should build/update conda environment then activate it

Add logger

  • ECS logger needs to first become a GitHub repository. Once created, we will install it from GitHub as a package via pip so that it can be used in this project.
  • Initialize a logger instance each controller.
  • Provide examples of creating a log entry (some info and some error). Should have one for each endpoint.

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.