Journey to the real world by cloning DEV.to backend server(part 2)
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_serverharsh@dev:~/Harsh/nodejs/devblog_server$ pnpm init -yharsh@dev:~/Harsh/nodejs/devblog_server$ pnpm add apollo-server-express graphql express @prisma/clientharsh@dev:~/Harsh/nodejs/devblog_server$ pnpm add -D nodemon prismaharsh@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
graphql
is a javascript implementation of GraphQL
@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
Original Link: https://dev.to/harshmangalam/journey-to-the-real-world-by-cloning-dev-to-backend-server-2m9j
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To