Skip to content

Commit

Permalink
Merge pull request #37 from ycu-engine/feat/prisma
Browse files Browse the repository at this point in the history
✨prismaでdbに接続し、簡単なAPIをいくつか実装
  • Loading branch information
nyatinte authored Sep 18, 2023
2 parents c74867d + 04b64af commit eb61f38
Show file tree
Hide file tree
Showing 43 changed files with 5,587 additions and 2,291 deletions.
1 change: 1 addition & 0 deletions .env.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL="postgresql://username:password@postgres:5432/public"
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module.exports = {
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'react/destructuring-assignment': 'off',
// sort-keys
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false, minKeys: 2 }],
'sort-keys-fix/sort-keys-fix': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
node-version: 20
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: pnpm run ci:setup
- run: pnpm run type-check
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
next-env.d.ts
.DS_Store
src/server/src/schema/*.generated.ts
.env
tsconfig.tsbuildinfo
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'
services:
postgres:
image: postgres:latest
environment:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: mydatabase
ports:
- '5432:5432'
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"ci:setup": "pnpm install && pnpm run prisma:generate && pnpm run gqlgen:server",
"format:fix": "prettier -w .",
"format:check": "prettier -c .",
"lint:fix": "eslint --fix .",
"lint:check": "eslint .",
"type-check": "tsc --noEmit",
"shadcn-add": "npx shadcn-ui@latest add",
"gqlgen:server": "graphql-codegen -c src/server/codegen.ts"
"gqlgen:server": "graphql-codegen -c src/server/codegen.ts",
"prisma:generate": "prisma generate --schema src/server/prisma/schema.prisma",
"prisma:migrate": "prisma migrate dev --schema src/server/prisma/schema.prisma",
"prisma:studio": "prisma studio --schema src/server/prisma/schema.prisma",
"prisma:seed": "prisma db seed --schema src/server/prisma/schema.prisma"
},
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} src/server/prisma/seed.ts"
},
"dependencies": {
"@devoxa/prisma-relay-cursor-connection": "^3.1.0",
"@prisma/client": "5.3.1",
"@radix-ui/react-slider": "^1.1.2",
"@radix-ui/react-slot": "^1.0.2",
"@t3-oss/env-nextjs": "^0.6.1",
Expand Down Expand Up @@ -81,6 +91,7 @@
"markuplint": "^3.12.0",
"prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.4.1",
"prisma": "^5.3.1",
"ts-node": "^10.9.1"
},
"volta": {
Expand Down
Loading

0 comments on commit eb61f38

Please sign in to comment.