Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Dependency directories

node_modules/
jspm_packages/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# public

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# wrangler project

.dev.vars*
!.dev.vars.example
.env*
!.env.example
.wrangler/

# python-specific
python_modules/
.venv/
.venv-workers/
.python-version
__pycache__/
.mypy_cache/
.pytest_cache/
28 changes: 28 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Subctrl Rates Proxy

In the future, I might separate this into a separate service.

Local development uses uv and FastAPI.

```bash
uv sync
uv tool run --from workers-py pywrangler dev
```

The API is versioned under `/v1` and expects `base` + `quotes` query params.

## Configuration

Backend details and deployment instructions live in `docs/pages/proxy-backend.md`.

Default proxy configuration (from `backend/wrangler.jsonc`):

- `CACHE_MAX_AGE_SECONDS=10800` (3 hours, cache TTL for `/v1/rates` responses).
- `RATE_LIMIT_MAX=50` (max requests per IP in the window).
- `RATE_LIMIT_WINDOW_SECONDS=60` (rate limit window in seconds).
- `UPSTREAM_TIMEOUT_SECONDS=6` (timeout for Yahoo upstream requests).


# [tool.uv.scripts]
# format = "ruff check --select I --fix . && ruff format ."
# lint = "ruff check . && mypy src"
Loading
Loading