This application is designed to compare divination card prices to the price of their respective rewards, allowing users to determine potential profits.
This application is built using React and TypeScript. To get started:
-
Clone the Repository:
git clone https://github.com/hernok/div-card-profit cd div-card-profit
-
Setup the Environment File:
Create a .env file in the root directory of the project with the following contents:
REACT_APP_CURRENT_LEAGUE=Ancestor REACT_APP_BASE_URL=/api
Note: Ensure that the .env file is added to your .gitignore to prevent accidentally pushing sensitive information to the repository.
-
Install Dependencies:
- npm install
-
Start the Application:
- npm start
Upon running the npm start command, the application should launch in your default web browser. If not, you can manually access it by navigating to http://localhost:3000/.
- Sorting: Users can sort data by profit. Simply click the button corresponding to the currency type (chaos or divine) you'd like to sort by.
- Data Fetching: Fetch the latest data by pressing the fetch button.
- Data Processing: Before comparing the data, the application processes it in the following way:
- Modifies item names to match divination card rewards with their actual names.
- If the
currencyDetails
property exists, it's removed as it's unnecessary for this application. - The data within the first set of curly braces is extracted using regex and match techniques.
- The complete reward name is derived, taking into account all characters until a special character or the end is reached.
- All data types are consolidated into a singular array.
- The filter method is employed to pinpoint items that match specific criteria.
- Out of approximately 370 divination cards in the game, only 135 are rendered within the application. Most excluded cards are considered "gamble cards".
To determine profit: Profit = (Number of Rewards * Price per Reward) - (Number of Cards * Price per Card)
- Currency: Currency Endpoint
- Fragment: Fragment Endpoint
- Oils: Oils Endpoint
- Scarabs: Scarabs Endpoint
- Fossils: Fossils Endpoint
- Essence: Essence Endpoint
- Divination Cards: Divination Cards Endpoint
- Skill Gems: Skill Gems Endpoint
- Base Types: Base Types Endpoint
- Unique Maps: Unique Maps Endpoint
- Unique Jewels: Unique Jewels Endpoint
- Unique Flasks: Unique Flasks Endpoint
- Unique Weapons: Unique Weapons Endpoint
- Unique Armours: Unique Armours Endpoint
- Unique Accessories: Unique Accessories Endpoint
The application and its data is primarily sourced from the poe.ninja API. Ensure you're aware of any limitations or terms of service when interacting with or using this data.