Set up a local development environment for Rates API and start contributing to the project.
This guide will help you set up a local development environment for Rates API, allowing you to make changes, test new features, and contribute to the project.
Before you begin, make sure you have the following installed:
Using Bun to install dependencies:
Start the local development server:
This will start the server at http://localhost:8787
. You can access the API and Swagger UI documentation at this URL.
The project includes scripts to scrape rate data from financial institution websites. These scripts are located in the bin/
directory.
To run a scraper script:
Available scraper scripts:
scrape-mortgage-rates.ts
: Fetches current mortgage ratesscrape-personal-loan-rates.ts
: Fetches personal loan ratesscrape-car-loan-rates.ts
: Fetches car loan ratesscrape-credit-card-rates.ts
: Fetches credit card ratesThe scraped data is stored in the CloudFlare D1 database, allowing for comprehensive historical data management.
The project uses CloudFlare D1, a serverless SQL database built on SQLite, for data storage. This allows for efficient storage and querying of both current and historical rate data.
For local development, you’ll need to set up a local D1 database:
The database schema includes tables for:
src/
: Contains the main application code
index.ts
: The entry point for the applicationmodels/
: Data schemas and typesroutes/
: API endpoint handlerslib/
: Utility functions and helpersbin/
: Scripts for scraping data
schema.sql
: Database schema definition file
Before submitting changes, make sure to:
src/routes/
src/models/
bin/
Set up a local development environment for Rates API and start contributing to the project.
This guide will help you set up a local development environment for Rates API, allowing you to make changes, test new features, and contribute to the project.
Before you begin, make sure you have the following installed:
Using Bun to install dependencies:
Start the local development server:
This will start the server at http://localhost:8787
. You can access the API and Swagger UI documentation at this URL.
The project includes scripts to scrape rate data from financial institution websites. These scripts are located in the bin/
directory.
To run a scraper script:
Available scraper scripts:
scrape-mortgage-rates.ts
: Fetches current mortgage ratesscrape-personal-loan-rates.ts
: Fetches personal loan ratesscrape-car-loan-rates.ts
: Fetches car loan ratesscrape-credit-card-rates.ts
: Fetches credit card ratesThe scraped data is stored in the CloudFlare D1 database, allowing for comprehensive historical data management.
The project uses CloudFlare D1, a serverless SQL database built on SQLite, for data storage. This allows for efficient storage and querying of both current and historical rate data.
For local development, you’ll need to set up a local D1 database:
The database schema includes tables for:
src/
: Contains the main application code
index.ts
: The entry point for the applicationmodels/
: Data schemas and typesroutes/
: API endpoint handlerslib/
: Utility functions and helpersbin/
: Scripts for scraping data
schema.sql
: Database schema definition file
Before submitting changes, make sure to:
src/routes/
src/models/
bin/