This is an insurance recommendation API. A user can register, login, logout, and post questionnaire data for which he will get a set of insurance recomendation as response.
The app ist currenty hosted and accessible at http://insurance-agent.store
. It is hosted on a Heroku dyno, so it might take some time for startup at the first request.
Important: The connection is not SSL/TLS encrypted, so do not send any personal information or passwords you use at other services. The endpoint is just for demonstration purposes. Also please understand that the API results are not an official consultation and just used for information purposes.
POST to http://insurance-agent.store/register
with JSON-payload:
{
"username": <username>,
"email": <email>,
"password": <password>
}
POST to http://insurance-agent.store/recommendation
with JSON-payload:
{
"first_name": <firstname>,
"address": <address>,
"occupation": <occupation>, (in {Employed, Student, Self-employed})
"email_address": <email>,
"children": <Boolean>,
"num_children": <int> (optional)
}
The app also supports login ({"username": <username>, "password": <password>}
) at http://insurance-agent.store/login
and logout at http://insurance-agent.store/logout
. Registering will automatically log you in.
- Clone repository
git clone https://github.com/d-e-h-i-o/insuranceAPI.git
cd insuranceAPI/
- Create virtual environment
python3 -m venv venv
- Activate virtual environment
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Set environment variables
export DATABASE_URL="postgresql:///insuranceapi_dev"
export APP_SETTINGS="config.DevelopmentConfig"
export FLASK_APP="api_app:create_app()"
export SECRET_KEY=<something_really_secret>
- Set up database
createdb insuranceapi_dev
- Run app
flask run
- Set up database
createdb insuranceapi_test
- Run tests
python -m pytest tests/ --capture=tee-sys
- Integrate JWT
- Integrate Flask-Admin
- Use mypy and type hints
- Use docker