Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import dotenv from "dotenv";
import { defineConfig } from "drizzle-kit";

dotenv.config({ path: ".env.local" });

export default defineConfig({
out: "./drizzle",
schema: "./src/db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_DIRECT_URL as string,
},
});
5 changes: 5 additions & 0 deletions drizzle/0000_nervous_captain_america.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE "tasks" (
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "tasks_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
"name" varchar(256) NOT NULL,
"completed" boolean DEFAULT false NOT NULL
);
62 changes: 62 additions & 0 deletions drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"id": "2a41de7f-f7b4-4620-aa64-ddfc56dab898",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.tasks": {
"name": "tasks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "always",
"name": "tasks_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "2147483647",
"cache": "1",
"cycle": false
}
},
"name": {
"name": "name",
"type": "varchar(256)",
"primaryKey": false,
"notNull": true
},
"completed": {
"name": "completed",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
13 changes: 13 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1769748738092,
"tag": "0000_nervous_captain_america",
"breakpoints": true
}
]
}
13 changes: 8 additions & 5 deletions eslint.config.mts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import n from "eslint-plugin-n";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
import n from "eslint-plugin-n";
import { defineConfig } from "eslint/config";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js, n },
extends: ["js/recommended"],
plugins: { js, n, "simple-import-sort": simpleImportSort },
extends: [js.configs.recommended, n.configs["flat/recommended"]],
languageOptions: { globals: globals.node },
rules: {
...n.configs.recommended.rules,

"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
{
files: ["eslint.config.{js,mjs,cjs,ts,mts,cts}"],
rules: {
"n/no-unpublished-import": "off",
},
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"lint:staged": "lint-staged --relative",
"type-check": "tsc --noEmit",
"format:check": "prettier \"src/**/*.{ts,js,json,md,yml,yaml}\" --check",
"format": "eslint . --fix && prettier \"src/**/*.{ts,js,json,md,yml,yaml}\" --write"
"format": "eslint . --fix && prettier \"src/**/*.{ts,js,json,md,yml,yaml}\" --write",
"db:generate": "drizzle-kit generate --config=drizzle.config.ts",
"db:migrate": "drizzle-kit migrate --config=drizzle.config.ts",
"db:studio": "drizzle-kit studio --config=drizzle.config.ts"
},
"keywords": [],
"author": "",
Expand All @@ -23,18 +26,25 @@
"compression": "^1.8.1",
"cors": "^2.8.6",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.45.1",
"express": "^5.2.1",
"helmet": "^8.1.0"
"helmet": "^8.1.0",
"postgres": "^3.4.8"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"@types/compression": "^1.8.1",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/node": "^25.1.0",
"drizzle-kit": "^0.31.8",
"eslint": "^9.39.2",
"eslint-plugin-n": "^17.23.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^17.2.0",
"husky": "^9.1.7",
"jiti": "^2.6.1",
"lint-staged": "^16.2.7",
"prettier": "^3.8.1",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
Expand Down
Loading