Welcome to insurance backend. This django based web application is used to create customers and process quotes and create policies for them. This is an assignment for democrance software engineer interview.
- Policy creation - Create policy for customers, filter them using
type
- Customer creation - Create customers for the platform, search using
first_name
andlast_name
, and filter usingdate_of_birth
(YYYY-MM-DD)
Follow these instructions to get the project up and running on your local machine for development and testing purposes.
- Docker installed
- Docker Compose installed
-
Clone the repository:
git clone [email protected]:divyanshudimri/insurance-backend.git
-
Navigate to the project directory:
cd insurance-backend
-
Build and start the Docker containers:
docker-compose up -d
Here is the way to install pre-commit hooks and poetry
-
Install poetry
- Mac os, prerequisites
brew
brew install poetry
- Ubuntu
curl -sSL https://install.python-poetry.org POETRY_HOME=/usr/local/bin/poetry python3 - poetry config virtualenvs.create false
- Mac os, prerequisites
-
Activate virtual environment
source $(poetry env info -p)/bin/activate
-
Install pre-commit hooks
pre-commit install
Now when you do git add .
and git commit -m "<commit-message>"
, pre-commit hooks run automatically.
The project uses environment variables for configuration. Edit the .env
file and provide the necessary values, such as database connection details and API keys.
-
Go into backend container shell and run:
python manage.py test
Visit http://0.0.0.0:65000
in your browser to access the Django application.
Refer to the API documentation for details on available endpoints and how to interact with the backend. Alternate API documentation
POST api/v1/customer/
expects date format to be inYYYY-MM-DD
- Link to documentation is a localhost link, build and start docker containers and then go to these links