This is repository for Donate4.Fun webservice and browser extension. Directory structure:
/donate4fun/
- backend (API)/tests/
- tests for backend/frontend/
- website and shared libraries/extensions/
- browser extensions/charts/
- Helm charts for webservice and dependencies (LND, PostgreSQL, Tor)/docker/
- Docker-compose config and Dockerfiles for local development
For developing you need a Docker and docker-compose (see /docker dir). It's recommended to use some virtual env manager, for example direnv.
- Create config.yaml
- launch Docker containers
(cd docker; docker-compose up -d)
- launch api
python -m donate4fun
- launch frontend
(cd frontend; pnpm run dev)
Run tests with pytest
from repository root.
If tests are failing with error FAILURE_REASON_INSUFFICIENT_BALANCE try restarting lnd-bob:
docker-compose restart lnd-bob
Sometimes channel could not start after starting all services.
If you are getting an error 'database "donate4fun-test" already exists' then connect to local postgresql and drop this database
psql -U postgres -c 'drop database "donate4fun-test"'
You need to install both frontend and extension dependencies to build.
(cd frontend && pnpm i)
cd extensions/src
pnpm i
pnpm run dev
Then open browser and install unpacked extension from extensions/chrome
or extensions/firefox
.
To build release versions run npm run package-clean
.
For deploying publicly you need a Kubernetes cluster and Helm (see /charts dir).
./deploy.sh tor
./deploy.sh lnd
./deploy.sh rtl
./deploy-donate4fun.sh
To build release version of extension
cd extensions/src
pnpm install
pnpm build
To make a new release and publish extension to Chrome Web Store
NB: always build with pnpm build
before publishing
cd extensions/src
npx semantic-release --no-ci
The following environment variables are needed
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GOOGLE_REFRESH_TOKEN
Read this guide on how to obtain them.
To publish add-on to addons.mozilla.org
(cd extensions/src && pnpm package-clean)
./scripts/publish-amo.py
The following environment variables are needed
AMO_JWT_ISSUER
AMO_JWT_SECRET
Read this doc on how to obtain them.