Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jr200 committed Sep 18, 2024
0 parents commit 3753510
Show file tree
Hide file tree
Showing 95 changed files with 8,260 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.dockerignore
.env
.env*
.git
.github
.history
.next
*.bak
*.swp
charts
Dockerfile
Makefile
node_modules
npm-debug.log
private
README*.md
16 changes: 16 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
APP_BASE_URL=http://localhost:3000
AUTH_URL=http://localhost:3000/api/auth
AUTH_TRUST_HOST=http://localhost:3000

NEXTAUTH_SECRET=replace-with-a-real-secret

# see providers variable in: src/auth/index.ts
AUTH_ZITADEL_ISSUER=https://auth.example.com
AUTH_ZITADEL_ID=
AUTH_ZITADEL_SECRET=

# NATS websocket URL
NATS_ENDPOINT=wss://nats.nats.svc:4222

# NATS base64-encoded nobody user creds for decentralised auth-callout
NATS_NOBODY_CREDS_B64=
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-object-type": 0
}
}



27 changes: 27 additions & 0 deletions .github/workflows/begin_release_flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: begin-release-flow

on:
push:
tags:
- v*.*.*

jobs:
spawn-workflow:
runs-on: ubuntu-latest
steps:
- run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: dispatch-next-workflow
uses: peter-evans/repository-dispatch@v3
if: github.event_name != 'workflow_dispatch'
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: dispatch-build-docker-image
client-payload: |-
{
"ref": "${{ github.ref }}",
"sha": "${{ github.sha }}",
"tag": "${{ env.TAG }}",
"chart_repo": "jr200/helm-charts",
"chart_dir": "charts",
"platforms": ""
}
51 changes: 51 additions & 0 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build-docker-image

on:
repository_dispatch:
types:
- dispatch-build-docker-image

workflow_dispatch:
inputs:
tag:
description: docker-image-tag
required: false
type: string
default: dev
platforms:
description: platform-filter-json
required: false
type: string
default: |-
[ "linux/amd64" ]
jobs:
configure:
uses: jr200/github-action-templates/.github/workflows/preconfigure.yml@main
with:
event_name: ${{ toJson(github.event_name) }}
event: ${{ toJson(github.event) }}

main:
needs: configure
uses: jr200/github-action-templates/.github/workflows/build_docker_image_multiplatform.yml@main
with:
registry_name: ghcr.io
image_name: ${{ github.repository }}
tag: ${{ fromJson(needs.configure.outputs.context).tag }}
platforms: ${{ fromJson(needs.configure.outputs.context).platforms }}
secrets:
registry_username: ${{ github.actor }}
registry_token: ${{ secrets.GITHUB_TOKEN }}

spawn-workflow:
needs: main
runs-on: ubuntu-latest
steps:
- name: dispatch-next-workflow
uses: peter-evans/repository-dispatch@v3
if: github.event_name != 'workflow_dispatch'
with:
event-type: dispatch-build-helm-chart
token: ${{ secrets.GITHUB_TOKEN }}
client-payload: ${{ toJson(github.event.client_payload) }}
47 changes: 47 additions & 0 deletions .github/workflows/build_helm_chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build-helm-chart

on:
repository_dispatch:
types:
- dispatch-build-helm-chart

workflow_dispatch:
inputs:
chart_repo:
description: 'charts repo'
required: true
type: string
default: jr200/helm-charts-private
chart_dir:
description: 'charts folder'
required: true
type: string
default: charts

jobs:
configure:
uses: jr200/github-action-templates/.github/workflows/preconfigure.yml@main
with:
event_name: ${{ toJson(github.event_name) }}
event: ${{ toJson(github.event) }}

main:
needs: configure
uses: jr200/github-action-templates/.github/workflows/build_helm_chart.yml@main
with:
chart_repo: ${{ fromJson(needs.configure.outputs.context).chart_repo }}
chart_dir: ${{ fromJson(needs.configure.outputs.context).chart_dir }}
secrets:
charts_write_token: ${{ secrets.CHARTS_WRITE_TOKEN }}

spawn-workflow:
needs: main
runs-on: ubuntu-latest
steps:
- name: dispatch-next-workflow
uses: peter-evans/repository-dispatch@v3
if: github.event_name != 'workflow_dispatch'
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: dispatch-publish-release
client-payload: ${{ toJson(github.event.client_payload) }}
29 changes: 29 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish-release

on:
repository_dispatch:
types:
- dispatch-publish-release

workflow_dispatch:
inputs:
tag:
description: 'release-version'
required: true
type: string
default: v0.1.0

jobs:
configure:
uses: jr200/github-action-templates/.github/workflows/preconfigure.yml@main
with:
event_name: ${{ toJson(github.event_name) }}
event: ${{ toJson(github.event) }}

main:
needs: configure
uses: jr200/github-action-templates/.github/workflows/publish_release.yml@main
with:
tag: ${{ fromJson(needs.configure.outputs.context).tag }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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*

# env files (can opt-in for commiting if needed)
.env
.env.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.history/
*.bak
*.swp
private/
analyze/
*.tgz
10 changes: 10 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
plugins: [require.resolve('prettier-plugin-tailwindcss')],
arrowParens: 'avoid',
trailingComma: 'es5',
tabWidth: 2,
printWidth: 120,
semi: false,
singleQuote: true,
jsxSingleQuote: true,
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Jayshan Raghunandan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 3753510

Please sign in to comment.