A beginner’s guide to building web API’s with NestJs, Postgres, and Sequelize fundamentals.

Overview of NestJs:

Prerequisite:

Building blocks:

What to learn:

npm i -g @nestjs/cli
nest new nest-blog-apicd nest-blog-apinpm run start:dev
Nest Folder structure
npm install -g sequelize
npm install --save sequelize sequelize-typescript pg-hstore pg
npm install --save-dev @types/sequelize
npm install dotenv --save
src/core/database/interfaces/dbConfig.interface.ts
src/core/database/database.config.ts
src/app.module.ts
src/core/database/database.providers.ts
src/core/constants/index.ts
src/core/database/database.module.ts
src/app.module.ts
src/main.ts
src/modules/users/user.entity.ts
src/modules/users/dto/user.dto.ts
src/modules/users/users.providers.ts
src/modules/users/users.module.ts
src/modules/users/users.service.ts
src/core/database/database.providers.ts
src/modules/auth/local.strategy.ts
src/modules/auth/auth.module.ts
src/modules/auth/auth.service.ts
src/modules/auth/jwt.strategy.ts
src/modules/auth/auth.module.ts
src/modules/auth/auth.service.ts
src/modules/auth/auth.controller.ts
src/core/pipes/validate.pipe.ts
src/main.ts
src/modules/users/dto/user.dto.ts
src/core/guards/doesUserExist.guard.ts
src/modules/auth/auth.controller.ts
src/modules/posts/post.entity.ts
src/modules/posts/dto/post.dto.ts
src/modules/posts/posts.providers.ts
src/modules/posts/posts.module.ts
src/modules/posts/posts.service.ts
src/modules/posts/posts.controller.ts
Creating a post.
Fetching a Single Post
fetching all posts
updating a single post
Deleting a post

Conclusion

Full Stack Software Engineer | Minimalist | Nerd | Technical Writer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store