# Tips for Findy Agency wallet development
You need at least *git*, *Docker* and *Node.js*/*nvm* v18
## Clone repositories
1. PWA: current wallet web application
```bash=
git clone git@github.com:findy-network/findy-wallet-pwa.git
```
2. Issuer-tool: web GUI app for testing issuing + verifying
```bash=
git clone git@github.com:findy-network/findy-issuer-tool.git
```
## Start applications
### Agency backend
```bash=
cd findy-wallet-pwa
cd tools/env-local
make pull-up
```
### PWA frontend
```bash=
cd findy-wallet-pwa
# or make sure node v18 is in use
nvm use
npm install
npm start
```
Open http://localhost:3000 with browser.
Register new user and login with WebAuthn.
### Issuer Tool
#### Backend
```bash=
cd findy-issuer-tool/api
# or make sure node v18 is in use
nvm use
npm install
export ISSUER_TOOL_SERVER_CERT_PATH="../../findy-wallet-pwa/tools/env/config/cert/"
export AWS_ACCESS_KEY_ID="foo"
export AWS_SECRET_ACCESS_KEY="bar"
npm run db
npm start
```
#### Frontend
```bash=
cd findy-issuer-tool/frontend
# or make sure node v18 is in use
nvm use
npm install --legacy-peer-deps
npm start
```
Open browser at http://localhost:8081/
Login using "Dev login"-button
## Use case simulation
* Issuer-tool simulates here the backend functionality
* **Issue receipt credential to seller**
* create schema and cred def with issuer tool
* name: receipt
* version: 1.0
* attributes:
* name: tv, price: 100, location: Verkkokauppa
* cred def tag: Verkkokauppa
* make pairwise connection to issuer-tool from seller user
* send message to seller
* send credential to seller
* **Issue ID credential to buyer**
* create schema and cred def with issuer tool or use FTN credential
* make pairwise connection to issuer-tool from buyer user
* send message to buyer
* send credential to buyer
* Simulate discussion between buyer and seller
* Verification
## PWA
* Authentication: token
* Example for using hard-coded token in flutter app: https://github.com/lauravuo/flutter-graphql-example/blob/49cdd38542d2304b4bc4a3598d2d19225758f943/lib/main.dart#L14
* Generate token with findy-agent-cli or copy-paste token from browser dev tools (Application -> Storage -> Local Storage)
* See examples on API use from PWA components
* GraphQL API
* vault API: https://github.com/findy-network/findy-agent-vault#api
* GraphQL playground: add `FAV_USE_PLAYGROUND` env variable to vault config (`findy-wallet-pwa/tools/env-local/docker-compose.yml`) and open browser to http://localhost:8085

Add token to header:
