-
Notifications
You must be signed in to change notification settings - Fork 112
feat(ambient-ui): walking skeleton with BFF auth, fleet view, and deployment #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2c7b393
fix(ambient-ui): switch to webpack dev server and fix proxy migration
jsell-rh 3887a03
feat(ambient-ui): walking skeleton with BFF auth, fleet view, and dep…
jsell-rh 9e78df0
feat(ambient-ui): add production overlay, CI tests, and release pipeline
jsell-rh 0951a8d
fix(ambient-ui): replace hardcoded dev session secret with random bytes
jsell-rh 3f55b68
fix(ambient-ui): configure istanbul coverage provider for vitest
jsell-rh 4049ad2
fix(ci): build ambient-sdk before ambient-ui tests
jsell-rh 67372dd
fix(ci): add permissions block to unit-tests workflow
jsell-rh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.* | ||
| __pycache__ | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # env files | ||
| .env*.local | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Use Red Hat UBI Node.js 20 minimal image for dependencies | ||
| FROM registry.access.redhat.com/ubi9/nodejs-20-minimal AS deps | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| USER 0 | ||
|
|
||
| # Copy SDK dependency first (it's a file: dependency in package.json) | ||
| COPY ambient-sdk/ts-sdk ./ambient-sdk/ts-sdk | ||
|
|
||
| # Copy ambient-ui package files | ||
| COPY ambient-ui/package.json ambient-ui/package-lock.json* ./ | ||
| RUN npm ci | ||
|
|
||
| # Rebuild the source code only when needed | ||
| # Use the full nodejs-20 image (not minimal) for the build stage because | ||
| # Next.js 16 Turbopack requires native SWC binaries that depend on glibc. | ||
| FROM registry.access.redhat.com/ubi9/nodejs-20 AS builder | ||
|
|
||
| USER 0 | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy node_modules from deps stage | ||
| COPY --from=deps /app/node_modules ./node_modules | ||
| COPY --from=deps /app/ambient-sdk ./ambient-sdk | ||
| COPY ambient-ui/ . | ||
|
|
||
| # Next.js collects completely anonymous telemetry data about general usage. | ||
| # Learn more here: https://nextjs.org/telemetry | ||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
|
||
| RUN npm run build | ||
|
|
||
| # Prepare standalone output with OpenShift-compatible permissions in the builder | ||
| # (the hardened runner image is distroless — no shell or chmod available) | ||
| RUN mkdir -p /app-output/public /app-output/.next/static && \ | ||
| cp -r .next/standalone/. /app-output/ && \ | ||
| cp -r .next/static/. /app-output/.next/static/ && \ | ||
| cp -r public/. /app-output/public/ && \ | ||
| chmod -R g=u /app-output && \ | ||
| chgrp -R 0 /app-output | ||
|
|
||
| # Production image — Red Hat Hardened Image (distroless, ~48MB, 0 CVEs) | ||
| FROM registry.access.redhat.com/hi/nodejs:latest AS runner | ||
|
|
||
| ARG GIT_COMMIT=unknown | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| ENV NODE_ENV=production | ||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
|
||
| COPY --from=builder /app-output/. ./ | ||
|
|
||
| USER 1001 | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| ENV PORT=3000 | ||
| ENV HOSTNAME="0.0.0.0" | ||
|
|
||
| # server.js is created by next build from the standalone output | ||
| # https://nextjs.org/docs/pages/api-reference/next-config-js/output | ||
| LABEL org.opencontainers.image.revision=$GIT_COMMIT | ||
|
|
||
| CMD ["node", "server.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": true, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/app/globals.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "lucide", | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "registries": {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { dirname } from "path"; | ||
| import { fileURLToPath } from "url"; | ||
| import { FlatCompat } from "@eslint/eslintrc"; | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = dirname(__filename); | ||
|
|
||
| const compat = new FlatCompat({ | ||
| baseDirectory: __dirname, | ||
| }); | ||
|
|
||
| const eslintConfig = [ | ||
| ...compat.extends("next/core-web-vitals", "next/typescript"), | ||
| { | ||
| ignores: [ | ||
| "node_modules/**", | ||
| ".next/**", | ||
| "out/**", | ||
| "build/**", | ||
| "next-env.d.ts", | ||
| ], | ||
| }, | ||
| { | ||
| rules: { | ||
| "@typescript-eslint/no-explicit-any": "error", | ||
| "@typescript-eslint/no-unused-vars": "error", | ||
| "react-hooks/exhaustive-deps": "warn", | ||
| }, | ||
| }, | ||
| ]; | ||
|
|
||
| export default eslintConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // eslint-disable-next-line @typescript-eslint/no-require-imports | ||
| const path = require('path') | ||
|
|
||
| /** @type {import('next').NextConfig} */ | ||
| const nextConfig = { | ||
| output: 'standalone', | ||
| outputFileTracingRoot: path.resolve(__dirname, '../..'), | ||
| transpilePackages: ['ambient-sdk'], | ||
| experimental: { | ||
| staticGenerationMinPagesPerWorker: 100, | ||
| }, | ||
| } | ||
|
|
||
| module.exports = nextConfig |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.