This repository contains the code and documentation for building the backend of an insurance purchasing process while following the principles of Test-Driven Development (TDD).
Client
Server
DataBase
Test
Screen.Recording.2023-10-03.at.9.15.58.AM.mov
I worked on three RESTful APIs that are essential for the insurance purchasing process. These APIs are:
API 1: Convert "Model" and "Year" to a Suggested "Car Value"
- This API takes parameters "model" and "year" and returns a suggested car value in JSON format based on specific business rules.
API 2: Convert "Claim History" to a "Risk Rating"
- This API takes the parameter "claim_history" and calculates a risk rating for a driver based on a set of keywords in the claim history text.
API 3: Convert "Car Value" and "Risk Rating" to a "Quote"
- This API takes parameters "car_value" and "risk_rating" and calculates monthly and yearly premium values for an insurance policy.
Task 1: Created Test Cases
- Wrote comprehensive test cases for the APIs to verify their functionality.
Task 2: Implemented Unit Tests
- Implemented 5 of the test cases as automated unit tests using the recommended unit testing framework.
Task 3: Built API
- Built the API and continuously tested it against the unit tests to ensure it passed all cases.
To get started with this mission, follow these steps:
-
Clone this repository to your local development environment.
git clone https://github.com/HelenaMission/Car-Insurance-Quote-App-with-TDD.git
-
Set appropriate env file to connect with database.
-
Open backend folder in terminal and run dev
npm run dev
-
To run test, open backend folder in terminal and run test
npm run test
-
Open frontend folder in terminal and run start script
npm start
Feel free to reach out if you have any questions or need assistance during this mission.