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
109 changes: 109 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: UI
permissions:
contents: read

on:
push:
branches: [ master ]
paths: ['ui/**']
pull_request:
paths: ['ui/**']

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.filter.outputs.projects }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: paths
with:
filters: |
tips:
- 'ui/tips/**'
- id: filter
run: |
projects='[]'
if [ "${{ steps.paths.outputs.tips }}" == "true" ]; then
projects=$(echo "$projects" | jq -c '. + ["tips"]')
fi
echo "projects=$projects" >> $GITHUB_OUTPUT

lint:
name: Lint (${{ matrix.project }})
needs: changes
if: ${{ needs.changes.outputs.projects != '[]' }}
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{ fromJson(needs.changes.outputs.projects) }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: ui/${{ matrix.project }}/yarn.lock
- run: cp .env.example ui/${{ matrix.project }}/.env
- run: cd ui/${{ matrix.project }} && yarn install
- run: cd ui/${{ matrix.project }} && yarn lint

type-check:
name: Type Check (${{ matrix.project }})
needs: changes
if: ${{ needs.changes.outputs.projects != '[]' }}
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{ fromJson(needs.changes.outputs.projects) }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: ui/${{ matrix.project }}/yarn.lock
- run: cp .env.example ui/${{ matrix.project }}/.env
- run: cd ui/${{ matrix.project }} && yarn install
- run: cd ui/${{ matrix.project }} && npx tsc --noEmit

build:
name: Build (${{ matrix.project }})
needs: changes
if: ${{ needs.changes.outputs.projects != '[]' }}
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{ fromJson(needs.changes.outputs.projects) }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: ui/${{ matrix.project }}/yarn.lock
- run: cp .env.example ui/${{ matrix.project }}/.env
- run: cd ui/${{ matrix.project }} && yarn install
- run: cd ui/${{ matrix.project }} && yarn build
41 changes: 41 additions & 0 deletions ui/tips/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# 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 (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
40 changes: 40 additions & 0 deletions ui/tips/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM node:20-alpine AS deps
WORKDIR /app
COPY ui/package.json ui/yarn.lock ./
RUN --mount=type=cache,target=/root/.yarn \
yarn install --frozen-lockfile

FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY ./ui .

ENV NEXT_TELEMETRY_DISABLED=1

RUN --mount=type=cache,target=/app/.next/cache \
yarn build

FROM node:20-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN mkdir .next
RUN chown nextjs:nodejs .next

COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

CMD ["node", "server.js"]
43 changes: 43 additions & 0 deletions ui/tips/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!node_modules", "!.next", "!dist", "!build"]
},
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noUnknownAtRules": "off"
}
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
7 changes: 7 additions & 0 deletions ui/tips/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
output: "standalone",
};

export default nextConfig;
28 changes: 28 additions & 0 deletions ui/tips/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ui",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build --turbopack",
"start": "next start",
"lint": "biome check",
"format": "biome format --write"
},
"dependencies": {
"@aws-sdk/client-s3": "3.940.0",
"next": "16.0.7",
"react": "19.2.1",
"react-dom": "19.2.1",
"viem": "2.40.3"
},
"devDependencies": {
"@biomejs/biome": "2.3.8",
"@tailwindcss/postcss": "4.1.17",
"@types/node": "20.19.25",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"tailwindcss": "4.1.17",
"typescript": "5.9.3"
}
}
5 changes: 5 additions & 0 deletions ui/tips/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = {
plugins: ["@tailwindcss/postcss"],
};

export default config;
12 changes: 12 additions & 0 deletions ui/tips/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading