Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/stats-web/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Dockerfile
node_modules
npm-debug.log
README.md
.next
dist
.git
18 changes: 9 additions & 9 deletions apps/stats-web/.env.local.sample
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
DEPLOYMENT_ENV=staging

NEXT_PUBLIC_API_BASE_URL=http://localhost:3080
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
NEXT_PUBLIC_BASE_API_MAINNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_TESTNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_SANDBOX_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_DEFAULT_NETWORK_ID=mainnet
VITE_API_BASE_URL=http://localhost:3080
VITE_BASE_API_MAINNET_URL=$VITE_API_BASE_URL
VITE_BASE_API_SANDBOX_URL=$VITE_API_BASE_URL
Comment on lines +4 to +5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Address dotenv-linter key ordering to keep the file lint-clean.

The linter flags VITE_BASE_API_SANDBOX_URL being placed after VITE_BASE_API_TESTNET_URL. Consider reordering to satisfy the .env ordering rules.

🔧 Suggested reorder
 VITE_BASE_API_MAINNET_URL=$VITE_API_BASE_URL
-VITE_BASE_API_TESTNET_URL=$VITE_API_BASE_URL
 VITE_BASE_API_SANDBOX_URL=$VITE_API_BASE_URL
+VITE_BASE_API_TESTNET_URL=$VITE_API_BASE_URL
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
VITE_BASE_API_MAINNET_URL=$VITE_API_BASE_URL
VITE_BASE_API_TESTNET_URL=$VITE_API_BASE_URL
VITE_BASE_API_SANDBOX_URL=$VITE_API_BASE_URL
VITE_BASE_API_MAINNET_URL=$VITE_API_BASE_URL
VITE_BASE_API_SANDBOX_URL=$VITE_API_BASE_URL
VITE_BASE_API_TESTNET_URL=$VITE_API_BASE_URL
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 7-7: [UnorderedKey] The VITE_BASE_API_SANDBOX_URL key should go before the VITE_BASE_API_TESTNET_URL key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/stats-web/.env.local.sample` around lines 5 - 7, Reorder the dotenv keys
to satisfy the linter by placing VITE_BASE_API_SANDBOX_URL in its correct
alphabetical position relative to VITE_BASE_API_MAINNET_URL and
VITE_BASE_API_TESTNET_URL; update the sequence so the three lines read in proper
order (e.g., VITE_BASE_API_MAINNET_URL, VITE_BASE_API_SANDBOX_URL,
VITE_BASE_API_TESTNET_URL) to resolve the dotenv-linter key ordering warning.

VITE_BASE_API_TESTNET_URL=$VITE_API_BASE_URL
VITE_DEFAULT_NETWORK_ID=mainnet
VITE_NODE_ENV=$NODE_ENV

API_HOST_WITH_DEFAULT=${API_HOST:-localhost}

BASE_API_MAINNET_URL=http://${API_HOST_WITH_DEFAULT}:3080
BASE_API_TESTNET_URL=${BASE_API_MAINNET_URL}
BASE_API_SANDBOX_URL=${BASE_API_MAINNET_URL}
BASE_API_TESTNET_URL=${BASE_API_MAINNET_URL}
LOG_LEVEL=debug

NEXT_PUBLIC_LOG_LEVEL=debug
NEXT_PUBLIC_SENTRY_ENABLED=false
VITE_LOG_LEVEL=debug
VITE_SENTRY_ENABLED=false
16 changes: 16 additions & 0 deletions apps/stats-web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
extends: [require.resolve("@akashnetwork/dev-config/.eslintrc.ts")],
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"react/no-unescaped-entities": "warn",
"react-hooks/exhaustive-deps": "warn",
"react/display-name": "off"
}
}
],
settings: {
"import-x/ignore": ["react"]
}
};
1 change: 0 additions & 1 deletion apps/stats-web/.eslintrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions apps/stats-web/.eslintrc.json

This file was deleted.

10 changes: 1 addition & 9 deletions apps/stats-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
# testing
/coverage

# next.js
/.next/
/out/

# production
/dist
/build
env-config.schema.js

# misc
.DS_Store
Expand All @@ -29,9 +25,5 @@ yarn-error.log*
# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
File renamed without changes.
5 changes: 2 additions & 3 deletions apps/stats-web/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ services:
image: ghcr.io/akash-network/stats-web:<version>
# env:
# - API_BASE_URL=<API_URL_OVERRIDE>
# - NEXT_PUBLIC_GA_MEASUREMENT_ID=<GA_MEASUREMENT_ID>
# - NEXT_PUBLIC_SENTRY_DSN=<SENTRY_DSN>
# - NEXT_PUBLIC_SENTRY_SERVER_NAME=<SERVER_NAME>
# - VITE_GA_MEASUREMENT_ID=<GA_MEASUREMENT_ID>
# - VITE_SENTRY_DSN=<SENTRY_DSN>
expose:
- port: 3000
as: 80
Expand Down
10 changes: 5 additions & 5 deletions apps/stats-web/env/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NEXT_PUBLIC_UNLEASH_APP_NAME=stats-web
NEXT_PUBLIC_UNLEASH_ENABLE_ALL=false
VITE_UNLEASH_ENABLE_ALL=false

VITE_SENTRY_DSN="https://c2af143d11c20d4bf20e7b668d493aaf@o877251.ingest.us.sentry.io/4510740211105792"
VITE_SENTRY_ENABLED=false

NEXT_PUBLIC_SENTRY_APPLICATION_KEY="AKASH-STATS-WEB"
NEXT_PUBLIC_SENTRY_DSN="https://c2af143d11c20d4bf20e7b668d493aaf@o877251.ingest.us.sentry.io/4510740211105792"
SENTRY_ORG=cloudmos
SENTRY_PROJECT=$NEXT_PUBLIC_UNLEASH_APP_NAME
SENTRY_PROJECT=stats-web
21 changes: 7 additions & 14 deletions apps/stats-web/env/.env.production
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
NEXT_PUBLIC_BASE_API_MAINNET_URL=https://console-api.akash.network
NEXT_PUBLIC_BASE_API_SANDBOX_URL=https://console-api-sandbox.akash.network
NEXT_PUBLIC_BASE_API_TESTNET_URL=https://console-api-testnet.akash.network
NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
VITE_API_BASE_URL=$VITE_BASE_API_MAINNET_URL
VITE_BASE_API_MAINNET_URL=https://console-api.akash.network
VITE_BASE_API_SANDBOX_URL=https://console-api-sandbox.akash.network
VITE_BASE_API_TESTNET_URL=https://console-api-testnet.akash.network
VITE_NODE_ENV=$NODE_ENV

NEXT_PUBLIC_GA_MEASUREMENT_ID=G-MLJ2W9K3MJ
VITE_GA_MEASUREMENT_ID=G-MLJ2W9K3MJ

BASE_API_MAINNET_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
BASE_API_TESTNET_URL=$NEXT_PUBLIC_BASE_API_TESTNET_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL

NEXT_PUBLIC_UNLEASH_FRONTEND_API_URL=https://features-edge.akash.network/api/frontend
NEXT_PUBLIC_UNLEASH_FRONTEND_API_TOKEN=*:production.3de2776029292b1860a520b1aa3ee9e417ae300283811fd77d231060

NEXT_PUBLIC_SENTRY_ENABLED="true"
VITE_SENTRY_ENABLED=true
16 changes: 9 additions & 7 deletions apps/stats-web/env/.env.sample
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
NEXT_PUBLIC_API_BASE_URL=
NEXT_PUBLIC_UNLEASH_ENABLE_ALL=true
NEXT_PUBLIC_UNLEASH_FRONTEND_API_URL=
NEXT_PUBLIC_UNLEASH_FRONTEND_API_TOKEN=
VITE_API_BASE_URL=
VITE_BASE_API_MAINNET_URL=
VITE_BASE_API_SANDBOX_URL=
Comment on lines +1 to +3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Keep key order consistent with dotenv-linter.

The linter expects VITE_BASE_API_SANDBOX_URL before VITE_BASE_API_TESTNET_URL.

♻️ Suggested change
 VITE_API_BASE_URL=
 VITE_BASE_API_MAINNET_URL=
-VITE_BASE_API_TESTNET_URL=
 VITE_BASE_API_SANDBOX_URL=
+VITE_BASE_API_TESTNET_URL=
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
VITE_API_BASE_URL=
VITE_BASE_API_MAINNET_URL=
VITE_BASE_API_TESTNET_URL=
VITE_BASE_API_SANDBOX_URL=
VITE_API_BASE_URL=
VITE_BASE_API_MAINNET_URL=
VITE_BASE_API_SANDBOX_URL=
VITE_BASE_API_TESTNET_URL=
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 4-4: [UnorderedKey] The VITE_BASE_API_SANDBOX_URL key should go before the VITE_BASE_API_TESTNET_URL key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/stats-web/env/.env.sample` around lines 1 - 4, The dotenv-linter expects
a specific key order; reorder the variables in apps/stats-web/env/.env.sample so
that VITE_BASE_API_SANDBOX_URL appears before VITE_BASE_API_TESTNET_URL (keep
the rest intact: VITE_API_BASE_URL, VITE_BASE_API_MAINNET_URL,
VITE_BASE_API_SANDBOX_URL, VITE_BASE_API_TESTNET_URL) and re-run the linter to
verify the file now passes; modify the file where these symbols are defined to
reflect the new ordering.

