Minimal portfolio app.
- backend:
cargo runfrombackend/ - frontend:
npm run devfromweb/ - tests:
cargo testfrombackend/andnpm testfromweb/
The frontend reads the backend base URL from VITE_API_BASE_URL.
- Copy
web/.env.exampletoweb/.env.local. - Set
VITE_API_BASE_URLto the backend URL you want the frontend to use. - Start the frontend with
npm run devfromweb/.
Example:
cp web/.env.example web/.env.local
echo 'VITE_API_BASE_URL=http://127.0.0.1:3000/api' > web/.env.localFor local Vite development, set VITE_API_BASE_URL explicitly. If it is not set, the frontend defaults to /api, which is the path the backend exposes its API under when it serves the bundled frontend.
The backend serves both the API and the bundled Vite frontend from a single container image:
backend/Dockerfilebuilds the Rust API and bundles the static frontend (built withVITE_API_BASE_URL=/api) into/app/webdocker-compose.ymldeploys the prebuilt tagged imagedocker-compose.build.ymladds local build support on top of the base compose file
The backend expects:
PORTDB_PATHWEB_DIR(defaults toweb/distfor local runs and/app/webin the container; leave it pointing at a directory containingindex.htmland the Vite asset output)- optional market data provider keys from
backend/.env.example
DB_PATH should point to persistent storage. Do not rely on the container filesystem for SQLite durability.
Stock price refresh uses Yahoo Finance by default, which requires no API key and supports Yahoo-style exchange suffixes such as GRID.MI. Paid providers such as Twelve Data are optional fallbacks; leave their API key variables empty to stay on the no-key path.
The CI workflow publishes a tagged backend image to GHCR on every git tag push. The default Compose configuration pulls from the asiniscalchi namespace unless GHCR_OWNER or BACKEND_IMAGE is set.
ghcr.io/<owner>/siniscalco:<tag>
Deploy a release tag by setting a shared APP_TAG:
export APP_TAG=v0.1.0
docker compose pull
docker compose up -dTo build from the checked-out source instead of pulling tagged images, use the build override file:
export APP_TAG=dev
docker compose -f docker-compose.yml -f docker-compose.build.yml up --buildThe base compose file keeps the final image name and tag stable. The build override adds build: and pull_policy: never so --build does not try to pull first. The build sets VITE_API_BASE_URL=/api by default.
The default compose ports expose:
- backend (API + frontend) on
http://127.0.0.1:3000
The compose file uses a named volume for backend SQLite data.
The bundled frontend always targets VITE_API_BASE_URL as set at build time, defaulting to /api. For a deployment where the API is hosted on a separate public origin, rebuild the image with the desired public VITE_API_BASE_URL.
/.github/workflows/ci.yml runs on every push and pull request. It validates:
- backend tests
- frontend lint, typecheck, tests, and build
- a Docker image build that bundles backend + frontend
This project is licensed under the Apache License 2.0. See LICENSE.