- install Java 17, Gradle, docker, docker-compose (see also Technical Concept Page)
sudo usermod -a -G docker $username
- If you're running selinux,
sudo setfacl -m $username:6 /var/run/docker.sock
- Log in again in to pick up the new permissions.
./gradlew jibDockerBuild
- Start the services:
docker-compose up
will start the databases (ours and 2 for Fusion Auth), and you'll want to run com.clearspend.capital.CapitalApplication with your IDE.docker-compose --profile mon up
will also start Prometheus and Grafana to monitor this service running in your IDE.docker-compose --profile ui up
will also start UI service in a container pointing to the application running in your IDE To make it happen - checkout the latest capital-ui sources to the ../capital-ui folder and then usedocker-compose --profile ui build
- com.clearspend.capital.CapitalApplication is the main class
- Spring actuator status check:
curl http://localhost:8080/actuator/health
See also our schema which is managed by flyway.
To check test coverage, ./gradlew jacocoTestReport
then open build/reports/jacoco/test/html/index.html
.
./gradlew jacocoCoverageValidation
will see if coverage is at least as good as the limit set in build.gradle.kts
Note that test coverage generally should not be 100% because that's silly, and high test coverage is, on its own, not saying that the tests are sufficient. It's one measure among many (most not applied here yet) of test effectiveness.
- Fusion Auth: http://127.0.0.1:9011 [email protected]/admin
- Prometheus: http://127.0.0.1:9090
- Grafana: http://127.0.0.1:3000 [email protected]/admin
To avoid publishing secrets to a git repository, the plaid secret is
held in an env variable named CLIENT_PLAID_SECRET
. Plaid features are
not required to run the rest of the app, so it is not
necessary to include it if you don't plan on linking bank accounts.
If you do wish to use plaid features, populate the variable. This value can
be found in the Plaid dashboard.
Sequence of APIs:
- Create Business and Business Owner
- POST
/business-prospects
- POST
/business-prospects/{businessProspectId}/validate-identifier
(email) - POST
/business-prospects/{businessProspectId}/phone
- POST
/business-prospects/{businessProspectId}/validate-identifier
(phone) - POST
/business-prospects/{businessProspectId}/password
- POST
/business-prospects/{businessProspectId}/convert
- POST
/business-owners
- PUT
/business-owners/{businessOwnerId}
- POST
- Link Bank Account. All business-bank-accounts calls require businessId to be passed in a header
until we have JWTs
- GET
/business-bank-accounts/link-token
- GET
/business-bank-accounts/link-token/{linkToken}/accounts
- GET
- Deposit to or withdraw from a Business account to a bank account
- GET
/business-bank-accounts
- POST
/business-bank-accounts/{businessBankAccountId}/transactions
- GET
- Retrieve Business Account information
- POST
/businesses/accounts
(get business account)
- POST
- Create Allocation
- GET
/programs
- POST
/allocations
- GET
- Traverse allocations
- GET
/allocations/{allocationId}
(get one) - GET
/businesses/allocations
(get root Allocations) - GET
/allocations/{allocationId}/children
(get children of an allocation)
- GET
- Reallocate funds
- POST
/businesses/transactions
(Business <-> Allocation) - POST
/allocations/{allocationId}/transactions
(Allocation <-> Card)
- POST
This repo contains samples of dynamic templates: https://github.com/sendgrid/email-templates