VITE_BASE_API_TESTNET_URL=
VITE_UNLEASH_ENABLE_ALL=true

NEXT_PUBLIC_SENTRY_APPLICATION_KEY=
NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_SENTRY_SERVER_NAME=
VITE_GA_MEASUREMENT_ID=

VITE_SENTRY_DSN=
VITE_SENTRY_ENABLED=false
19 changes: 6 additions & 13 deletions apps/stats-web/env/.env.staging
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
NEXT_PUBLIC_BASE_API_MAINNET_URL=https://console-api-mainnet-staging.akash.network
NEXT_PUBLIC_BASE_API_SANDBOX_URL=https://console-api-sandbox-staging.akash.network
NEXT_PUBLIC_BASE_API_TESTNET_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
VITE_API_BASE_URL=$VITE_BASE_API_MAINNET_URL
VITE_BASE_API_MAINNET_URL=https://console-api-mainnet-staging.akash.network
VITE_BASE_API_SANDBOX_URL=https://console-api-sandbox-staging.akash.network
VITE_BASE_API_TESTNET_URL=$VITE_BASE_API_MAINNET_URL
VITE_NODE_ENV=$NODE_ENV

BASE_API_MAINNET_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
BASE_API_TESTNET_URL=$NEXT_PUBLIC_BASE_API_TESTNET_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL

