GithubHelp home page GithubHelp logo

unlight / nestjs-graphql-prisma-realworld-example-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gothinkster/realworld-starter-kit

102.0 4.0 26.0 1.76 MB

Example real world application built with NestJS, Prisma and GraphQL

Home Page: https://realworld.io

License: MIT License

JavaScript 3.05% Shell 1.26% TypeScript 95.49% Dockerfile 0.21%
realworld-backend realworld prisma nestjs-backend nestjs graphql realworld-example

nestjs-graphql-prisma-realworld-example-app's Introduction

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.environment.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

nestjs-graphql-prisma-realworld-example-app's People

Contributors

alonski avatar ericsimons avatar esakkiraj avatar geromegrignon avatar optikfluffel avatar segmentationfaulter avatar semantic-release-bot avatar unlight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nestjs-graphql-prisma-realworld-example-app's Issues

Todo

  • boundaries move prisma module to app modules
  • boundaries files to core

When I run using `pnpm run start:dev`

I got this errors when I started server application.
Before start, I ran some command like npx prisma db push, npx prisma db generate.
How I resolve this issue? I think this is just my configuration problem, not application problem


prisma/seed.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.

2 import { PrismaClient } from '@prisma/client';
           ~~~~~~~~~~~~

src/api/api.service.ts:3:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

3 import { Prisma } from '@prisma/client';
           ~~~~~~

src/app_modules/prisma/inject-repository.decorator.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.

2 import { PrismaClient } from '@prisma/client';
           ~~~~~~~~~~~~

src/app_modules/prisma/prisma.repository.ts:8:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.

8 import { PrismaClient } from '@prisma/client';
           ~~~~~~~~~~~~

src/app_modules/prisma/prisma.repository.ts:37:18 - error TS2339: Property '$on' does not exist on type 'PrismaRepository'.

37             this.$on(
                    ~~~

src/app_modules/prisma/prisma.repository.ts:52:20 - error TS2339: Property '$connect' does not exist on type 'PrismaRepository'.

52         await this.$connect();
                      ~~~~~~~~

src/app_modules/prisma/prisma.repository.ts:56:20 - error TS2339: Property '$disconnect' does not exist on type 'PrismaRepository'.

56         await this.$disconnect();
                      ~~~~~~~~~~~

src/article/article-select.service.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

2 import { Prisma } from '@prisma/client';
           ~~~~~~

src/article/article.repository.ts:9:26 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

9     update = this.prisma.article.update;
                           ~~~~~~~

src/article/article.repository.ts:10:30 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

10     findUnique = this.prisma.article.findUnique;
                                ~~~~~~~

src/article/article.repository.ts:11:28 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

11     findMany = this.prisma.article.findMany;
                              ~~~~~~~

src/article/article.repository.ts:12:26 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

12     create = this.prisma.article.create;
                            ~~~~~~~

src/article/article.repository.ts:13:25 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

13     count = this.prisma.article.count;
                           ~~~~~~~

src/article/article.repository.ts:14:26 - error TS2339: Property 'article' does not exist on type 'PrismaRepository'.

14     delete = this.prisma.article.delete;
                            ~~~~~~~

src/article/article.service.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Article'.

2 import { Article, Prisma } from '@prisma/client';
           ~~~~~~~

src/article/article.service.ts:2:19 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

2 import { Article, Prisma } from '@prisma/client';
                    ~~~~~~

src/article/author.guard.ts:3:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

3 import { Prisma } from '@prisma/client';
           ~~~~~~

src/article/testing/index.ts:1:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

1 import { Prisma } from '@prisma/client';
           ~~~~~~

src/comment/author.guard.ts:3:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

3 import { Prisma } from '@prisma/client';
           ~~~~~~

src/comment/comment.service.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

2 import { Prisma } from '@prisma/client';
           ~~~~~~

src/comment/comment.service.ts:17:55 - error TS2339: Property 'comment' does not exist on type 'PrismaRepository'.

17         private readonly repository: PrismaRepository['comment'],
                                                         ~~~~~~~~~

src/tag/tag.service.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

2 import { Prisma } from '@prisma/client';
           ~~~~~~

src/tag/tag.service.ts:11:80 - error TS2339: Property 'tag' does not exist on type 'PrismaRepository'.

11         @InjectRepository('tag') private readonly repository: PrismaRepository['tag'],
                                                                                  ~~~~~

src/user/testing/index.ts:1:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

1 import { Prisma } from '@prisma/client';
           ~~~~~~

src/user/user.repository.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'User'.

2 import { User } from '@prisma/client';
           ~~~~

src/user/user.repository.ts:10:26 - error TS2339: Property 'user' does not exist on type 'PrismaRepository'.

10     update = this.prisma.user.update;
                            ~~~~

src/user/user.repository.ts:11:30 - error TS2339: Property 'user' does not exist on type 'PrismaRepository'.

11     findUnique = this.prisma.user.findUnique;
                                ~~~~

src/user/user.repository.ts:12:28 - error TS2339: Property 'user' does not exist on type 'PrismaRepository'.

12     findMany = this.prisma.user.findMany;
                              ~~~~

src/user/user.repository.ts:13:26 - error TS2339: Property 'user' does not exist on type 'PrismaRepository'.

13     create = this.prisma.user.create;
                            ~~~~

src/user/user.repository.ts:14:25 - error TS2339: Property 'user' does not exist on type 'PrismaRepository'.

14     count = this.prisma.user.count;
                           ~~~~

src/user/user.repository.ts:19:44 - error TS2339: Property '$queryRaw' does not exist on type 'PrismaRepository'.

19         const [result] = await this.prisma.$queryRaw<
                                              ~~~~~~~~~

src/user/user.service.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

2 import { Prisma } from '@prisma/client';
           ~~~~~~

[12:34:55 PM] Found 32 errors. Watching for file changes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.