Tiny aiohttp API example for fund customization. This service is intentionally an unauthenticated demo: requests do not require auth headers, users, groups, permissions, tenants, or site scoping.
The app follows the local aiohttp_boilerplate structure used by the fund
manager API: environment defaults live in app/config.py, routes are registered
from app/routes.py, app/models.py defines the funds model, and views use
the boilerplate app/DB pool conventions.
GET /v1.0/fundsPOST /v1.0/fundsGET /v1.0/funds/exportGET /v1.0/funds/{slug}
Create a local PostgreSQL database:
createdb torque_practical_exampleInstall dependencies:
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt -r requirements-dev.txt
cp .env.example .envRun the API. Database settings use the same DB_* environment names as the
fund manager API: DB_DATABASE, DB_USER, DB_PASSWORD, DB_HOST, and
DB_PORT. Defaults point at local PostgreSQL database
torque_practical_example with user/password postgres. make.sh sources
.env before running commands.
./make.sh run-devRun tests and lint:
./make.sh test
./make.sh lintcurl http://localhost:8080/v1.0/funds
curl 'http://localhost:8080/v1.0/funds?search=income&limit=1&offset=0'
curl -OJ http://localhost:8080/v1.0/funds/export
curl http://localhost:8080/v1.0/funds/torque-income-fundCreate a fund:
curl -X POST http://localhost:8080/v1.0/funds \
-H 'Content-Type: application/json' \
-d '{
"name": "Torque Opportunity Fund",
"slug": "torque-opportunity-fund",
"description": "Example opportunistic fund.",
"status": "open",
"targetRaise": 2500000,
"capacityLimit": 5000000,
"currentNav": 10.75,
"totalShares": 250000,
"showOnDashboard": true
}'docker compose up --buildThe API will be available at http://localhost:8080.
- Add authentication and authorization.
- Add tenant or site scoping if the product needs it.
- Replace the demo schema loader with real migration management.
- Add production observability, backup, and operational controls.