-
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
17 changed files
with
121 additions
and
75 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
DB_URL="YOUR_DB_URL" | ||
JWT_SECRET="YOUR_JWT_SECRET" | ||
DB_URL="YOUR_DB_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
.nitro | ||
.cache | ||
dist | ||
*.db | ||
.drizzle | ||
|
||
# Node dependencies | ||
node_modules | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,6 @@ format: | |
lint: | ||
@bunx biome lint --write ./app ./server | ||
|
||
update-deps: | ||
upgrade-deps: | ||
@ncu -u | ||
@bun i |
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
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
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,13 +1,13 @@ | ||
export const useCount = defineStore({ | ||
id: 'count', | ||
state: () => ({ count: 0 }), | ||
actions: { | ||
increment() { | ||
this.count++ | ||
}, | ||
decrement() { | ||
this.count-- | ||
}, | ||
}, | ||
persist: true, | ||
}) | ||
id: "count", | ||
state: () => ({ count: 0 }), | ||
actions: { | ||
increment() { | ||
this.count++; | ||
}, | ||
decrement() { | ||
this.count--; | ||
}, | ||
}, | ||
persist: true, | ||
}); |
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 { dbUrl } from "./env" | ||
|
||
export default defineConfig({ | ||
schema: "server/database/schema.ts", | ||
out: ".drizzle", | ||
dialect: "sqlite", | ||
dbCredentials: { | ||
url: dbUrl | ||
}, | ||
strict: true, | ||
verbose: true | ||
}) |
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,5 @@ | ||
if (!process.env.DB_URL) { | ||
throw new Error('DB_URL is not set in .env file'); | ||
} | ||
|
||
export const dbUrl = process.env.DB_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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default defineEventHandler(() => { | ||
return { "status": "ok" } | ||
}) |
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 @@ | ||
import { drizzle } from 'drizzle-orm/better-sqlite3'; | ||
import { dbUrl } from '~~/env'; | ||
|
||
export const db = drizzle(dbUrl); |
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 { sql } from "drizzle-orm"; | ||
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; | ||
|
||
export const users = sqliteTable("users", { | ||
id: integer("id").primaryKey({ autoIncrement: true }), | ||
name: text("name").notNull(), | ||
email: text("email").notNull().unique(), | ||
password: text("password").notNull(), | ||
created_at: text("timestamp").notNull().default(sql`(current_timestamp)`), | ||
updated_at: text("timestamp").notNull().default(sql`(current_timestamp)`), | ||
deleted_at: text("timestamp"), | ||
is_deleted: integer("is_deleted").notNull().default(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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"extends": "../.nuxt/tsconfig.server.json" | ||
} | ||
"extends": "../.nuxt/tsconfig.server.json", | ||
"compilerOptions": { | ||
"types": ["bun-types"], | ||
} | ||
} |
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,4 +1,7 @@ | ||
{ | ||
// https://nuxt.com/docs/guide/concepts/typescript | ||
"extends": "./.nuxt/tsconfig.json" | ||
"extends": "./.nuxt/tsconfig.json", | ||
"compilerOptions": { | ||
"types": ["bun-types"], | ||
} | ||
} |