-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit 8ea37c5
Showing
81 changed files
with
6,026 additions
and
0 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,9 @@ | ||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres | ||
|
||
# SMTP config | ||
FROM_EMAIL= | ||
SMTP_HOST= | ||
SMTP_PORT= | ||
SMTP_SECURE= | ||
SMTP_USER= | ||
SMTP_PASS= |
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,13 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
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,30 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:svelte/recommended', | ||
'prettier' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020, | ||
extraFileExtensions: ['.svelte'] | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.svelte'], | ||
parser: 'svelte-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser' | ||
} | ||
} | ||
] | ||
}; |
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 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
.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,2 @@ | ||
engine-strict=true | ||
resolution-mode=highest |
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,13 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
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 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100, | ||
"plugins": ["prettier-plugin-svelte"], | ||
"pluginSearchDirs": ["."], | ||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] | ||
} |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Akash Agarwal | ||
|
||
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. |
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 @@ | ||
# SLIDE: SvelteKit + Lucia + i18n using inlang + Drizzle + TailwindCSS using Skeleton | ||
|
||
- [Lucia](https://lucia-auth.com/) for authentication | ||
- [inlang](https://inlang.com) for language translation | ||
- [Drizzle ORM](https://orm.drizzle.team/) for database connectivity and type safety | ||
- [Skeleton](https://www.skeleton.dev) for ui elements | ||
- [Lucide](https://lucide.dev) for icons | ||
- [Zod](https://zod.dev) | ||
- [Superforms](https://superforms.vercel.app) to handle form validation and management. | ||
|
||
Highly inspired from [Sveltekit Auth Starter](https://github.com/delay/sveltekit-auth-starter) which uses prisma, I wanted one with drizzle ORM and a [BottomBar](https://github.com/delay/sveltekit-auth-starter/pull/10) as I prefer to use bottom bar in mobile views. |
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 @@ | ||
import type { Config } from "drizzle-kit"; | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
export default { | ||
schema: "./src/lib/server/db/schema.ts", | ||
out: "./migrations", | ||
connectionString: process.env.DATABASE_URL, | ||
} satisfies Config; |
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,26 @@ | ||
|
||
/** | ||
* @type { import("@inlang/core/config").DefineConfig } | ||
*/ | ||
export async function defineConfig(env) { | ||
const { default: jsonPlugin } = await env.$import( | ||
"https://cdn.jsdelivr.net/gh/samuelstroschein/inlang-plugin-json@2/dist/index.js" | ||
) | ||
const { default: sdkPlugin } = await env.$import( | ||
"https://cdn.jsdelivr.net/npm/@inlang/sdk-js-plugin@0.6.3/dist/index.js" | ||
) | ||
|
||
return { | ||
referenceLanguage: "en", | ||
plugins: [ | ||
jsonPlugin({ | ||
pathPattern: "./languages/{language}.json", | ||
}), | ||
sdkPlugin({ | ||
languageNegotiation: { | ||
strategies: [{ type: "localStorage" }] | ||
} | ||
}), | ||
], | ||
} | ||
} |
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,36 @@ | ||
{ | ||
"signin": "Anmelden", | ||
"signup": "Registrieren", | ||
"signout": "Abmelden", | ||
"forgotPassword": "Passwort vergessen?", | ||
"contact": "Kontakt", | ||
"privacy": "Datenschutz", | ||
"terms": "Nutzungsbedingungen", | ||
"email": "E-Mail-Adresse", | ||
"password": "Passwort", | ||
"firstName": "Vorname", | ||
"lastName": "Nachname", | ||
"profile": "Profil", | ||
"home": "Startseite", | ||
"dashboard": "Armaturenbrett", | ||
"auth": { | ||
"password": { | ||
"reset": { | ||
"success": { | ||
"emailSent": "Passwort zurücksetzen E-Mail gesendet", | ||
"checkEmail": "Überprüfen Sie Ihr E-Mail-Konto auf einen Link zum Zurücksetzen Ihres Passworts. Wenn er nicht innerhalb weniger Minuten angezeigt wird, überprüfen Sie Ihren Spam-Ordner." | ||
}, | ||
"resetProblem": "Problem beim Zurücksetzen des Passworts", | ||
"sendResetEmail": "Passwort-Zurücksetzen-E-Mail senden" | ||
}, | ||
"update": { | ||
"success": { | ||
"updated": "Passwort erfolgreich aktualisiert" | ||
}, | ||
"changePassword": "Ändern Sie Ihr Passwort", | ||
"passwordProblem": "Problem beim Passwortwechsel", | ||
"updatePassword": "Passwort aktualisieren" | ||
} | ||
} | ||
} | ||
} |
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,37 @@ | ||
{ | ||
"signin": "Sign In", | ||
"signinProblem": "Sign In Problem", | ||
"signup": "Sign Up", | ||
"signout": "Sign Out", | ||
"forgotPassword": "Forgot Password?", | ||
"contact": "Contact", | ||
"privacy": "Privacy", | ||
"terms": "Terms", | ||
"email": "Email Address", | ||
"password": "Password", | ||
"firstName": "First Name", | ||
"lastName": "Last Name", | ||
"profile": "Profile", | ||
"home": "Home", | ||
"dashboard": "Dashboard", | ||
"auth": { | ||
"password": { | ||
"reset": { | ||
"success": { | ||
"emailSent": "Password Reset Email Sent", | ||
"checkEmail": "Check your email account for a link to reset your password. If it doesn’t appear within a few minutes, check your spam folder." | ||
}, | ||
"resetProblem": "Reset Password Problem", | ||
"sendResetEmail": "Send Password Reset Email" | ||
}, | ||
"update": { | ||
"success": { | ||
"updated": "Password updated successfully" | ||
}, | ||
"changePassword": "Change Your Password", | ||
"passwordProblem": "Change Password Problem", | ||
"updatePassword": "Update Password" | ||
} | ||
} | ||
} | ||
} |
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,36 @@ | ||
{ | ||
"signin": "Iniciar sesión", | ||
"signup": "Registrarse", | ||
"signout": "Cerrar sesión", | ||
"forgotPassword": "¿Olvidaste tu contraseña?", | ||
"contact": "Contacto", | ||
"privacy": "Privacidad", | ||
"terms": "Términos", | ||
"email": "Dirección de correo electrónico", | ||
"password": "Contraseña", | ||
"firstName": "Nombre", | ||
"lastName": "Apellido", | ||
"profile": "Perfil", | ||
"home": "Inicio", | ||
"dashboard": "Panel", | ||
"auth": { | ||
"password": { | ||
"reset": { | ||
"success": { | ||
"emailSent": "Correo electrónico de restablecimiento de contraseña enviado", | ||
"checkEmail": "Verifique su cuenta de correo electrónico para obtener un enlace para restablecer su contraseña. Si no aparece en unos minutos, verifique su carpeta de correo no deseado." | ||
}, | ||
"resetProblem": "Problema al restablecer la contraseña", | ||
"sendResetEmail": "Enviar correo electrónico de restablecimiento de contraseña" | ||
}, | ||
"update": { | ||
"success": { | ||
"updated": "Contraseña actualizada correctamente" | ||
}, | ||
"changePassword": "Cambiar contraseña", | ||
"passwordProblem": "Problema al cambiar la contraseña", | ||
"updatePassword": "Actualizar contraseña" | ||
} | ||
} | ||
} | ||
} |
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,41 @@ | ||
CREATE TABLE IF NOT EXISTS "auth_key" ( | ||
"id" varchar(255) PRIMARY KEY NOT NULL, | ||
"user_id" uuid NOT NULL, | ||
"primary_key" boolean NOT NULL, | ||
"hashed_password" varchar(255), | ||
"expires" bigint | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS "auth_session" ( | ||
"id" varchar(128) PRIMARY KEY NOT NULL, | ||
"user_id" uuid NOT NULL, | ||
"active_expires" bigint NOT NULL, | ||
"idle_expires" bigint NOT NULL | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS "auth_user" ( | ||
"id" uuid PRIMARY KEY NOT NULL, | ||
"email" text NOT NULL, | ||
"first_name" text, | ||
"last_name" text, | ||
"role" text DEFAULT 'user' NOT NULL, | ||
"verified" boolean DEFAULT false NOT NULL, | ||
"receive_email" boolean DEFAULT true NOT NULL, | ||
"token" text, | ||
"created_at" timestamp DEFAULT now() NOT NULL, | ||
"updated_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "name_idx" ON "auth_user" ("email"); | ||
CREATE INDEX IF NOT EXISTS "token_idx" ON "auth_user" ("token"); | ||
DO $$ BEGIN | ||
ALTER TABLE "auth_key" ADD CONSTRAINT "auth_key_user_id_auth_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "auth_user"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
|
||
DO $$ BEGIN | ||
ALTER TABLE "auth_session" ADD CONSTRAINT "auth_session_user_id_auth_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "auth_user"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.