Files
Rocketmc/CLAUDE.md
aecsocket 17f395ee55 Mural Pay integration (#4520)
* wip: muralpay integration

* Basic Mural Pay API bindings

* Fix clippy

* use dotenvy in muralpay example

* Refactor payout creation code

* wip: muralpay payout requests

* Mural Pay payouts work

* Fix clippy

* add mural pay fees API

* Work on payout fee API

* Fees API for more payment methods

* Fix CI

* Temporarily disable Venmo and PayPal methods from frontend

* wip: counterparties

* Start on counterparties and payment methods API

* Mural Pay multiple methods when fetching

* Don't send supported_countries to frontend

* Add countries to muralpay fiat methods

* Compile fix

* Add exchange rate info to fees endpoint

* Add fees to premium Tremendous options

* Add delivery email field to Tremendous payouts

* Add Tremendous product category to payout methods

* Add bank details API to muralpay

* Fix CI

* Fix CI

* Remove prepaid visa, compute fees properly for Tremendous methods

* Add more details to Tremendous errors

* Add fees to Mural

* Payout history route and bank details

* Re-add legacy PayPal/Venmo options for US

* move the mural bank details route

* Add utoipa support to payout endpoints

* address some PR comments

* add CORS to new utoipa routes

* Immediately approve mural payouts

* Add currency support to Tremendous payouts

* Currency forex

* add forex to tremendous fee request

* Add Mural balance to bank balance info

* Add more Tremendous currencies support

* Transaction payouts available use the correct date

* Address my own review comment

* Address PR comments

* Change Mural withdrawal limit to 3k

* maybe fix tremendous gift cards

* Change how Mural minimum withdrawals are calculated

* Tweak min/max withdrawal values

---------

Co-authored-by: Calum H. <contact@cal.engineer>
Co-authored-by: Alejandro González <me@alegon.dev>
2025-11-03 14:19:46 -08:00

3.2 KiB

Architecture

Use TAB instead of spaces.

Frontend

There are two similar frontends in the Modrinth monorepo, the website (apps/frontend) and the app frontend (apps/app-frontend).

Both use Tailwind v3, and their respective configs can be seen at tailwind.config.ts and tailwind.config.js respectively.

Both utilize shared and common components from @modrinth/ui which can be found at packages/ui, and stylings from @modrinth/assets which can be found at packages/assets.

Both can utilize icons from @modrinth/assets, which are automatically generated based on what's available within the icons folder of the packages/assets directory. You can see the generated icons list in generated-icons.ts.

Both have access to our dependency injection framework, examples as seen in packages/ui/src/providers/. Ideally any state which is shared between a page and it's subpages should be shared using this dependency injection framework.

Website (apps/frontend)

Before a pull request can be opened for the website, pnpm web:fix and pnpm web:intl:extract must be run, otherwise CI will fail.

To run a development version of the frontend, you must first copy over the relevant .env template file (prod, staging or local, usually prod) within the apps/frontend folder into apps/frontend/.env. Then you can run the frontend by running pnpm web:dev in the root folder.

App Frontend (apps/app-frontend)

Before a pull request can be opened for the website, you must CD into the app-frontend folder; pnpm fix and pnpm intl:extract must be run, otherwise CI will fail.

To run a development version of the app frontend, you must first copy over the relevant .env template file (prod, staging or local, usually prod) within packages/app-lib into packages/app-lib/.env. Then you must run the app itself by running pnpm app:dev in the root folder.

Localization

Refer to .github/instructions/i18n-convert.instructions.md if the user asks you to perform any i18n conversion work on a component, set of components, pages or sets of pages.

Labrinth

Labrinth is the backend API service for Modrinth.

Testing

Before a pull request can be opened, run cargo clippy -p labrinth --all-targets and make sure there are ZERO warnings, otherwise CI will fail.

Use cargo test -p labrinth --all-targets to test your changes. All tests must pass, otherwise CI will fail.

To prepare the sqlx cache, cd into apps/labrinth and run cargo sqlx prepare. Make sure to NEVER run cargo sqlx prepare --workspace.

Read the root docker-compose.yml to see what running services are available while developing. Use docker exec to access these services.

When the user refers to "performing pre-PR checks", do the following:

  • Run clippy as described above
  • DO NOT run tests unless explicitly requested (they take a long time)
  • Prepare the sqlx cache

Clickhouse

Use docker exec labrinth-clickhouse clickhouse-client to access the Clickhouse instance. We use the staging_ariadne database to store data in testing.

Postgres

Use docker exec labrinth-postgres psql -U postgres to access the PostgreSQL instance.

Guidelines

  • Do not create new non-source code files (e.g. Bash scripts, SQL scripts) unless explicitly prompted to.