Skip to content

Commit 9169095

Browse files
feat: create admin homepage for benchmark data (#46)
1 parent 4512a6b commit 9169095

File tree

16 files changed

+710
-21
lines changed

16 files changed

+710
-21
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ PARQUET_MONTH_COVERAGE=2
44
PUBLIC_STAGING_BASE_URL='https://algorithm-catalogue.dev.apex.esa.int'
55
PUBLIC_PRODUCTION_BASE_URL='https://algorithm-catalogue.apex.esa.int'
66
PUBLIC_PREVIEW_BASE_URL='https://esa-apex.github.io'
7-
PUBLIC_PREVIEW_BASE_PATH='/apex-algorithms-catalogue-web'
7+
PUBLIC_PREVIEW_BASE_PATH='/apex-algorithms-catalogue-web'
8+
BASIC_AUTH_USERNAME='admin'
9+
BASIC_AUTH_PASSWORD='admin'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN npm run build
2121
FROM base AS runtime
2222
COPY --from=prod-deps /app/node_modules ./node_modules
2323
COPY --from=build /app/dist ./dist
24-
COPY .env ./
24+
2525
RUN mkdir -p ./tmp
2626
RUN chown -R node:node ./tmp
2727
USER node

astro.config.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
import { loadEnv } from "vite";
1+
import * as dotenv from "dotenv";
22
import { defineConfig, passthroughImageService } from "astro/config";
33
import tailwind from "@astrojs/tailwind";
44
import react from "@astrojs/react";
55
import node from "@astrojs/node";
66
import markdownIntegration from "@astropub/md";
77
import { RemarkNormalizeHeadings } from "./src/remark-plugins/normalize-headings";
88

9-
const {
10-
PUBLIC_PRODUCTION_BASE_URL,
11-
PUBLIC_STAGING_BASE_URL,
12-
PUBLIC_PREVIEW_BASE_URL,
13-
PUBLIC_PREVIEW_BASE_PATH,
14-
} = loadEnv(
15-
// @ts-expect-error
16-
process.env.NODE_ENV,
17-
process.cwd(),
18-
"",
19-
);
9+
dotenv.config();
2010

2111
const PREVIEW_PR_BASE_PATH = process.env.PR_NUMBER
2212
? `/pr-preview/pr-${process.env.PR_NUMBER}`
2313
: "";
2414

2515
const config = {
2616
preview: {
27-
SITE_URL: PUBLIC_PREVIEW_BASE_URL,
28-
BASE_PATH: `${PUBLIC_PREVIEW_BASE_PATH}${PREVIEW_PR_BASE_PATH}`,
17+
SITE_URL: process.env.PUBLIC_PREVIEW_BASE_URL,
18+
BASE_PATH: `${process.env.PUBLIC_PREVIEW_BASE_PATH}${PREVIEW_PR_BASE_PATH}`,
2919
},
3020
"preview-homepage": {
31-
SITE_URL: PUBLIC_PREVIEW_BASE_URL,
32-
BASE_PATH: PUBLIC_PREVIEW_BASE_PATH,
21+
SITE_URL: process.env.PUBLIC_PREVIEW_BASE_URL,
22+
BASE_PATH: process.env.PUBLIC_PREVIEW_BASE_PATH,
3323
},
3424
staging: {
35-
SITE_URL: PUBLIC_STAGING_BASE_URL,
25+
SITE_URL: process.env.PUBLIC_STAGING_BASE_URL,
3626
BASE_PATH: "",
3727
},
3828
production: {
39-
SITE_URL: PUBLIC_PRODUCTION_BASE_URL,
29+
SITE_URL: process.env.PUBLIC_PRODUCTION_BASE_URL,
4030
BASE_PATH: "",
4131
},
4232
};

env.sample

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ PUBLIC_STAGING_BASE_URL='https://algorithm-catalogue.dev.apex.esa.int'
55
PUBLIC_PRODUCTION_BASE_URL='https://algorithm-catalogue.apex.esa.int'
66
PUBLIC_PREVIEW_BASE_URL='https://algorithm-catalogue.preview.apex.esa.int'
77
PUBLIC_PREVIEW_BASE_PATH='/apex-algorithms-catalogue-web'
8-
ALGO_REF=main
8+
ALGO_REF=main
9+
BASIC_AUTH_USERNAME=
10+
BASIC_AUTH_PASSWORD=

package-lock.json

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
"@radix-ui/react-popover": "^1.1.2",
2727
"@radix-ui/react-select": "^2.1.2",
2828
"@radix-ui/react-slot": "^1.1.0",
29+
"@tanstack/react-table": "^8.21.3",
2930
"astro": "^4.14.2",
3031
"class-variance-authority": "^0.7.0",
3132
"clsx": "^2.1.1",
3233
"cmdk": "^1.0.0",
3334
"csv-parse": "^6.1.0",
3435
"date-fns": "^4.1.0",
36+
"dotenv": "^17.2.3",
3537
"duckdb-async": "^1.1.3",
3638
"lucide-react": "^0.453.0",
3739
"node-fetch": "^3.3.2",

playwright-global-setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import * as dotenv from "dotenv";
12
import type { FullConfig } from "@playwright/test";
23

4+
dotenv.config();
5+
36
const globalSetup = async (_config: FullConfig): Promise<void> => {
47
console.log(
58
"Manually initialize cache by triggering API call, making the test faster...",

playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import * as dotenv from "dotenv";
12
import { defineConfig, devices } from "@playwright/test";
23

4+
dotenv.config();
5+
36
export default defineConfig({
47
testDir: "./tests/e2e",
58
globalSetup: "./playwright-global-setup.ts",

src/components/AdminNavBar.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<nav class="text-white w-full border-b border-brand-teal-50 top-0 sticky">
2+
<div class="max-w-screen-xl mx-auto px-3 py-3">
3+
<h1 class="text-xl">APEX Algorithm Dashboard</h1>
4+
</div>
5+
</nav>

0 commit comments

Comments
 (0)