Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Goltser committed Aug 16, 2022
0 parents commit c54a047
Show file tree
Hide file tree
Showing 19 changed files with 10,085 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-console": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-unused-expressions": "error",
"prefer-const": "error"
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
.env
/dist
.DS_Store
prisma/dev.db
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
npm run typecheck
npm test
3 changes: 3 additions & 0 deletions lib/db.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PrismaClient } from "@prisma/client";

export const db = new PrismaClient();
11 changes: 11 additions & 0 deletions lib/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "dotenv/config";

import { z } from "zod";

const envSchema = z.object({
NODE_ENV: z.enum(["development", "production", "test"]),
PORT: z.preprocess(Number, z.number()),
DATABASE_URL: z.string().min(1),
});

export const env = envSchema.parse(process.env);
5 changes: 5 additions & 0 deletions lib/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { pino } from "pino";
import { pinoHttp } from "pino-http";

export const logger = pino();
export const httpLogger = pinoHttp();
Loading

0 comments on commit c54a047

Please sign in to comment.