diff --git a/CLAUDE.md b/CLAUDE.md index 00c0301fdb6..5823d30c843 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,20 +22,25 @@ Only run these commands in the directories related to the changes being made. Do # Install dependencies and setup development environment npm install -# Run the protocol stack locally (requires Docker) -npm run protocol +# Run web application against production (the typical default) +npm run web -# Connect client to local protocol -audius-compose connect +# Run mobile applications against production +npm run ios +npm run android + +# Special: run against a locally-running protocol stack (requires Docker + `npm run protocol`) +# Only use these when you have explicitly started the full stack locally — they are NOT the default. +# The `:local` suffix means "against my local stack", NOT "dev mode" — do not run these by default. +npm run web:local +npm run ios:local +npm run android:local -# Run web application -npm run web:dev # Against local services -npm run web:stage # Against staging -npm run web:prod # Against production +# Run the protocol stack locally (only needed for the *:local variants above) +npm run protocol +audius-compose connect -# Run mobile applications -npm run ios:dev # iOS local development -npm run android:dev # Android local development +# NOTE: There is no longer a staging environment. Do not look for or run *:stage or *:dev scripts at the root. # Testing npm run test # Run all tests via Turbo diff --git a/README.md b/README.md index 691d15a5db1..699372ef526 100644 --- a/README.md +++ b/README.md @@ -47,19 +47,19 @@ This will do the following: ### Running the Apps -Environments: +The bare app name (e.g. `web`, `ios`, `android`, `embed`, `dashboard`) runs against production — this is what you typically want: -- `\*:dev` runs against local services -- `\*:stage` runs against the staging testnet -- `\*:prod` runs against production infrastructure +```bash +npm run web +``` -For example: +The `*:local` variants are a special option that runs the app against a locally-running protocol stack (see [Running the protocol locally](./dev-tools/README.md)). Use these only when you have the full stack running on your machine. ```bash -npm run web:prod +npm run web:local ``` -For all available commands please see the [package.json scripts](https://github.com/AudiusProject/apps/blob/f850434ddca7d697f78a58d971f9bba1aba7f24d/package.json#L10) and the relevant package READMEs. +For all available commands please see the [package.json scripts](https://github.com/AudiusProject/apps/blob/main/package.json) and the relevant package READMEs. ## Contributing diff --git a/package.json b/package.json index 7f255154d21..6589e143066 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,8 @@ "buf:generate": "buf generate buf.build/audiusd/audiusd:as/rm-old-protos --include-imports && npm run buf:generate:postinstall", "buf:generate:postinstall": "cd packages/discovery-provider/src/tasks/core && ./fix-proto-imports.sh", "WEB========================================": "", - "web:dev": "npm run start:dev -w @audius/web", - "web:prod": "npm run start:prod -w @audius/web", - "web:stage": "npm run start:stage -w @audius/web", + "web": "npm run start:prod -w @audius/web", + "web:local": "npm run start:dev -w @audius/web", "web:e2e": "npm run test:e2e -w @audius/web", "web:test": "turbo run test --filter=@audius/web", "web:example:trending": "cd packages/web/examples/trending && npm run dev", @@ -38,16 +37,13 @@ "web:example:upload": "cd packages/web/examples/upload && npm run dev", "web:example:gated-upload": "cd packages/web/examples/gated-upload && npm run dev", "DESKTOP====================================": "", - "desktop:dev": "concurrently -k 'BROWSER=none npm run start:dev -w @audius/web' 'wait-on http://0.0.0.0:3000 && npm run electron:localhost -w @audius/web -- 3000'", - "desktop:prod": "concurrently -k 'BROWSER=none npm run start:prod -w @audius/web' 'wait-on http://0.0.0.0:3002 && npm run electron:localhost -w @audius/web -- 3002'", - "desktop:stage": "concurrently -k 'BROWSER=none npm run start:stage -w @audius/web' 'wait-on http://0.0.0.0:3001 && npm run electron:localhost -w @audius/web -- 3001'", + "desktop": "concurrently -k 'BROWSER=none npm run start:prod -w @audius/web' 'wait-on http://0.0.0.0:3002 && npm run electron:localhost -w @audius/web -- 3002'", + "desktop:local": "concurrently -k 'BROWSER=none npm run start:dev -w @audius/web' 'wait-on http://0.0.0.0:3000 && npm run electron:localhost -w @audius/web -- 3000'", "MOBILE=====================================": "", - "android:dev": "npm run android:dev -w @audius/mobile", - "android:prod": "npm run android:prod -w @audius/mobile", - "android:stage": "npm run android:stage -w @audius/mobile", - "ios:dev": "npm run ios:dev -w @audius/mobile", - "ios:prod": "npm run ios:prod -w @audius/mobile", - "ios:stage": "npm run ios:stage -w @audius/mobile", + "android": "npm run android:prod -w @audius/mobile", + "android:local": "npm run android:dev -w @audius/mobile", + "ios": "npm run ios:prod -w @audius/mobile", + "ios:local": "npm run ios:dev -w @audius/mobile", "mobile": "npm run start -w @audius/mobile", "mobile:clean": "npm run clean:auto -w @audius/mobile && npm run clean:modules", "mobile:clear-cache": "watchman watch-del-all && npm run start -w @audius/mobile -- --reset-cache", @@ -57,9 +53,8 @@ "mobile:example:like-repost": "cd packages/mobile/examples/like-repost && npx expo start", "mobile:example:upload": "cd packages/mobile/examples/upload && npx expo start", "EMBED======================================": "", - "embed:prod": "npm run start:prod -w embed", - "embed:stage": "npm run start:stage -w embed", - "embed:dev": "npm run start:dev -w embed", + "embed": "npm run start:prod -w embed", + "embed:local": "npm run start:dev -w embed", "HARMONY====================================": "", "harmony": "turbo run start --filter=@audius/harmony", "harmony:dev": "npm run start -w @audius/harmony", @@ -69,9 +64,8 @@ "PROTOCOL======================================": "", "protocol": "turbo run start --filter=@audius/compose --", "PROTOCOL DASHBOARD==============================": "", - "dashboard:dev": "npm run start:dev -w @audius/protocol-dashboard", - "dashboard:stage": "npm run start:stage -w @audius/protocol-dashboard", - "dashboard:prod": "npm run start:prod -w @audius/protocol-dashboard", + "dashboard": "npm run start:prod -w @audius/protocol-dashboard", + "dashboard:local": "npm run start:dev -w @audius/protocol-dashboard", "DOCS===========================================": "", "docs": "npm run dev -w docs-audius-org", "docs:deploy": "npm run pages:deploy -w docs-audius-org", diff --git a/packages/embed/.env.stage b/packages/embed/.env.stage deleted file mode 100644 index e7918d69c8e..00000000000 --- a/packages/embed/.env.stage +++ /dev/null @@ -1,10 +0,0 @@ -VITE_AMPLITUDE_API_PROXY=gain.audius.co -VITE_AMPLITUDE_KEY=72a58ce4ad1f9bafcba0b92bedb6c33d -VITE_API_KEY=2dc52ec9a4c31790cab6653de0c637f680faa993 -VITE_APP_NAME=audius-embed -VITE_AUDIUS_SCHEME=https -VITE_ENVIRONMENT=staging -VITE_HOSTNAME=staging.audius.co -VITE_HOSTNAME_REDIRECT=staging.audius.co -VITE_IDENTITY_ENDPOINT=https://identityservice.staging.audius.co -VITE_SOLANA_RPC_ENDPOINT=https://carolina-8qh733-fast-mainnet.helius-rpc.com diff --git a/packages/embed/README.md b/packages/embed/README.md index 2398cec3f88..bb817b0b66a 100644 --- a/packages/embed/README.md +++ b/packages/embed/README.md @@ -4,14 +4,19 @@ Like you've seen on [twitter](https://twitter.com/audius/status/1293624808459010 ## Running -``` -# Run against production Audius services -npm run start:prod -## Deploying +From the repo root, the typical default runs the embed against production services: -Deployed via CI +``` +npm run embed +``` + +To run against a locally-running protocol stack: ``` -npx wrangler publish --env staging +npm run embed:local ``` + +## Deploying + +Deployed via CI diff --git a/packages/mobile/.env.stage b/packages/mobile/.env.stage deleted file mode 100644 index a55251e778c..00000000000 --- a/packages/mobile/.env.stage +++ /dev/null @@ -1,2 +0,0 @@ -ENVIRONMENT=staging -TIKTOK_APP_ID=awa9re2w7ec3xrn6 diff --git a/packages/mobile/REACTOTRON_SETUP.md b/packages/mobile/REACTOTRON_SETUP.md index 3bc21077a50..a0e781a6791 100644 --- a/packages/mobile/REACTOTRON_SETUP.md +++ b/packages/mobile/REACTOTRON_SETUP.md @@ -27,7 +27,7 @@ The configuration is already set up in `ReactotronConfig.js` with the following ### For iOS Simulator 1. Start the Reactotron desktop app -2. Run the mobile app with `npm run ios:dev` +2. Run the mobile app with `npm run ios` (or `npm run ios:local` if running against a local protocol stack) 3. Reactotron should automatically connect ### For Android Emulator/Device @@ -37,7 +37,7 @@ The configuration is already set up in `ReactotronConfig.js` with the following adb reverse tcp:9090 tcp:9090 ``` 2. Start the Reactotron desktop app -3. Run the mobile app with `npm run android:dev` +3. Run the mobile app with `npm run android` (or `npm run android:local` if running against a local protocol stack) 4. Reactotron should connect ### For Physical iOS Device diff --git a/packages/mobile/README.md b/packages/mobile/README.md index b2e304fd49f..7216267aff7 100644 --- a/packages/mobile/README.md +++ b/packages/mobile/README.md @@ -27,12 +27,10 @@ npm run bundle:ios # Start the react-native server npm run mobile -# Run a simulator using a prod configuration +# Run a simulator against production (typical default) npm run ios -# Run a simulator using a stage configuration -npm run ios:stage -# Run a simulator using a dev configuration -npm run ios:dev +# Run a simulator against a locally-running protocol stack (special option) +npm run ios:local # Run the app on a device npm run ios:device "Raymond's iPhone" @@ -46,12 +44,10 @@ xcrun xctrace list devices # Start the react-native server npm run mobile -# Run a simulator using a prod configuration +# Run a simulator against production (typical default) npm run android -# Run a simulator using a stage configuration -npm run android:stage -# Run a simulator using a dev configuration -npm run android:dev +# Run a simulator against a locally-running protocol stack (special option) +npm run android:local # Look at android devices adb devices @@ -115,5 +111,5 @@ npm start -- --reset-cache # first manually close all running instances of metro watchman watch-del-all npm start -- --reset-cache -npm run ios:dev +npm run ios ``` diff --git a/packages/mobile/examples/README.md b/packages/mobile/examples/README.md index e67dc37ff26..c8a879ccc57 100644 --- a/packages/mobile/examples/README.md +++ b/packages/mobile/examples/README.md @@ -8,15 +8,17 @@ From the **repository root** (`apps/`): ```bash npm install -npm run ios:dev # iOS simulator +npm run ios # iOS simulator (against production) # or -npm run android:dev # Android emulator +npm run android # Android emulator (against production) ``` +Use `npm run ios:local` / `npm run android:local` instead if you want to run against a locally-running protocol stack. + Note: each example includes its own `.npmrc` with `legacy-peer-deps=true`, so `npm install` works without manually passing that flag. -Environment: copy `packages/mobile/.env.dev` if needed; the app runs against staging by default. +Environment: copy `packages/mobile/.env.dev` if needed; the app runs against production by default. ## Available examples diff --git a/packages/mobile/examples/auth-sign-in/README.md b/packages/mobile/examples/auth-sign-in/README.md index a741eaa606b..3a623f2c66c 100644 --- a/packages/mobile/examples/auth-sign-in/README.md +++ b/packages/mobile/examples/auth-sign-in/README.md @@ -49,11 +49,11 @@ Authentication, sign-in, login, sign-on, OAuth, authenticated gets, Hedgehog, id ## How to run (main app) -1. From repo root: `npm install` then `npm run ios:dev` or `npm run android:dev`. +1. From repo root: `npm install` then `npm run ios` or `npm run android` (use `:local` variants to run against a local protocol stack). 2. Open the app; the first screen is the **sign-on** flow (sign in or create account). 3. To test sign-out: sign in, then use **Settings** (or profile) → Sign out. -No extra setup; the app uses staging identity by default (see `packages/mobile/.env.dev`). +No extra setup; the app uses production identity by default. ## Source of truth (implementation) diff --git a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/FeatureFlagsNavItem.tsx b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/FeatureFlagsNavItem.tsx index badc65ac912..74dcadd9194 100644 --- a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/FeatureFlagsNavItem.tsx +++ b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/FeatureFlagsNavItem.tsx @@ -16,7 +16,7 @@ export const FeatureFlagsNavItem = () => { FeatureFlags.FEATURE_FLAG_ACCESS ) - // Debug builds (e.g. `npm run ios:prod` on simulator) use production env/Optimizely + // Debug builds (e.g. `npm run ios` on simulator) use production env/Optimizely // defaults where `feature_flag_access` is off — still expose overrides for local dev. const showFeatureFlags = isFeatureFlagAccessEnabled || __DEV__ diff --git a/packages/protocol-dashboard/.env.stage b/packages/protocol-dashboard/.env.stage deleted file mode 100644 index 042bb755fed..00000000000 --- a/packages/protocol-dashboard/.env.stage +++ /dev/null @@ -1,29 +0,0 @@ -VITE_API=https://api.staging.audius.co -VITE_AUDIUS_NETWORK_ID=1056801 -VITE_AUDIUS_URL=https://staging.audius.co -VITE_CLAIMABLE_TOKEN_PDA=Aw5AjygeMf9Nvg61BXvFSAzkqxcLqL8koepb14kvfc3W -VITE_CLAIMABLE_TOKEN_PROGRAM_ADDRESS=2sjQNmUfkV6yKKi4dPR8gWRgtyma5aiymE3aXL2RAZww -VITE_CLAIM_DISTRIBUTION_CONTRACT_ADDRESS=0x74b89B916c97d50557E8F944F32662fE52Ce378d -VITE_ENTITY_MANAGER_ADDRESS=0x1Cd8a543596D499B9b6E7a6eC15ECd2B7857Fd64 -VITE_ENVIRONMENT=staging -VITE_ETH_NETWORK_ID=11155111 -VITE_ETH_OWNER_WALLET= -VITE_ETH_PROVIDER_URL=https://eth-client.staging.audius.co -VITE_ETH_REGISTRY_ADDRESS=0xc682C2166E11690B64338e11633Cb8Bb60B0D9c0 -VITE_ETH_TOKEN_ADDRESS=0x1376180Ee935AA64A27780F4BE97726Df7B0e2B2 -VITE_GQL_URI=https://gateway-arbitrum.network.thegraph.com/api/7d7b938a80fe712cd8390bf42c88456a/subgraphs/id/Du8Zhnj3ap95TTusD6EnFNohfeVBtQftbqFgcruLCMA -VITE_IDENTITY_SERVICE_ENDPOINT=https://identityservice.staging.audius.co -VITE_QUERY_PROPOSAL_START_BLOCK=1 -VITE_REGISTRY_ADDRESS=0x793373aBF96583d5eb71a15d86fFE732CD04D452 -VITE_REWARDS_MANAGER_PROGRAM_ID=CDpzvz7DfgbF95jSSCHLX3ERkugyfgn9Fw8ypNZ1hfXp -VITE_REWARDS_MANAGER_PROGRAM_PDA=GaiG9LDYHfZGqeNaoGRzFEnLiwUT7WiC6sA6FDJX9ZPq -VITE_REWARDS_MANAGER_TOKEN_PDA=HJQj8P47BdA7ugjQEn45LaESYrxhiZDygmukt8iumFZJ -VITE_SOLANA_CLUSTER_ENDPOINT=https://solana-mainnet.g.alchemy.com/v2/N_o4w4Lgk2afO8uho9uuZu0LNi6gldVz -VITE_SOLANA_FEE_PAYER_ADDRESS=E3CfijtAJwBSHfwFEViAUd3xp7c8TBxwC1eXn1Fgxp8h -VITE_SOLANA_TOKEN_PROGRAM_ADDRESS=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA -VITE_SOLANA_WEB3_CLUSTER=mainnet-beta -VITE_USDC_MINT_ADDRESS=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v -VITE_VALIDATOR=https://creatornode11.staging.audius.co -VITE_WAUDIO_MINT_ADDRESS=BELGiMZQ34SDE6x2FUaML2UHDAgBLS64xvhXjX5tBBZo -VITE_WEB3MODAL_PROJECT_ID=0416e7e9c027fb75dc5a365384683fdb -VITE_WORMHOLE_ADDRESS=0xf6f45e4d836da1d4ecd43bb1074620bfb0b7e0d7 diff --git a/packages/protocol-dashboard/README.md b/packages/protocol-dashboard/README.md index 0642e8d330d..627cd2c34c4 100644 --- a/packages/protocol-dashboard/README.md +++ b/packages/protocol-dashboard/README.md @@ -6,12 +6,22 @@ view their registered services & which ones are out date, and explore all audius ## Running the Application The application requires ethereum contracts. -You can run `npm run start:stage` which will use the contracts that are on the staging environment. -If you want to have contracts running locally, you'll also need to run this [setup script](https://github.com/AudiusProject/apps/blob/master/service-commands/scripts/setup.js) e.g. `node setup.js run eth-contracts up` + +From the repo root, the typical default runs the dashboard against production contracts: + +``` +npm run dashboard +``` + +To run against locally-running contracts, you'll also need to run this [setup script](https://github.com/AudiusProject/apps/blob/master/service-commands/scripts/setup.js) e.g. `node setup.js run eth-contracts up`, then: + +``` +npm run dashboard:local +``` To start: 1. Install Dependencies `npm install` -2. Run the Application `npm run start:` +2. Run the Application `npm run dashboard` (or `npm run dashboard:local` for local) To Deploy: Make sure the DASHBOARD_BASE_URL env var is unset on the machine you are deploying on. Build the application using `npm run build:prod` and serve the static `dist` folder as a simple page app via `npm run serve` diff --git a/packages/web/env/.env.stage b/packages/web/env/.env.stage deleted file mode 100644 index 0ecb481060c..00000000000 --- a/packages/web/env/.env.stage +++ /dev/null @@ -1,2 +0,0 @@ -VITE_ENVIRONMENT=staging -VITE_PORT=3001