Todo – backend
nx g @nx/node:application apps/todo-backend --framework express.pnpm add graphql-http.touch apps/todo-backend/src/global.d.tsand then copy and paste what is written in this Stackoverflow answer. I wrote a post about declaration modules.- The I started with writing my API’s schema in
schema.graphql. - Then I moved to define their resolver bodies.
-
Initialize Prisma + PostgreSQL:
nx add @nx-tools/nx-prisma.-
nx g @nx-tools/nx-prisma:configuration --project todo-backend --database postgresql. - Define my tables and used docker compose to have a postgres instance.
- Prepared service layer, and repository layer + seeding some data.
- Add docker compose related scripts in
apps/todo-backend/project.json. - Ran
nx prisma-migrate todo-backend --name initto generate the migration files. - Test Driven Development approach:
- Wrote E2E tests.
- Implement queries/mutations.