-
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.
Add lucia-drizzle-sqlite-turso-qwik example
- Loading branch information
1 parent
c2b6b67
commit 8fe349c
Showing
31 changed files
with
10,113 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,2 @@ | ||
DATABASE_URL= | ||
DATABASE_AUTH_TOKEN= |
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,38 @@ | ||
**/*.log | ||
**/.DS_Store | ||
*. | ||
.vscode/settings.json | ||
.history | ||
.yarn | ||
bazel-* | ||
bazel-bin | ||
bazel-out | ||
bazel-qwik | ||
bazel-testlogs | ||
dist | ||
dist-dev | ||
lib | ||
lib-types | ||
etc | ||
external | ||
node_modules | ||
temp | ||
tsc-out | ||
tsdoc-metadata.json | ||
target | ||
output | ||
rollup.config.js | ||
build | ||
.cache | ||
.vscode | ||
.rollup.cache | ||
dist | ||
tsconfig.tsbuildinfo | ||
vite.config.ts | ||
*.spec.tsx | ||
*.spec.ts | ||
.netlify | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock | ||
server |
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,42 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:qwik/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ["./tsconfig.json"], | ||
ecmaVersion: 2021, | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-inferrable-types": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-namespace": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-this-alias": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"prefer-spread": "off", | ||
"no-case-declarations": "off", | ||
"no-console": "off", | ||
"@typescript-eslint/no-unused-vars": ["error"], | ||
"@typescript-eslint/consistent-type-imports": "warn", | ||
"@typescript-eslint/no-unnecessary-condition": "warn", | ||
}, | ||
}; |
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,47 @@ | ||
# Build | ||
/dist | ||
/lib | ||
/lib-types | ||
/server | ||
|
||
# Env | ||
.env | ||
|
||
# DB | ||
db.sqlite | ||
|
||
# Development | ||
node_modules | ||
*.local | ||
|
||
# Cache | ||
.cache | ||
.mf | ||
.rollup.cache | ||
tsconfig.tsbuildinfo | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
# Editor | ||
.vscode/* | ||
!.vscode/launch.json | ||
!.vscode/*.code-snippets | ||
|
||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Yarn | ||
.yarn/* | ||
!.yarn/releases |
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,38 @@ | ||
**/*.log | ||
**/.DS_Store | ||
*. | ||
.vscode/settings.json | ||
.history | ||
.yarn | ||
bazel-* | ||
bazel-bin | ||
bazel-out | ||
bazel-qwik | ||
bazel-testlogs | ||
dist | ||
dist-dev | ||
# lib | ||
lib-types | ||
etc | ||
external | ||
node_modules | ||
temp | ||
tsc-out | ||
tsdoc-metadata.json | ||
target | ||
output | ||
rollup.config.js | ||
build | ||
.cache | ||
.vscode | ||
.rollup.cache | ||
dist | ||
tsconfig.tsbuildinfo | ||
vite.config.ts | ||
*.spec.tsx | ||
*.spec.ts | ||
.netlify | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock | ||
server |
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,3 @@ | ||
export default { | ||
plugins: ['prettier-plugin-tailwindcss'], | ||
} |
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,32 @@ | ||
# Username & password example with Lucia and Qwik City | ||
|
||
This example uses `@libsql/client` with Turso and Drizzle ORM. | ||
|
||
```bash | ||
# install dependencies | ||
pnpm i | ||
|
||
# run drizzle kit | ||
pnpm db:push | ||
|
||
# run dev server | ||
pnpm dev | ||
``` | ||
|
||
## Runtime | ||
|
||
This example is built for Node.js 20. If you're using Node.js 16/18, un-comment the following lines in `auth/lucia.ts`: | ||
|
||
```ts | ||
// import "lucia/polyfill/node"; | ||
``` | ||
|
||
## User schema | ||
|
||
| id | type | unique | | ||
| ------------ | -------- | :----: | | ||
| `id` | `string` | | | ||
| `username` | `string` | ✓ | | ||
| `names` | `string` | | | ||
| `last_names` | `string` | | | ||
| `email` | `string` | ✓ | |
13 changes: 13 additions & 0 deletions
13
examples/lucia-drizzle-sqlite-turso-qwik/drizzle.config.ts
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 @@ | ||
import { defineConfig } from "drizzle-kit"; | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
export default defineConfig({ | ||
schema: "./src/lib/schema.ts", | ||
out: "./drizzle", | ||
driver: "turso", | ||
dbCredentials: { | ||
url: process.env.DATABASE_URL!, | ||
authToken: process.env.DATABASE_AUTH_TOKEN, | ||
}, | ||
}); |
Oops, something went wrong.