Skip to content

Commit 0f493c1

Browse files
authored
Merge pull request #63 from BramSuurdje/main
Add frontend to Scripts repostitory
2 parents 103e2be + 2f9f51e commit 0f493c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+11687
-0
lines changed

.github/workflows/nextjs.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2+
#
3+
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4+
#
5+
name: Deploy Next.js site to Pages
6+
7+
on:
8+
push:
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
working-directory: frontend # Set default working directory for all run steps
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Detect package manager
31+
id: detect-package-manager
32+
run: |
33+
if [ -f "${{ github.workspace }}/frontend/yarn.lock" ]; then
34+
echo "manager=yarn" >> $GITHUB_OUTPUT
35+
echo "command=install" >> $GITHUB_OUTPUT
36+
echo "runner=yarn" >> $GITHUB_OUTPUT
37+
exit 0
38+
elif [ -f "${{ github.workspace }}/frontend/package.json" ]; then
39+
echo "manager=npm" >> $GITHUB_OUTPUT
40+
echo "command=ci" >> $GITHUB_OUTPUT
41+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
42+
exit 0
43+
else
44+
echo "Unable to determine package manager"
45+
exit 1
46+
fi
47+
- name: Setup Node
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: "20"
51+
cache: ${{ steps.detect-package-manager.outputs.manager }}
52+
cache-dependency-path: frontend/package-lock.json # Specify the path to package-lock.json
53+
- name: Setup Pages
54+
uses: actions/configure-pages@v5
55+
with:
56+
static_site_generator: next
57+
- name: Restore cache
58+
uses: actions/cache@v4
59+
with:
60+
path: |
61+
frontend/.next/cache
62+
key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend/**/package-lock.json', 'frontend/**/yarn.lock') }}-${{ hashFiles('frontend/**.[jt]s', 'frontend/**.[jt]sx') }}
63+
restore-keys: |
64+
${{ runner.os }}-nextjs-${{ hashFiles('frontend/**/package-lock.json', 'frontend/**/yarn.lock') }}-
65+
- name: Install dependencies
66+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} --legacy-peer-deps
67+
- name: Build with Next.js
68+
run: ${{ steps.detect-package-manager.outputs.runner }} next build
69+
- name: Upload artifact
70+
uses: actions/upload-pages-artifact@v3
71+
with:
72+
path: frontend/out
73+
74+
deploy:
75+
environment:
76+
name: github-pages
77+
url: ${{ steps.deployment.outputs.page_url }}
78+
runs-on: ubuntu-latest
79+
needs: build
80+
steps:
81+
- name: Deploy to GitHub Pages
82+
id: deployment
83+
uses: actions/deploy-pages@v4

frontend/.env.local

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NEXT_PUBLIC_ANALYTICS_TOKEN="b60d3032-1a11-4244-a100-81d26c5c49a7"
2+
NEXT_PUBLIC_ANALYTICS_URL="analytics.proxmoxve-scripts.com"
3+
NEXT_PUBLIC_POCKETBASE_URL="https://pocketbase.proxmoxve-scripts.com"

frontend/.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": ["next/core-web-vitals"],
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"]
5+
}

frontend/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# wrangler
10+
.worker-next
11+
.wrangler
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
out
19+
# production
20+
/build
21+
22+
# misc
23+
.DS_Store
24+
*.pem
25+
26+
# debug
27+
npm-debug.log*
28+
yarn-debug.log*
29+
yarn-error.log*
30+
31+
# # local env files
32+
# .env*.local
33+
# .env
34+
# vercel
35+
.vercel
36+
37+
# typescript
38+
*.tsbuildinfo
39+
next-env.d.ts

frontend/.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
node_modules
3+
.next
4+
build
5+
.contentlayer

frontend/.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-imports"]
3+
}

frontend/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Bram Suurd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

frontend/components.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "@/styles/globals.css",
9+
"baseColor": "slate",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

frontend/example.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NEXT_PUBLIC_POCKETBASE_URL=https://pocketbase.proxmoxve-scripts.com
2+
NEXT_PUBLIC_ANALYTICS_URL=https://analytics.proxmoxve-scripts.com
3+
NEXT_PUBLIC_ANALYTICS_TOKEN=b60d130323-1a11-4244-a1010-81d263c5c49a7
4+
NODE_ENV=production

frontend/next.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
webpack: (config) => {
4+
config.resolve.alias.canvas = false;
5+
6+
return config;
7+
},
8+
images: {
9+
remotePatterns: [
10+
{
11+
protocol: "https",
12+
hostname: "**",
13+
},
14+
],
15+
},
16+
17+
env: {
18+
NEXT_PUBLIC_BUILD_TIME: `${Date.now()}`,
19+
},
20+
21+
output: "export",
22+
basePath: "/ProxmoxVE",
23+
};
24+
25+
export default nextConfig;

0 commit comments

Comments
 (0)