-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
1,769 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
DATABASE_URL=postgres://app:TxVeQ4nN82SSiYHoswqOURZvQDaL4KpNElsCEEe9bwDxMd73KckIeXzS5cU6LiC2@localhost:30003/app |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,17 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.ts", | ||
"css": "src/app/globals.css", | ||
"baseColor": "slate", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
This file contains 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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains 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,24 @@ | ||
apiVersion: v2 | ||
name: disaster-recovery | ||
description: A Helm chart for Kubernetes | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
This file contains 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,9 @@ | ||
apiVersion: v1 | ||
type: kubernetes.io/basic-auth | ||
kind: Secret | ||
metadata: | ||
name: {{ .Values.dev.database.secret.name }} | ||
namespace: {{ .Values.dev.namespace }} | ||
data: | ||
password: {{ .Values.dev.database.secret.password }} | ||
username: {{ .Values.dev.database.secret.username }} |
This file contains 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,16 @@ | ||
apiVersion: postgresql.cnpg.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: {{ .Values.dev.database.name }} | ||
namespace: {{ .Values.dev.namespace }} | ||
spec: | ||
instances: {{ .Values.dev.database.instance }} | ||
primaryUpdateStrategy: unsupervised | ||
monitoring: | ||
enablePodMonitor: true | ||
storage: | ||
size: {{ .Values.dev.database.storage.size }} | ||
bootstrap: | ||
initdb: | ||
secret: | ||
name: {{ .Values.dev.database.secret.name }} |
This file contains 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,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: {{ .Values.dev.namespace }} |
This file contains 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,21 @@ | ||
# Global configuration | ||
dockerRegistry: | ||
dockerconfigjson: "" | ||
image: | ||
pullPolicy: Always | ||
repository: jowadev/strapi-backend | ||
tag: local | ||
|
||
# Dev | ||
dev: | ||
fullname: db-backend | ||
namespace: dev | ||
database: | ||
name: postgresql | ||
instance: 3 | ||
storage: | ||
size: 1Gi | ||
secret: | ||
name: database-secret | ||
username: YXBw | ||
password: VHhWZVE0bk44MlNTaVlIb3N3cU9VUlp2UURhTDRLcE5FbHNDRUVlOWJ3RHhNZDczS2NrSWVYelM1Y1U2TGlDMg== |
This file contains 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,11 @@ | ||
import 'dotenv/config'; | ||
import {defineConfig} from 'drizzle-kit'; | ||
|
||
export default defineConfig({ | ||
schema: './src/db/todo/schema.ts', | ||
out: './src/db/todo/migrations', | ||
dialect: 'postgresql', | ||
dbCredentials: { | ||
url: process.env.DATABASE_URL!, | ||
}, | ||
}); |
This file contains 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 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** @type {import('postcss-load-config').Config} */ | ||
const config = { | ||
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
}; | ||
|
||
export default config; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,17 @@ | ||
'use server' | ||
|
||
import {z} from "zod"; | ||
import {TodoFormSchema} from "@/db/todo/validator"; | ||
import {insertTodo} from "@/db/todo/service"; | ||
import {NewTodoType} from "@/db/todo/schema"; | ||
import {revalidatePath} from "next/cache"; | ||
|
||
export const createTodo = async (data: z.infer<typeof TodoFormSchema>) => { | ||
const validatedFields = TodoFormSchema.safeParse(data); | ||
if (!validatedFields.success) { | ||
throw new Error(validatedFields.error.errors[0].message); | ||
} | ||
const insertResult: NewTodoType[] = await insertTodo(validatedFields.data) | ||
revalidatePath('/'); | ||
return insertResult; | ||
} |
This file contains 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,17 @@ | ||
'use server' | ||
|
||
import {z} from "zod"; | ||
import {TodoEditFormSchema} from "@/db/todo/validator"; | ||
import {updateTodo} from "@/db/todo/service"; | ||
import {NewTodoType} from "@/db/todo/schema"; | ||
import {revalidatePath} from "next/cache"; | ||
|
||
export const editTodo = async (data: z.infer<typeof TodoEditFormSchema>) => { | ||
const validatedFields = TodoEditFormSchema.safeParse(data); | ||
if (!validatedFields.success) { | ||
throw new Error(validatedFields.error.errors[0].message); | ||
} | ||
const updateResult: NewTodoType[] = await updateTodo(validatedFields.data.id, validatedFields.data); | ||
revalidatePath('/'); | ||
return updateResult; | ||
} |
This file contains 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,16 @@ | ||
'use server' | ||
|
||
import {z} from "zod"; | ||
import {TodoDeleteSchema} from "@/db/todo/validator"; | ||
import {revalidatePath} from "next/cache"; | ||
import {deleteTodo} from "@/db/todo/service"; | ||
|
||
export const removeTodo = async (data: z.infer<typeof TodoDeleteSchema>) => { | ||
const validatedFields = TodoDeleteSchema.safeParse(data); | ||
if (!validatedFields.success) { | ||
throw new Error(validatedFields.error.errors[0].message); | ||
} | ||
const removeResult = await deleteTodo(validatedFields.data.id); | ||
revalidatePath('/'); | ||
return removeResult; | ||
} |
Oops, something went wrong.