EstateTrust
EstateTrust is a specialized tool designed to help individuals and professionals create and manage their estate plans. It involves making arrangements for the distribution of assets, care of dependents, and other important decisions after a person passes away or becomes incapacitated. It can simplify the process and ensure that your wishes are documented correctly.
Our main objectives of the developing estate planning management system software (EPS) are:
- Address issues that arise during reading of wills after the person passes away or becomes incapacitated.
- Distribution of assets.
- Care of dependents.
- Programming Language: Python
- Web Framework: FastAPI
- Frontend Technologies: CSS3, HTML5, JavaScript and ReactJs
- Database Technology: PostgreSQL
- Deployment And Hosting: Docker, Ubuntu linux machine and Nginx for web server
- Logging And Monitoring: Prometheus
- Version Control: Git
- CI/CD Pipeline: GitLab
- Legal And Regulatory Complexity
- Documents Accuracy
- Assets Valuation
- Beneficiary Designations
Running a FastAPI application involves a few steps, including setting up the environment, defining your application, and starting the development server. Here are the steps to run a FastAPI application:
-
Set Up Your Environment:
Before running a FastAPI application, ensure you have Python and the required dependencies installed. You can use a virtual environment to manage dependencies to avoid conflicts with other projects. Here's how to create and activate a virtual environment using Python's built-in
venv
module:# Create a virtual environment python -m venv myenv # Activate the virtual environment (on Windows) myenv\Scripts\activate # Activate the virtual environment (on macOS/Linux) source myenv/bin/activate
Replace
myenv
with the name you prefer for your virtual environment. -
Install FastAPI and Dependencies:
Inside your activated virtual environment, you should install FastAPI and any additional dependencies your application requires. You can use
pip
to install them:pip install -r requirements.txt
-
Run the Development Server:
FastAPI provides a built-in development server, but you can also use ASGI servers like Uvicorn for production. To run your FastAPI application using the development server, use the following command inside the EstateTrust directory:
uvicorn api.v1.main:app --reload
The
--reload
flag enables automatic code reloading during development, making it easier to see changes immediately. -
Access EstateTrust Application:
Once your FastAPI application is running, you can access it by opening a web browser or making HTTP requests to the specified endpoints. By default, the development server runs on
http://localhost:8000
. -
Stopping the Development Server:
To stop the development server, you can use
Ctrl+C
in the terminal where the server is running. -
Production Deployment:
For production deployment, it's recommended to use ASGI servers like Uvicorn, Hypercorn, or Gunicorn. These servers provide better performance and reliability. You can refer to the documentation of these servers for deployment instructions specific to your environment.
This API documentation provides information about the Users API routes for the "Estate Trust" application. The API allows users to create accounts, log in, access their dashboards, update their accounts, and delete their accounts.
All endpoints are relative to the base URL: /grantors
.
Authentication is required for certain endpoints. The API uses OAuth for user authentication. Users must obtain an access token to access authenticated endpoints. To obtain an access token, users should log in using the /account/login
endpoint.
Create a grantor account.
Request Body
grantor
(object): An object that contains the account information, including:first_name
(string): The first name for the account.last_name
(string): The last name for the account.middle_name
(string): The middle name for the account.username
(string): The username for the account.password
(string): The password for the account.email
: (string): The email address for the account,phone_number
(string): The phone number for the account.date_of_birth
(date): The date of birth for the account.gender
(string): The gender for the account.
Response
-
201 Created
: The account was created successfully.status_code
(integer): 201message
(string): "Account created successfully"
-
422 Unprocessable Entity
: An error occurred while creating the account.
Log in a user.
Request Body
data
(object): An object that contains the login information, including:username
(string): The username of the user.password
(string): The password of the user.
Response
-
200 OK
: The user was successfully logged in.access_token
(string): The access token for the user.token_type
(string): "bearer"
-
401 Unauthorized
: Invalid credentials provided.
Retrieve the grantor's dashboard.
Path Parameters
uuid_pk
(string): The UUID unique identification of the user's account.
Request Headers
Authorization
(string): The access token obtained during login.
Response
-
200 OK
: The grantor's dashboard information.uuid_pk
(string): The UUID of the grantor.- Other user information.
-
404 Not Found
: User not found. -
403 Forbidden
: Access denied if the requested UUID does not match the authenticated user's UUID.
Response Example
{
"uuid_pk": "43725e17-72d5-4def-be70-91accfe2009a",
"username": "cBolton",
"first_name": "Who",
"middle_name": "Emmanuel",
"last_name": "Ejobe",
"email": "[email protected]",
"phone_number": "+2348153836253",
"date_of_birth": "2000-07-18",
"gender": "male",
"created_at": "2023-10-03T11:49:29.118054+01:00",
"beneficiaries": [],
"executors": [
{
"uuid_pk": "d55b069e-dda1-4732-b110-8fcfdc3b10ec",
"username": "username",
"first_name": "Trustee1",
"middle_name": "Mytrustee",
"last_name": "Trustee",
"email": "[email protected]",
"phone_number": "12345678901",
"relation": "lawyer",
"added_by": "43725e17-72d5-4def-be70-91accfe2009a",
"created_at": "2023-10-03T11:52:27.286994+01:00"
}
],
"assets": [],
"monetaries": []
}
Update the grantor's account.
Path Parameters
uuid_pk
(string): The UUID of the user's account.
Request Headers
Authorization
(string): The access token obtained during login.
Request Body
data
(object): An object that contains the account information to be updated.
Response
-
200 OK
: The updated grantor account information.- User information with changes applied.
-
422 Unprocessable Entity
: Error updating the account. -
403 Forbidden
: Access denied if the requested UUID does not match the authenticated user's UUID.
Delete a user account.
Path Parameters
uuid_pk
(string): The UUID of the user's account.
Request Headers
Authorization
(string): The access token obtained during login.
Response
-
204 No Content
: The account was successfully deleted. -
422 Unprocessable Entity
: Error deleting the account. -
403 Forbidden
: Access denied if the requested UUID does not match the authenticated user's UUID.
This API documentation provides information about the endpoints and functionality of the Estate Trust Trustees API. This API allows users to manage trustees associated with an estate trust account. Users can create, retrieve, update, and delete trustees, as well as login as a trustee and access the trustee's dashboard.
- Create a New Trustee
- Retrieve a Specific Trustee
- Retrieve List of Trustees
- Update Trustee Account
- Delete Trustee Account
- Login as a Trustee
- Trustee Dashboard
The base URL for all API endpoints is /trustees
.
Some endpoints require authentication using OAuth 2.0. Authentication tokens should be included in the request headers for those endpoints. Refer to the OAuth 2.0 documentation for details on obtaining and using authentication tokens.
Create a new trustee associated with a grantor (estate owner).
- HTTP Method: POST
- Endpoint:
/account/{grantor_id}/create/trustees
- Request Body: AddTrustee
- Response: HTTP 201 Created on success, with a success message.
{
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"phone_number": "string",
"email": "string",
"username": "string",
"password": "string",
"relation": "string",
"note": "string"
}
first_name
(string): The first name of the new trustee.last_name
(string): The last name of the new trustee.middle_name
(string): The middle name of the new trustee.username
(string): The username of the new trustee.password
(string): The password of the new trustee.email
: (string): The email address of the new trustee.phone_number
(string): The phone number of the new trustee.relation
(string): The relationship between grantor and the new trustee.note
(string): The note that shows the grantor's intake on the new trustee.
POST /trustees/account/{grantor_id}/create/trustees
{
"message": "Trustee added successfully"
}
Retrieve information about a specific trustee associated with a grantor.
- HTTP Method: GET
- Endpoint:
/account/{grantor_id}/trustees/{trustee_id}
- Response: TrusteeRes on success.
GET /trustees/account/{grantor_id}/trustees/{trustee_id}
{
"uuid_pk": "string",
"username": "string",
...
}
{
"uuid_pk": "string",
"username": "string",
...
}
Retrieve a list of trustees associated with a grantor.
- HTTP Method: GET
- Endpoint:
/account/{grantor_id}/trustees
- Response: List of TrusteeRes on success.
GET /trustees/account/{grantor_id}/trustees
[
{
"uuid_pk": "string",
"username": "string",
...
},
...
]
Update the information of a specific trustee associated with a grantor.
- HTTP Method: PUT
- Endpoint:
/account/{grantor_id}/trustees/{trustee_id}/update
- Request Body: UpdateTrustee
- Response: TrusteeRes on success.
{
"username": "string",
...
}
username
(string, optional): The updated username for the trustee.
PUT /trustees/account/{grantor_id}/trustees/{trustee_id}/update
{
"uuid_pk": "string",
"username": "string",
...
}
Delete a trustee account associated with a grantor.
- HTTP Method: DELETE
- Endpoint:
/account/{grantor_id}/trustees/{trustee_id}/delete
- Response: HTTP 204 No Content on successful deletion.
DELETE /trustees/account/{grantor_id}/trustees/{trustee_id}/delete
Login as a trustee to obtain an access token for authentication.
- HTTP Method: POST
- Endpoint:
/account/trustee/login
- Request Body: SignInUser
- Response: Access token and token type on successful login.
{
"username": "string",
"password": "string"
}
username
(string, required): The username of the trustee.password
(string, required): The password of the trustee.
POST /trustees/account/trustee/login
{
"access_token": "string",
"token_type": "bearer"
}
Access the trustee dashboard with unlimited access.
- HTTP Method: GET
- Endpoint:
/account/trustee/{trustee_id}/dashboard
- Response: TrusteeRes on success.
GET /trustees/account/trustee/{trustee_id}/dashboard
{
"uuid_pk": "string",
"username": "string",
...
}
That concludes the documentation for the Estate Trust Trustees API. For authentication and further details, please refer to the OAuth 2.0 documentation and specific endpoint documentation above.
This API documentation provides information on how to use the "Beneficiaries" endpoints of the Estate Trust application. These endpoints allow users to manage beneficiaries associated with their accounts.
- Create Beneficiary
- Retrieve Beneficiaries
- Retrieve Beneficiary
- Update Beneficiary
- Delete Beneficiary
- Endpoint:
/beneficiaries/account/{grantor_id}/create/beneficiary
- HTTP Method: POST
- Description: Add a new beneficiary to the database.
- Parameters:
grantor_id
(string): ID of the grantor (account owner).data
(object): JSON object containing beneficiary's information.
- Request Headers:
Authorization
(string): OAuth2 Bearer Token for authentication.
- Response:
- Success:
- Status Code: 201 Created
- Response Body: JSON object with a success message.
{ "message": "Beneficiary added successfully" }
- Failure:
- Status Code: 422 Unprocessable Entity
- Response Body: Error message indicating the failure reason.
- Success:
{
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"relation": "string"
}
- Endpoint:
/beneficiaries/account/{user_id}/beneficiaries
- HTTP Method: GET
- Description: Retrieve all beneficiaries associated with a given grantor's account.
- Parameters:
user_id
(string): ID of the grantor (account owner).
- Request Headers:
Authorization
(string): OAuth2 Bearer Token for authentication.
- Response:
- Success:
- Status Code: 200 OK
- Response Body: JSON array containing beneficiary information in the form of objects.
- Failure:
- Status Code: 204 No Content
- Response Body: No beneficiaries found message.
- Success:
- Endpoint:
/beneficiaries/account/{user_id}/beneficiary/{bene_id}
- HTTP Method: GET
- Description: Retrieve information about a specific beneficiary for a given grantor's account.
- Parameters:
user_id
(string): ID of the grantor (account owner).bene_id
(string): ID of the beneficiary to retrieve.
- Request Headers:
Authorization
(string): OAuth2 Bearer Token for authentication.
- Response:
- Success:
- Status Code: 200 OK
- Response Body: JSON object containing beneficiary information.
- Failure:
- Status Code: 404 Not Found
- Response Body: Beneficiary not found message.
- Success:
- Endpoint:
/beneficiaries/account/{grantor_id}/beneficiary/{bene_id}/update
- HTTP Method: PUT
- Description: Update beneficiary data in the database.
- Parameters:
grantor_id
(string): ID of the grantor (account owner).bene_id
(string): ID of the beneficiary to update.data
(object): JSON object containing beneficiary's data to update.
- Request Headers:
Authorization
(string): OAuth2 Bearer Token for authentication.
- Response:
- Success:
- Status Code: 200 OK
- Response Body: JSON object containing updated beneficiary information.
- Failure:
- Status Code: 304 Not Modified
- Response Body: Error message indicating the update failure reason.
- Success:
- Endpoint:
/beneficiaries/account/{grantor_id}/beneficiary/{bene_id}/delete
- HTTP Method: DELETE
- Description: Delete a beneficiary from the database.
- Parameters:
grantor_id
(string): ID of the grantor (account owner).bene_id
(string): ID of the beneficiary to delete.
- Request Headers:
Authorization
(string): OAuth2 Bearer Token for authentication.
- Response:
- Success:
- Status Code: 204 No Content
- Response Body: No content.
- Failure:
- Status Code: 304 Not Modified
- Response Body: Error message indicating the deletion failure reason.
- Success:
This API documentation provides a guide to using the "Beneficiaries" endpoints of the Estate Trust application. Ensure you have the necessary authentication token and provide valid data when making requests to these endpoints.
This documentation provides information on how to use the Estate Trust Assets API. The API allows users to manage assets, including creating, retrieving, updating, and deleting assets for specific grantors and beneficiaries.
The base URL for all API endpoints is /assets
.
All endpoints require authentication. Users must be authenticated to access these endpoints.
- Endpoint:
POST /{grantor_id}/create/asset
- Description: Add an asset to the database.
- Request Parameters:
grantor_id
(string, path): The ID of the grantor for whom the asset will be created.
- Request Body:
data
(object, JSON): Object that contains the asset information. It should follow the schema specified in theAddAsset
model.
- Response:
- Status code 201 (Created) on success.
- Status code 422 (Unprocessable Entity) on failure.
- Example Request:
POST /assets/{grantor_id}/create/asset Content-Type: application/json { "name": "Asset Name", "description": "Asset Description", "value": 100000 }
- Example Response (HTTP 201 Created):
{ "message": "Asset added successfully" }
- Endpoint:
GET /grantor/{grantor_id}/assets
- Description: Retrieve all assets for a specific grantor.
- Request Parameters:
grantor_id
(string, path): The ID of the grantor for whom assets will be retrieved.
- Response:
- Status code 200 (OK) on success with a list of assets.
- Status code 204 (No Content) if no assets are found.
- Example Request:
GET /assets/grantor/{grantor_id}/assets
- Example Response (HTTP 200 OK):
[ { "name": "Asset Name 1", "description": "Asset Description 1", "value": 100000 }, { "name": "Asset Name 2", "description": "Asset Description 2", "value": 75000 } ]
- Endpoint:
GET /beneficiary/{bene_id}/assets
- Description: Retrieve all assets for a specific beneficiary.
- Request Parameters:
bene_id
(string, path): The ID of the beneficiary for whom assets will be retrieved.
- Response:
- Status code 200 (OK) on success with a list of assets.
- Status code 204 (No Content) if no assets are found.
- Example Request:
GET /assets/beneficiary/{bene_id}/assets
- Example Response (HTTP 200 OK):
[ { "name": "Asset Name 1", "description": "Asset Description 1", "value": 100000 }, { "name": "Asset Name 2", "description": "Asset Description 2", "value": 75000 } ]
- Endpoint:
GET /{grantor_id}/assets/{asset_id}
- Description: Retrieve a specific asset.
- Request Parameters:
grantor_id
(string, path): The ID of the grantor who owns the asset.asset_id
(string, path): The ID of the asset to retrieve.
- Response:
- Status code 200 (OK) on success with the asset details.
- Status code 404 (Not Found) if the asset is not found.
- Example Request:
GET /assets/{grantor_id}/assets/{asset_id}
- Example Response (HTTP 200 OK):
{ "name": "Asset Name", "description": "Asset Description", "value": 100000 }
- Endpoint:
PUT /{grantor_id}/assets/{asset_id}/update
- Description: Update a specific asset.
- Request Parameters:
grantor_id
(string, path): The ID of the grantor who owns the asset.asset_id
(string, path): The ID of the asset to update.
- Request Body:
data
(object, JSON): Object that contains the updated asset information. It should follow the schema specified in theUpdateAsset
model.
- Response:
- Status code 200 (OK) on success with the updated asset details.
- Status code 304 (Not Modified) if the asset is not modified.
- Example Request:
PATCH /assets/{grantor_id}/assets/{asset_id}/update Content-Type: application/json { "name": "Updated Asset Name", "description": "Updated Asset Description", "value": 150000 }
- Example Response (HTTP 200 OK):
{ "name": "Updated Asset Name", "description": "Updated Asset Description", "value": 150000 }
- Endpoint:
DELETE /{grantor_id}/assets/{asset_id}/delete
- Description: Delete a specific asset.
- Request Parameters:
grantor_id
(string, path): The ID of the grantor who owns the asset.asset_id
(string, path): The ID of the asset to delete.
- Response:
- Status code 204 (No Content) on success.
- Status code 304 (Not Modified) if the asset is not deleted.
- Example Request:
DELETE /assets/{grantor_id}/assets/{asset_id}/delete
- Example Response (HTTP 204 No Content): No content is returned on successful deletion.
In case of an error, the API will return a JSON response with an error message and an appropriate HTTP status code.
Example Error Response (HTTP 404 Not Found):
{
"detail": "Asset not found"
}
This documentation provides an overview of the Estate Trust Assets API and its endpoints. Users can create, retrieve, update, and delete assets for specific grantors and beneficiaries using these endpoints.
This API documentation provides information about the Monetaries Router for the "Estate Trust" application. The Monetaries Router is responsible for managing monetary assets and provides endpoints for creating, retrieving, updating, and deleting these assets.
The base URL for all endpoints in this API is /monetaries
.
Authentication is required for most endpoints in this API. Users must obtain a valid OAuth token to access these endpoints. The get_current_user
function is used to authenticate users.
Errors in this API are communicated through HTTP status codes and JSON response bodies. Common status codes include:
- 200 OK: Successful operation
- 201 Created: Resource successfully created
- 204 No Content: Resource not found or deleted
- 304 Not Modified: Error occurred while processing the request
- 400 Bad Request: Invalid request data
- 401 Unauthorized: Authentication required
- 404 Not Found: Resource not found
- 422 Unprocessable Entity: Error occurred while processing the request
- HTTP Method: POST
- Endpoint:
/monetaries/asset/{grantor_id}/create/monetary
- Parameters:
grantor_id
(string): ID of the grantor creating the asset.
- Request Body (JSON):
AddMonetary
schema - Authentication: Required
- Response:
- 201 Created: Asset created successfully
- 422 Unprocessable Entity: Error occurred while adding the asset
- Description: This endpoint allows a grantor to create a new monetary asset. The
AddMonetary
schema defines the required data for creating the asset.
- HTTP Method: GET
- Endpoint:
/monetaries/asset/asset/{grantor_id}/assets
- Parameters:
grantor_id
(string): ID of the grantor to retrieve assets for.
- Authentication: Required
- Response: List of
MonetaryRes
schemas - Description: This endpoint retrieves all monetary assets for a specific grantor.
- HTTP Method: GET
- Endpoint:
/monetaries/asset/beneficiary/{bene_id}/assets
- Parameters:
bene_id
(string): ID of the beneficiary to retrieve assets for.
- Authentication: Required
- Response: List of
MonetaryRes
schemas - Description: This endpoint retrieves all monetary assets associated with a specific beneficiary.
- HTTP Method: GET
- Endpoint:
/monetaries/asset/grantor/{grantor_id}/assets/{asset_id}
- Parameters:
grantor_id
(string): ID of the grantor who owns the asset.asset_id
(string): ID of the asset to retrieve.
- Authentication: Required
- Response:
MonetaryRes
schema - Description: This endpoint retrieves information about a specific monetary asset owned by a grantor.
- HTTP Method: PUT
- Endpoint:
/monetaries/asset/grantor/{grantor_id}/assets/{asset_id}/update
- Parameters:
grantor_id
(string): ID of the grantor who owns the asset.asset_id
(string): ID of the asset to update.
- Request Body (JSON):
UpdateMonetary
schema - Authentication: Required
- Response:
MonetaryRes
schema - Description: This endpoint allows a grantor to update the information of a specific monetary asset.
- HTTP Method: DELETE
- Endpoint:
/monetaries/asset/grantor/{grantor_id}/assets/{asset_id}/delete
- Parameters:
grantor_id
(string): ID of the grantor who owns the asset.asset_id
(string): ID of the asset to delete.
- Authentication: Required
- Response:
- 204 No Content: Asset deleted successfully
- 304 Not Modified: Error occurred while deleting the asset
- Description: This endpoint allows a grantor to delete a specific monetary asset.
AddMonetary
: Schema for creating a new monetary asset.MonetaryRes
: Schema for representing a monetary asset.UpdateMonetary
: Schema for updating an existing monetary asset.
Please refer to the code and comments within the API for more specific details about the data schemas and their structures.
The API may return other HTTP status codes and corresponding error messages in case of unexpected errors or invalid requests. These error responses will include a status code and a detailed error message.
- Chukwuebuka Ejie (Software Engineer) [email protected]
- Franklin Ikeogu Chidera (Software Engineer)