Skip to content

Commit

Permalink
Merge pull request #2681 from decentdao/remove-netlify
Browse files Browse the repository at this point in the history
Remove netlify
  • Loading branch information
adamgall authored Jan 21, 2025
2 parents a8aedfd + dad6866 commit df39efa
Show file tree
Hide file tree
Showing 18 changed files with 349 additions and 16,735 deletions.
82 changes: 40 additions & 42 deletions .env
Original file line number Diff line number Diff line change
@@ -1,63 +1,61 @@
# Minutes to cache token balances for address
BALANCES_CACHE_INTERVAL_MINUTES=""

# Minutes to give Moralis to index new addresses
BALANCES_MORALIS_INDEX_DELAY_MINUTES=""

# Moralis API key
MORALIS_API_KEY=""

# Configuration for Netlify Sentry plugin, not needed in development
SENTRY_ORG=""
SENTRY_PROJECT=""
SENTRY_AUTH_TOKEN=""
#####
## Environment Variables

##########
## Required variables with default values
##
## These don't need to be overridden in a .env.local or proper environment variables.
##
# App name displayed as Title
VITE_APP_NAME="Decent"

# Hotjar Site ID. This should be parseable to an integer.
# VITE_APP_HOTJAR_SITE_ID=""

# Hotjar Version. Should be retrieved from the Hotjar dashboard. This should be parseable to an integer.
# VITE_APP_HOTJAR_VERSION=""

# API key for Amplitude analytics
VITE_APP_AMPLITUDE_API_KEY=""

##########
## Required variables without default values
##
## These do need to be overridden in a .env.local or proper environment variables.
##
# Alchemy provider API key
VITE_APP_ALCHEMY_API_KEY=""

# ABI selector, used on Base
VITE_APP_ETHERSCAN_BASE_API_KEY=""
# ABI selector, used on Mainnet
VITE_APP_ETHERSCAN_MAINNET_API_KEY=""
# ABI selector, used on Optimism
VITE_APP_ETHERSCAN_OPTIMISM_API_KEY=""
# ABI selector, used on Polygon
VITE_APP_ETHERSCAN_POLYGON_API_KEY=""
# ABI selector, used on Sepolia
VITE_APP_ETHERSCAN_SEPOLIA_API_KEY=""
# ABI selector, used on Base
VITE_APP_ETHERSCAN_BASE_API_KEY=""
# ABI selector, used on Optimism
VITE_APP_ETHERSCAN_OPTIMISM_API_KEY=""

# IPFS pinning
VITE_APP_INFURA_IPFS_API_KEY=""
# IPFS pinning
VITE_APP_INFURA_IPFS_API_SECRET=""

# Sentry DSN URL, not used locally
VITE_APP_SENTRY_DSN_URL=""

# Shutter Public Key
VITE_APP_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca

# index.html and WalletConnect metadata
VITE_APP_SITE_URL="https://app.dev.decentdao.org"

VITE_APP_SITE_URL="http://localhost:3000"
# WalletConnect Cloud Project ID
VITE_APP_WALLET_CONNECT_PROJECT_ID=""

# Use legacy Netlify balances backend
VITE_APP_USE_LEGACY_BACKEND=""

# FEATURE FLAGS (Must equal "ON")
VITE_APP_FLAG_DEV=""
VITE_APP_FLAG_DEMO=""
##########
## Optional Feature Flag variables
##
## These are used to enable or disable features in the app.
## Features are OFF by default, and the only valid value to turn them on is "ON".
##
# VITE_APP_FLAG_DEV=""
# VITE_APP_FLAG_YELLING=""

##########
## Optional variables without default values
##
## These only need to be overridden in a .env.local or proper environment variables
## if you want the associated service to be enabled.
##
# API key for Amplitude analytics
# VITE_APP_AMPLITUDE_API_KEY=""
# Hotjar Site ID. This should be parseable to an integer.
# VITE_APP_HOTJAR_SITE_ID=""
# Hotjar Version. Should be retrieved from the Hotjar dashboard. This should be parseable to an integer.
# VITE_APP_HOTJAR_VERSION=""
# Sentry DSN URL, not used locally
# VITE_APP_SENTRY_DSN_URL=""
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ yarn-error.log*
# GraphQL generated files
/.graphclient

# Local Netlify folder
/.netlify

# Wrangler
/.wrangler
.dev.vars
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17.0
23.6.0
23 changes: 5 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ Running development environment
$ npm run dev
```

### Netlify functions

We're using `Netlify` functions for retrieving various off-chain data. You can run these using `npm run dev:netlify`.
Currently it's being used to fetch abstract `address`'s ERC-20, ERC-721 and DeFi balances through `Moralis`.
It is crucial to have `Netlify` functions running locally to work with anything related to DAO treasury, for instance

- Treasury page
- Payments feature

### Cloudflare Pages functions

We're using Cloudflare Pages functions for retrieving various off-chain data.
Expand Down Expand Up @@ -66,11 +57,7 @@ The application uses two sets of environment variables:
Start with adding a new Feature Flag to the app. In https://github.com/decentdao/decent-interface/src/helpers/featureFlags.ts, Add a flag.

```typescript
export const FEATURE_FLAGS = [
'flag_dev',
'flag_demo',
'flag_yelling', // <-- new flag
] as const;
export const FEATURE_FLAGS = ['flag_dev', 'flag_feature_a'] as const;
```

### Usage
Expand All @@ -80,7 +67,7 @@ In consumer of the flag, use the convenience function
```typescript
import { isFeatureEnabled } from '@/helpers/featureFlags';

if (isFeatureEnabled('flag_yelling')) {
if (isFeatureEnabled('flag_feature_a')) {
// code here
}
```
Expand All @@ -90,21 +77,21 @@ if (isFeatureEnabled('flag_yelling')) {
During development, add a flag environment variable in your (local) .env(.local) file. It must be a string value of "ON" or "OFF". The syntax of the environment variable is `VITE_APP_<FLAG_NAME>`.

```shell
VITE_APP_FLAG_YELLING="ON"
VITE_APP_FLAG_FEATURE_A="ON"
```

You can also set the flag in the URL with a query param. Notice how the `VITE_APP_` prefix is omitted and the flag name in the query param matches the name you gave it in code:

```shell
http://localhost:3000/?flag_yelling=on
http://localhost:3000/?flag_feature_a=on
```

### Testing

Override the flag value by adding query params to the URL. Notice how the `VITE_APP_` prefix is omitted and the flag name is in lowercase:

```
https://app.dev.decentdao.org?flag_yelling=on
https://app.decentdao.org?flag_feature_a=on
```

From then, the flag holds the value from the URL param until app is refreshed
Expand Down
4 changes: 0 additions & 4 deletions netlify.toml

This file was deleted.

38 changes: 0 additions & 38 deletions netlify/functions/defiBalances.mts

This file was deleted.

32 changes: 0 additions & 32 deletions netlify/functions/nftBalances.mts

This file was deleted.

40 changes: 0 additions & 40 deletions netlify/functions/tokenBalances.mts

This file was deleted.

Loading

0 comments on commit df39efa

Please sign in to comment.