Code Monkey home page Code Monkey logo

hole-calc's Introduction

website status shield GitHub Workflow Status GitHub

Hole calc is a simple web application that allows you to calculate the diameter of a bore from the size of three cylindrical pin gages that fit into it, using Descartes' Theorem. This functionality is useful for machinists and anyone else who needs a semi-precision method of measuring bore diameters without dedicated tools. See the guide for more info on how to use hole calc.

Application structure

The hole calc application is built with the Flask web application microframework. Flask-WTForms was used to build the calculator input forms. The source code for the flask app is contained in main.py, while Flask templates reside in the templates subdirectory.

The holecalc module contains the backend code that runs the geometry calculations for the application's main functionality. This module also contains a couple placeholder functions that need to be completed for future planned features (see TODO section below).

Styling

Hole calc is styled using Pure.css. The display font used for the menu and headings is Space Grotesk by Florian Karsten. The color scheme may be viewed here.

Build, test and deployment

Hole calc is developed and tested using Python 3.8. A pipfile is included for dependency management with Pipenv.

The preferred way to build and deploy this application is via Docker, using the included Dockerfile. The base image used is tiangolo/meinheld-gunicorn-flask:python3.8 (docs).

Automated tests for the pytest framework are found in the tests subdirectory. Tests and linting with flake8 are run via GitHub action on every push to the master branch of this repository.

Environment variables

The following environment variables should be set during deployment:

  • FLASK_ENV: Use 'development', 'testing', or 'production'. Defaults to 'development' if not set.
  • SECRET_KEY: A secret key that will be used for securely signing the session cookie. Used for CSRF form validation. Not very important to guard against CSRF attacks currently, but this future proofs the app for potential added features.

TODO:

  • Hole calc is currently feature complete so there are no major pending TODOs. However, small improvements and optimizations are always possible. If you have a suggestion, check out the "Contributing" section below.

Contributing

Bug reports, feature suggestions and code contributions are welcome. You may open an issue or pull request through GitHub or by contacting me directly through the contact information listed on my GitHub profile.

License

Hole calc is licensed according to the terms of the MIT license. See LICENSE.md for details.

hole-calc's People

Contributors

rouyng avatar

Stargazers

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