npm install
# with yarn
yarn init
# with npm
npm init
# with yarn
yarn add -D typescript
# with npm
npm init -y
npm install -D typescript
npx tsc --init
npm install argon2 config cookie-parser dotenv express jsonwebtoken lodash redis ts-node-dev zod cors
dotenv
– loads environment variables from a .env file into process.envargon2
– to hash the password dataconfig
– allow us to provide TypeScript types for the environment variables we import from the .env filecookie-parser
– to parse the cookies in the request headers and attach them to req.cookiesjsonwebtoken
– to sign and verify JWTslodash
– contains utilities for simplifying common programming tasks.ts-node-dev
– allow us run the server. An alternative solution isnodemon
andts-node
# npm
npm install -D morgan typescript
# yarn
yarn add -D morgan typescript
morgan
HTTP request logger middleware
# npm
npm install -D @types/config @types/cookie-parser @types/express @types/jsonwebtoken @types/lodash @types/morgan @types/node @types/cors
# yarn
yarn add -D @types/config @types/cookie-parser @types/express @types/jsonwebtoken @types/lodash @types/morgan @types/node @types/cors
See initial
commit to git
tsconfig.json:
"lib": ["esnext"],
npm install prisma --save-dev
npx prisma init
DATABASE_URL="postgresql://yevgen:password@localhost:5433/testnextjs?schema=public"
npm install @prisma/client
"postinstall": "prisma generate",