You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-7
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,10 @@ A FastAPI application that helps you compare different Brazilian investment inde
24
24
- Automatic tax calculation based on investment type and period
25
25
- Historical data from Brazilian Central Bank API
26
26
- Future projections based on historical volatility and trends
27
+
- Dynamic IPCA data retrieval with multi-level fallback strategies
27
28
- Bitcoin price data from CryptoCompare API
29
+
- User-friendly interface with Today buttons for date selection
30
+
- Convenient form reset with New Query button
28
31
- Robust error handling and logging
29
32
- Easy-to-use REST API
30
33
@@ -41,16 +44,30 @@ A FastAPI application that helps you compare different Brazilian investment inde
41
44
uv pip install -e .
42
45
```
43
46
47
+
## Building the UI
48
+
49
+
The NestEgg UI is built with TypeScript and requires Node.js to compile the TypeScript code to JavaScript.
50
+
51
+
1. Make sure you have Node.js installed (version 16+)
52
+
53
+
2. Build the TypeScript files:
54
+
```bash
55
+
cd nestegg/static
56
+
./build.sh
57
+
```
58
+
44
59
## Usage
45
60
46
61
1. Start the server:
47
62
```bash
48
63
uvicorn nestegg.main:app --reload --port 8001
49
64
```
50
65
51
-
2.Open your browser and navigate to `http://localhost:8001/docs` to access the interactive API documentation
66
+
2.Access the UI by navigating to `http://localhost:8001` in your browser
52
67
53
-
3. Make a POST request to `/api/v1/calculate` with a JSON body like:
68
+
3. Or access the API documentation at `http://localhost:8001/docs` to use the interactive API
69
+
70
+
4. Make a POST request to `/api/v1/calculate` with a JSON body like:
54
71
```json
55
72
{
56
73
"investment_type": "cdb",
@@ -61,7 +78,7 @@ A FastAPI application that helps you compare different Brazilian investment inde
61
78
}
62
79
```
63
80
64
-
4. Or compare multiple investments at once with:
81
+
5. Or compare multiple investments at once with:
65
82
```bash
66
83
curl -X POST "http://localhost:8001/api/v1/compare?amount=10000&start_date=2024-01-01&end_date=2024-12-31&cdb_rate=14.5&lci_rate=12.0&lca_rate=11.5&ipca_spread=5.5&selic_spread=2.0&cdi_percentage=109.0"
67
84
```
@@ -140,13 +157,19 @@ Request parameters:
140
157
-`cdb_rate`: CDB rate as percentage (optional)
141
158
-`lci_rate`: LCI rate as percentage (optional)
142
159
-`lca_rate`: LCA rate as percentage (optional)
143
-
-`ipca_spread`: IPCA spread in percentage points (optional, default: 0)
144
-
-`selic_spread`: SELIC spread in percentage points (optional, default: 0)
-`include_poupanca`: Whether to include Poupança in comparison (optional, default: false)
168
+
-`include_selic`: Whether to include base SELIC in comparison (optional, default: false)
169
+
-`include_cdi`: Whether to include base CDI in comparison (optional, default: false)
170
+
-`include_btc`: Whether to include Bitcoin in comparison (optional, default: false)
171
+
172
+
The comparison will only include investment types that are explicitly requested through parameters.
150
173
151
174
Response:
152
175
```json
@@ -238,6 +261,11 @@ curl -X POST "http://localhost:8001/api/v1/compare?amount=10000&start_date=2024-
238
261
curl -X POST "http://localhost:8001/api/v1/compare?amount=10000&start_date=2024-01-01&end_date=2024-12-31&cdb_rate=14.5&lci_rate=12.0&lca_rate=11.5&ipca_spread=5.5&selic_spread=2.0&cdi_percentage=109.0&lci_cdi_percentage=95.0&lca_cdi_percentage=90.0&lci_ipca_spread=4.5&lca_ipca_spread=4.0"
239
262
```
240
263
264
+
### Compare investments with specific default types included
265
+
```bash
266
+
curl -X POST "http://localhost:8001/api/v1/compare?amount=10000&start_date=2024-01-01&end_date=2024-12-31&lci_rate=13.5&lci_cdi_percentage=94.0&include_poupanca=true&include_btc=true"
267
+
```
268
+
241
269
### Compare investments with future dates (projections)
242
270
```bash
243
271
curl -X POST "http://localhost:8001/api/v1/compare?amount=10000&start_date=2025-01-01&end_date=2025-12-31&cdb_rate=14.5&lci_rate=12.0&lca_rate=11.5&ipca_spread=5.5&selic_spread=2.0&cdi_percentage=109.0"
@@ -257,7 +285,17 @@ The application uses the following data sources:
257
285
- Current and historical Bitcoin prices in BRL
258
286
- Future Bitcoin price projections based on historical volatility
259
287
260
-
For future dates, the application uses sophisticated projections based on historical data patterns and volatility. These projections are clearly marked in the results.
288
+
For future dates, the application uses sophisticated projections based on historical data patterns and volatility. These projections are clearly marked in the results. For IPCA, the system employs a multi-level dynamic fallback strategy using recent historical data.
289
+
290
+
## UI Features
291
+
292
+
The web interface provides several user-friendly features:
293
+
294
+
-**Today Buttons**: Next to date inputs, allowing you to quickly set a date to today
295
+
-**New Query Button**: Resets all selections and results to start fresh
296
+
-**Responsive Design**: Works well on desktop and mobile devices
297
+
-**Dynamic Investment Selection**: Only selected investment types are included in comparisons
298
+
-**Interactive Results**: Clear visualization of investment performance
0 commit comments