Nestjs Prisma Starter

screenshot of Nestjs Prisma Starter
nestjs
prisma

Starter template for NestJS includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker

Overview

This product is a starter template for NestJS and Prisma. It provides a foundation for developing applications using NestJS, a powerful Node.js framework, and Prisma, an open-source database toolkit. The template includes features such as GraphQL with playground, code-first development with decorators, Prisma for database modeling and migration, JWT authentication with passport-jwt, and REST API documentation with Swagger. It also provides instructions for setting up Prisma, PostgreSQL with Docker, and developing the schema and resolver for the GraphQL API. This starter template aims to streamline the development process and provide a solid foundation for building NestJS and Prisma applications.

Features

  • GraphQL with playground
  • Code-first development with decorators
  • Prisma for database modeling, migration, and type-safe access (Postgres, MySQL & MongoDB)
  • JWT authentication with passport-jwt
  • REST API documentation with Swagger

Prisma Setup

  1. Install Dependencies

    • Install NestJS CLI to start and generate CRUD resources.
    • Install the dependencies for the Nest application.
  2. PostgreSQL with Docker

    • Setup a development PostgreSQL with Docker.
    • Copy .env.example and rename to .env.
    • Update the required environments for PostgreSQL in the .env file.
  3. Prisma Migrate

    • Prisma Migrate is used to manage the schema and migration of the database.
    • Set the DATABASE_URL environment variable in the .env file.
    • Use Prisma Migrate to create migration files, update the database schema, and generate Prisma Client.
  4. Prisma Client JS

    • Generate the Prisma Client by running the relevant command.
  5. Seed the database data with a provided script.

  6. Start NestJS Server

    • Run the command to start the NestJS server.

GraphQL Playground

  • Access the GraphQL playground to interact with the API.

Rest API

  • Use Docker to set up the REST API.

Schema Development

  • Develop the API schema and resolver using NestJS.

GraphQL Client

  • Set up a GraphQL client, specifically Angular, to interact with the API.

Authentication

  • Implement and configure JWT authentication with NestJS and passport-jwt.

Summary

This product is a starter template for NestJS and Prisma that provides a solid foundation for developing applications using these technologies. It includes features such as GraphQL with playground, code-first development with decorators, Prisma for database modeling and migration, JWT authentication with passport-jwt, and REST API documentation with Swagger. The installation guide provides step-by-step instructions for setting up Prisma, PostgreSQL with Docker, and developing the schema and resolver for the GraphQL API. Overall, this starter template aims to simplify the development process and offer a comprehensive solution for building NestJS and Prisma applications.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

prisma
Prisma

Prisma is a server-side library that helps developers read and write data to the database in an intuitive, efficient and safe way.

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

graphql
Graphql

A website that uses GraphQL as a query language to manage data fetching and state management. This includes features such as a strongly typed schema, client-side caching, and declarative data fetching to streamline data management and optimize website performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.