A starter repository for building efficient, scalable server-side applications with NestJS, GraphQL, and Prisma.
npm installStart the development server:
npm run start:devnpm run build
npm run start:prod# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Test coverage
npm run test:covdocker-compose up -dEdit .env if needed. Default:
DATABASE_URL="postgresql://nestuser:nestpass@localhost:5432/nestgql?schema=public"
npm exec prisma migrate deploynpm exec prisma generatenpx prisma db seed This project uses GraphQL Code Generator to generate TypeScript types and resolvers from your GraphQL schema.
Edit schema.graphql as needed.
npm run codegenThis will generate types in src/generated/graphql.ts.
You can use the generated Prisma Client in your services. Example:
import { PrismaService } from '../prisma.service';
@Injectable()
export class ExampleService {
constructor(private prisma: PrismaService) {}
async getAuthors() {
return this.prisma.author.findMany();
}
}- Format code:
npm run format - Lint code:
npm run lint
UNLICENSED