Skip to content

ninjabit/nestjs-graphql-prisma-realworld-example-app

 
 

Repository files navigation

RealWorld Example App

NestJS, Prisma and GraphQL codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with NestJS, Prisma and GraphQL including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the NestJS, Prisma and GraphQL community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

Getting started

cp .env.example .env
# fill env variables in `.env` file
npm ci
npm start
# http://localhost:3000/api

How it works

Application is written using NestJS, Prisma and GraphQL, but since backend API specification requires REST, graphql endpoint wrapped by REST API. It is the facade and work as microservice which sends all requests to graphql api.

Project Structure

  • src - Main application source code
  • src/api - REST API wrapper under main application
  • src/app.config.ts - Application config file
  • prisma - DB toolkit to query, migrate and model your database
  • @generated - Generated code

Run realword API end-to-end tests

1: npm run start:dev
2: npm run api:spec

Old Versions

  • v6 Nest.JS v6, TypeGraphQL, TSLint

Known Issues

  • Passwords is not hashed
  • GraphQL schema user's field username renamed to name

Resources

Todo

  • Why do we need copy migrations to docker?
  • ArticleService.updateArticle() Updating tags does not working check it later
  • Use case from clean architecture mybe use userservice.follow

Scripts

autocannon -m POST -i body.json -H "Content-Type: application/json" http://localhost:3000/graphql

About

Example real world application built with NestJS, Prisma and GraphQL

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 94.7%
  • JavaScript 3.6%
  • Shell 1.5%
  • Dockerfile 0.2%