Skip to content

Commit

Permalink
🌱 Revamp based on Pocketbase
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijmenGThN committed Dec 15, 2023
1 parent a617b96 commit 85875eb
Show file tree
Hide file tree
Showing 85 changed files with 25,111 additions and 7,952 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
64 changes: 64 additions & 0 deletions .archive/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { Inter } from 'next/font/google'
import { notFound } from 'next/navigation'
import { NextIntlClientProvider as Localizer } from 'next-intl'

import Session from './Session'

import { locales } from '@/helpers/navigation'

import '@/styles/globals.css'

import type { Metadata } from 'next'

export const metadata: Metadata = {
title: 'Wiki • Thijmen Heuvelink',
description: 'A catalogue of saved knowledge served via a web-based app.'
}

const inter = Inter({ subsets: ['latin'] })

export default async function Layout({ children, params: { locale } }: { children: React.ReactNode, params: { locale: string } }) {

locales.some(cur => cur === locale) ?? notFound()

let messages
try { messages = (await import(`../../src/locales/${locale}.json`)).default }
catch (error) { notFound() }

return (
<html lang={locale} className="h-full">
<body className={inter.className}>
<Localizer locale={locale} messages={messages}>
<Session>
<svg
className="absolute inset-0 -z-10 h-full w-full stroke-gray-200 [mask-image:radial-gradient(100%_100%_at_top_right,white,transparent)]"
aria-hidden="true"
>
<defs>
<pattern
id="83fd4e5a-9d52-42fc-97b6-718e5d7ee527"
width={200}
height={200}
x="50%"
y={-1}
patternUnits="userSpaceOnUse"
>
<path d="M100 200V.5M.5 .5H200" fill="none" />
</pattern>
</defs>
<svg x="50%" y={-1} className="overflow-visible fill-gray-50">
<path
d="M-100.5 0h201v201h-201Z M699.5 0h201v201h-201Z M499.5 400h201v201h-201Z M-300.5 600h201v201h-201Z"
strokeWidth={0}
/>
</svg>
<rect width="100%" height="100%" strokeWidth={0} fill="url(#83fd4e5a-9d52-42fc-97b6-718e5d7ee527)" />
</svg>

{children}
</Session>
</Localizer>
</body>
</html>
)
}
File renamed without changes.
33 changes: 33 additions & 0 deletions .archive/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

import { Link } from "@/helpers/navigation"

import Explore from "@/components/Explore"
import Search from "@/components/Search"
import Header from "@/components/Header"

export default function Page() {

return (
<div className="container mx-auto flex flex-col min-h-screen h-full">

<div className="grow mt-16">
<Header />

<Search />

<div className="text-right mt-3 px-2 mx-8 sm:mx-16 md:mx-32 underline text-xs">
<Link href="https://github.com/ThijmenGThN/Wiki" target="_blank">
Star this project on Github
</Link>
</div>

<Explore />
</div>

<p className="my-16 mx-auto text-xs text-center w-3/4 sm:w-1/2">
This knowledge base, serves as a valuable tool to simplify installations, troubleshoot common problems, and enhance the overall developer experience. All rights reserved.
</p>

</div>
)
}
55 changes: 9 additions & 46 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,22 @@

# ━━ Docker ━━

# Docker deploy modifier, either puts the app in development or production mode.
# Docker deploy modifier, either puts the stack in development or production mode.
# ┗━ Options: "dev" or "prod" ━━ default: "dev"
COMPOSE_PROFILES= "dev"

# Docker application port, which port the web app will listen on.
# ┗━ Options: "number" ━━ default: "3000"
APP_PORT= "3000"
NEXT_PORT= "3000"

# Docker database port, this is the port that mysql listens on.
# ┗━ Options: "number" ━━ default: "5432"
DATABASE_PORT= "5432"
# Docker pocketbase port, this is the port the backend listens on.
# ┗━ Options: "number" ━━ default: "8090"
POCKETBASE_PORT= "8090"

