Bui-Christopher / homie

Home Insight Extraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

homie πŸ πŸ“Š - Home Insight Extraction GitHub last commit (branch)

Rust Zillow PostgreSQL Leptos Plotly

Description πŸ’‘

Homie aims to display visualizations of housing market datasets.

It answers two vital questions:

  1. What value of a home is fair? πŸ’°
  2. What value of a mortgage interest rate is fair? πŸ“ˆ

Diagram

System Architecture Diagram Software Architecture Diagram

The technology stack was chosen by stacks I'm unfamiliar or interested in.

homie-api

This service hosts an HTTP API which reads and serves the dataset to the end user. I had not created HTTP servers with axum before, thus it was chosen. Additionally, the focus was to extend its basic handlers with custom errors and extractors.

homie-core

This library's focus was to design the application with a Hexagonal Architecture approach. It has two main modules: adapters and domain. The repository adapter has been abstracted to be capable of utilizing and database.

homie-data

This service reads CSV data and writes to an SQL database. Most of my experience is with NoSQL and Key-Value stores. Thus, I chose SQLx and PostgreSQL. It has flexible configurations, and writes in accordance to its environment variables.

homie-webapp

This service will run server-sided-rendering (SSR) application for the end users. I have very little front end experience, and wanted to develop it entirely in Rust and chose the Leptos framework. It is served as a WASM binary and utilizes plotly for interactive visualizations.

Datasets

Current datasets include Zillow, FHFA, Fed Treasury, and Huduser. The datasets are publicly available, downloaded and stored into Postgres. Zillow's public API key can be requested for up to date information; however, their terms of service state that it cannot be stored into a database.

Quick Start ⚑

Requirements

Before getting started, make sure you have Docker installed and running. Also, install jq to run the bash script tests.

Running

./local/run.sh
./local/test.sh

This script will pull and run the required images. It will locally deploy with a database, backend, and frontend. Please check http://localhost:3000.

MVP/Essential TODOs πŸ“‹

  • homie-core
    • Define Domain
    • Define Adapters
  • homie-data
    • Read Dataset
    • Convert to Application Domain
    • Store into repository (Postgres)
      • Regions (cities/counties/zipcodes)
  • homie-api
    • Handle Request
    • Retrieve Data
    • Return Response
    • /api/..
  • homie-webapp
    • Get User's Query Params
    • Submit Request
    • Display Data in Graph

Improvements

  • Local Development
    • Automate creating database
      • Can also initialize with docker exec
    • Reduce local datasets size
      • HPI
      • Region
  • Optimize ZHVI (batch insert prices)
  • Refactor
    • Reduce public struct/fn exposure
    • Read Bulder Pattern Won't use it, but I understand it
    • Enums instead of Strings Example
    • Repo/Import calls into Config
    • Remove getters on public objects
  • Error Handling
    • ThisError and Anyhow Created a custom enum instead
    • Logging
  • Deployment
    • Dockerize
    • Push to dockerhub Going to use bash script to build and deploy
    • Read Zhvi from Zillow API
    • CI/CD
  • Testing ...I mean good enough?
    • Unit tests 😭
    • E2E tests 😭

About

Home Insight Extraction

License:MIT License


Languages

Language:Rust 89.3%Language:Shell 9.2%Language:Dockerfile 1.4%Language:HTML 0.2%