NEXT_PUBLIC_UNLEASH_FRONTEND_API_URL=https://features-edge-beta.akash.network/api/frontend
NEXT_PUBLIC_UNLEASH_FRONTEND_API_TOKEN=*:development.34efccc4c8ba7d6ddeeb4083d72bc8ac05770774ac4d6668e749ca5a

NEXT_PUBLIC_SENTRY_ENABLED="true"
VITE_SENTRY_ENABLED=true
30 changes: 30 additions & 0 deletions apps/stats-web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#e41e13" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<meta name="theme-color" content="#e41e13" />
<meta name="description" content="Akash Network Analytics. The #1 decentralized supercloud." />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="https://stats.akash.network/" />
<meta property="og:site_name" content="Akash Stats" />
<meta property="og:description" content="Akash Network Analytics. The #1 decentralized supercloud." />
<meta property="og:image" content="https://stats.akash.network/akash-stats.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Akash Stats Cover Image" />
<meta name="twitter:site" content="@akashnet" />
<meta name="twitter:card" content="summary_large_image" />
<title>Akash Network Stats</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
81 changes: 0 additions & 81 deletions apps/stats-web/next.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions apps/stats-web/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
listen 3000;
server_name _;
server_tokens off;

root /usr/share/nginx/html;
index index.html;

# gzip compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;

# Cache static assets
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}

# SPA fallback - serve index.html for all non-file routes
location / {
try_files $uri $uri/ /index.html;
}
}
Loading
Loading