In the last series we have talked about the tools and library we will use to create dev.to backend.
In this series we will setup our server using Express js , Prisma and apollo server.
I am using ubuntu linux based os and vscode as IDE.
Open your terminal using
ctrl + alt + t and navigate to the choice of your directory where you will create your project .
harsh@dev:~ cd Harsh/nodejs/devblog_server harsh@dev:~/Harsh/nodejs/devblog_server$ pnpm init -y harsh@dev:~/Harsh/nodejs/devblog_server$ pnpm add apollo-server-express graphql express @prisma/client harsh@dev:~/Harsh/nodejs/devblog_server$ pnpm add -D nodemon prisma harsh@dev:~/Harsh/nodejs/devblog_server$ code .
here i am using pnpm a new way to manage nodejs dependency. pnpm is Fast, disk space efficient package manager and upto 2x faster than alternatives.
I have initialize brand new project devblog_server and then install dependencies and devDependencies related to express , prisma and apollo server.
apollo-server-express is a express integration of graphql server. You can opt any framework no matter like Connect, Hapi, Koa and Restify
@prisma/client is an auto-generated query builder that enables type-safe database access and reduces boilerplate
nodemon auto restart our development server when we make change in our file.
prisma provide cli based interface to generate prisma project and apply migration
In this series we have setup our development tools and installing our dependencies . From next series we will setup apollo server , express and prisma with postgresql database