- open docker, then cmd →
docker compose -f docker-compose.yml up -d
- if port being in use.
docker ps -a
to see what container id using that port docker stop {container_id}
to stop it- then
docker-compose up -d
again
- if port being in use.
- use tablePlus (or pgAdmin at localhost:5050) to see database
- host : localhost
- port : 5432
- user : tinker_admin
- password : tinkerbread1234
- database : dev
pnpm i
to install every library- open docker, then cmd →
docker-compose up -d
- run
pnpm add @prisma/client prisma
,pnpm prisma generate
,npx prisma migrate dev
- run
pnpm run seed
to create mock data
docker-compose -f docker-compose.yml down
docker volume ls
docker volume rm 2tinkerbread_postgres-data
docker compose -f docker-compose.yml up -d
// you have to run prisma migration again
npx prisma migrate dev
pnpm run seed
You don’t need to read this. if you didn’t have to create project from scratch
we will use next.js as a framework. In frontend we use tailwind css, three.js , ***.
backend we use progress as a database, prisma as OSA, and nextAuth for authentation.
// next.js : choose javascript, Tailwind CSS, appRouter
npx create-next-app@latest
// other library ---------------------
pnpm i three.js
pnpm i @prisma/client
// docker
create docker-compose.yml
"
version: '3.8'
services:
postgres:
image: postgres:latest
environment:
POSTGRES_USER: tinker_admin
POSTGRES_PASSWORD: tinkerbread1234
POSTGRES_DB: mydb
ports: - "5432:5432"
volumes: - postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
"
// prisma ---------------------
pnpm i prisma --save-dev
// pnpm i prisma/client
pnpm add @prisma/client prisma
pnpm prisma generate
npx prisma init // init prisma schema, then write prisma schema
// prisma migration
npx prisma migrate dev --name init
// create prisma/seed.js then create mock data
// add script in package.json
"scripts": {
"seed": "node prisma/seed.js"
}
// Run Migration and Seed
npx prisma migrate dev --name mock_data
// npx run seed : DB is not with seed anymore, I will write doc later
This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.js
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.