Giter VIP home page Giter VIP logo

insurance-assistant's Introduction

Insurance Assistant

Insurance Assistant Logo

This project encapsulates a microservice that calculates the risk of the customer based on information given from a POST request coming from a Form.

You may use it as a boilerplate for a microservice that handles api requests and returns the result with a DB registry holding the operation.
This code can be used as it's open source


Technologies used:

  • Python
  • Flask
  • Python-dotenv
  • Flask-pymongo
  • Dnspython
  • MongoDB Atlas
  • Pipenv

Configuration:

After cloning the repository, install the dependencies:

pip install

or

pipenv install

Then proceed with the creation of your .Env file to store your environment variables, for Flask and MongoDB Atlas:

# .env File:

MONGO_URI_BASE=mongodb+srv://
# Keep the : after the user-name for concatenation
MONGO_USER=<your_username>:
MONGO_PASS=<your_pass>
MONGO_CLUSTER=@<your Cluster Name>.mongodb.net/
MONGO_DBNAME=<your desired database name>
MONGO_DBOPTIONS=?retryWrites=true&w=majority
# .flaskenv File:

FLASK_APP=app
FLASK_RUN_PORT=<your_desired_port>
FLASK_ENV=development

Usage:

If you want to test using the structure designed for this solution here's the Json Source-Code:

This input:

{
  "age": 35,
  "dependents": 2,
  "house": {"ownership_status": "owned"},
  "income": 0,
  "marital_status": "married",
  "risk_questions": [0, 1, 0],
  "vehicle": {"year": 2018}
}

Should output:

{
  "auto": "regular",
  "disability": "ineligible",
  "home": "economic",
  "life": "regular"
}

Run the server by using:

flask run

or

python \run.py

Screens:

I've added to the user model at the Database the new entity risk, which will hold all the information of the algorithm passage

Insomnia PrintScreen

Here's the Insomnia settings used for this test, the entry-point for the route tested is:

baseurl/api/user/application

Insomnia PrintScreen

Important: This should be used with an operator linking to the user model, so it should be a variable endpoint at a more refined solution. Expand with that in mind.

insurance-assistant's People

Contributors

arthur404dev avatar

Stargazers

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