Skip to content

[Startup MVP recipes #6] GraphQL Resolver inheritance and a CRUD base resolver with generics

Background For your background information, we have our own defined auth guard named MagentoAuth (that interacts with Magento and issue our own tokens) and we have a sellerId which is just the user id. We self defined @CurrentSellerId() to get the sellerId for GQL from… Read More »[Startup MVP recipes #6] GraphQL Resolver inheritance and a CRUD base resolver with generics

[Startup MVP recipes #5.2] A simple resource generated by nest-cli then configured (part 2)

Warning: we are using typeorm 0.3 and postgres for this tutorial This tutorial continues where we left in And let’s fill in the rest of generated boilerplate by nest-cli. The Read of CRUD Find queries are pretty straightforward: The Update of CRUD Define update DTO… Read More »[Startup MVP recipes #5.2] A simple resource generated by nest-cli then configured (part 2)

[Startup MVP recipes #5.1] A simple resource generated by nest-cli then configured (part 1)

Preparation Install nest cli (globally) Install class-validator for custom validations. Generate the code Generate a resource, with generated CRUD endpoints (code first GraphQL) Set the name to users Select “GraphQL (code first)” Generate CRUD entry points? → Yes The generated code serves a good bare… Read More »[Startup MVP recipes #5.1] A simple resource generated by nest-cli then configured (part 1)

[Startup MVP Recipes #3] Nest.js Linting (ESLint, Prettier) supports

Credits to https://v.pincman.com/courses/64.html?chapter=1 Install NPM packages for dev This will raise many lint errors on existing files and please make sure to cleanup unused generated files like AppController AppService etc. And also resolve lint errors on existing files (e.g. lint error of default export). New… Read More »[Startup MVP Recipes #3] Nest.js Linting (ESLint, Prettier) supports

[Startup MVP recipes #2]  Nest.js + TypeORM config module and environment variables

Intro We usually have different environments: local, dev, prod etc. (or test, staging..) Each of the environment has its own separate database, and connect to different services with different credentials. Environment variables are used to hide confidential information and to provide a layer of customization… Read More »[Startup MVP recipes #2]  Nest.js + TypeORM config module and environment variables

[Startup MVP recipes #1] Nest.js local dev environment setup

Nest.js https://docs.nestjs.com/first-steps Install Nest.js CLI Init and run project Postgres Install Postgres on Mac (you can search for other ways of installing Postgres on different environments) (Optional) Download pgAdmin We can use pgAdmin to connect to local postgres and create new roles or databases locally.… Read More »[Startup MVP recipes #1] Nest.js local dev environment setup

[Notes] Next.js deployment on Netlify with dynamic routes

Follow tutorial at https://www.netlify.com/blog/2020/11/30/how-to-deploy-next.js-sites-to-netlify/ Then install this npm plugin and take tutorial at https://github.com/netlify/next-on-netlify This will enable SSR next.js and dynamic routing https://nextjs.org/docs/routing/dynamic-routes