# Docker database password, used to initialize a default user.
# ┗━ Options: "text"
DATABASE_PASS= ""

# ━━ Next ━━

# ━━ Prisma ━━
# Pocketbase Endpoint, public address to the backend.
# ┗━ Options: "number" ━━ default: "http://localhost:8090" ━ example: "https://pb.leaflet.app"
NEXT_PUBLIC_POCKETBASE_URL = 'http://localhost:8090'

# Prisma connector, required by the generator to establish a database connection.
# ┗━ Options: "Connection URL" ━━ default: "postgresql://postgres:password@localhost:5432/table"
PRISMA_CONNECTOR="postgresql://postgres:password@localhost:5432/table"


# ━━ Next Auth ━━

# Next Auth url, required in production, set it to the canonical URL of your site.
# ┗━ Options: "url" ━━ default: "http://localhost:3000"
NEXTAUTH_URL= "http://localhost:3000"

# Next Auth secret, used to encrypt json web tokens, and to hash email verification tokens.
# ┗━ Options: "text" ━━ recommended: "$ openssl rand -base64 32"
NEXTAUTH_SECRET= ""


# ━━ Email ━━

# This should be the URL of your email server.
# ┗━ Options: "url" ━━ example: "mail.leaflet.app"
EMAIL_HOST= ""

# This should be the port number of your email server.
# ┗━ Options: "number" ━━ default SSL: "465" or STARTTLS: "587"
EMAIL_PORT= "465"

# This should be the username or email address for the email server.
# ┗━ Options: "string"
EMAIL_USER= ""

# This should be the password for the email server.
# ┗━ Options: "string"
EMAIL_PASS= ""

# This should be the email address that will be shown as the sender for outgoing emails.
# ┗━ Options: "string" ━━ example: "no-reply@leaflet.app"
EMAIL_FROM= ""
5 changes: 2 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{
"extends": "next/core-web-vitals"
}

{ "extends": "next/core-web-vitals" }
30 changes: 26 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ name: Deploy

on:
push:
branches: main
branches: leaflet # <- Rename to a valid branch.

jobs:
deploy:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 20
- uses: actions/checkout@v2
- run: npm ci
- run: npm run lint
setup:
needs: lint
runs-on: self-hosted
steps:
- uses: appleboy/ssh-action@master
Expand All @@ -17,11 +27,23 @@ jobs:
script: |
mkdir ~/env ~/env/${{github.event.repository.name}}
cd ~/env/${{github.event.repository.name}}
sudo git clone https://github.com/${{github.repository}} .
sudo git pull
echo '${{ secrets.APP_ENV }}' > .env
deploy:
needs: [lint, setup]
runs-on: self-hosted
steps:
- uses: appleboy/ssh-action@master
with:
key: ${{ secrets.SSH_KEY }}
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/env/${{github.event.repository.name}}
sudo docker-compose down
sudo docker-compose up -d
27 changes: 11 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@

# ━━ Blacklist ━━
# Environment
.env
.env*.local

*.pem
*.tsbuildinfo
*.log*
.env*
.yarn*

.DS_Store
.react-email
next-env.d.ts
/data
/out
/build
/.next
/node_modules
# Next.JS
.next
node_modules


# Package Manager
npm-debug.log*

# ━━ Whitelist ━━

!.env.sample
# Compilers
next-env.d.ts
16 changes: 8 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"files.exclude": {
"src/locales/i18n.ts": true,
"package-lock.json": true,
"postcss.config.js": true,
"app/*/Session.tsx": true,
".eslintrc.json": true,
"middleware.ts": true,
"next-env.d.ts": true,
"**/*...rest*": true,
".react-email": true,
"node_modules": true,
"LICENSE.md": true,
"debug.log": true,
"*yarn*": true,
".next": true,
"data": true,
".vscode": true,
".next": true
},
"i18n-ally.keystyle": "nested",
"i18n-ally.localesPaths": [
"src/locales"
],
"i18n-ally.keystyle": "nested"
]
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Thijmen Heuvelink

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 85875eb

Please sign in to comment.