Skip to content

[pull] master from awesome-graphql-space:master #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
302748f
Update README.md
manjula-dube Aug 13, 2018
4e1186d
Update README.md
manjula-dube Aug 14, 2018
59a2599
updated tweet
juicycleff Aug 15, 2018
1e4edbd
Merge branch 'master' of https://github.com/manjula91/server-nestjs
juicycleff Aug 15, 2018
ffe2732
Update README.md
manjula-dube Aug 15, 2018
36e6230
updated readme
juicycleff Aug 17, 2018
133910e
updated readme
juicycleff Aug 18, 2018
db75c1b
updated readme
juicycleff Aug 18, 2018
18f40a3
Update README.md
manjula-dube Aug 18, 2018
90f9d31
update readme
juicycleff Aug 18, 2018
20888cb
update readme
juicycleff Aug 18, 2018
868ef61
update readme
juicycleff Aug 18, 2018
e617c1b
updated docker file
juicycleff Aug 18, 2018
aa63179
updated prisma
Aug 22, 2018
e725eaf
remove now.json file
manjula-dube Aug 22, 2018
4da7263
Update README.md
manjula-dube Aug 22, 2018
1983679
Update README.md
manjula-dube Aug 22, 2018
9ccf164
with bugs
juicycleff Sep 1, 2018
01a2af0
Update README.md
manjula-dube Sep 1, 2018
b0d3f29
upgrade nest graphql
juicycleff Sep 5, 2018
1cd004d
updated to prisma orm
juicycleff Sep 5, 2018
170a874
first full working upgrade
juicycleff Sep 6, 2018
9063e79
Merge pull request #6 from manjula91/prisma-orm-nestjs
juicycleff Sep 6, 2018
8b1009d
updated readme
juicycleff Sep 6, 2018
a62026e
Merge pull request #7 from manjula91/prisma-orm-nestjs
juicycleff Sep 6, 2018
01c171f
Update README.md
manjula-dube Sep 6, 2018
f7f7d21
Update README.md
manjula-dube Sep 6, 2018
7108586
addd autocompletion
manjula-dube Sep 9, 2018
85bbe6e
add package.json file
manjula-dube Sep 11, 2018
f1a2fed
change the resolvers path
manjula-dube Sep 11, 2018
c25fe8d
update prisma.yml file
manjula-dube Sep 14, 2018
e524064
Add renovate.json
renovate-bot Sep 29, 2018
9d639ef
Merge pull request #8 from awesome-graphql-space/renovate/configure
juicycleff Sep 29, 2018
6498499
Create LICENSE
manjula-dube Sep 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PRISMA_URL="https://eu1.prisma.sh/nest/prisma-test2/dev"
PORT=3000
PRISMA_URL="https://eu1.prisma.sh/nestjs/prisma-test2/dev"
PORT=4000
12 changes: 6 additions & 6 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ projects:
schemaPath: src/schema.graphql
extensions:
endpoints:
default: http://localhost:3000
default: http://localhost:4000/graphql
prisma:
schemaPath: src/generated/prisma.graphql
includes: [
"prisma.graphql",
"datamodel.graphql",
]
extensions:
prisma: database/prisma.yml
prepare-binding:
output: src/generated/prisma.ts
generator: prisma-ts

prisma: prisma/prisma.yml
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:latest
# set our node environment, either development or production
# defaults to production, compose overrides this to development on build and run
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY package.json /usr/src/app/
RUN yarn

COPY . /usr/src/app

EXPOSE 4000
CMD ["yarn", "run", "start:prod"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Awesome GraphQL Space

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

<br />

<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="220" alt="Nest Logo" /></a>
<a href="http://tinypic.com?ref=2istvfk" target="_blank"><img width="220" src="http://i68.tinypic.com/2istvfk.png" border="0" alt="Prisma Logo"></a>
<a href="http://tinypic.com?ref=ojmu13" target="_blank"><img width="190" height="120" src="http://i64.tinypic.com/ojmu13.png" border="0" alt="Apollo Logo"></a>
</p>


<div align="center"><strong>Bootstrap your Nestjs Prisma app within seconds</strong></div>
<div align="center">Comes with prisma api code completion, making writing prisma db queries fun doing</div>
Expand All @@ -18,7 +14,7 @@
* For using Prisma as an end point you should signup to [prisma](https://app.prisma.io/) and deploy your server. If you want to read more about deploying (check out the prisma [docs](https://www.prisma.io/docs/reference/cli-command-reference/database-service/prisma-deploy-kee1iedaov/))
```
PRISMA_URL="PRISMA_URL="https://eu1.prisma.sh/your-workspace/yourendpoint/dev"
PORT=3000
PORT=4000
```
Here is the example of a .graphqlconfig.yml file that specifies that:

Expand All @@ -33,7 +29,7 @@ projects:
schemaPath: src/schema.graphql
extensions:
endpoints:
default: http://localhost:3000
default: http://localhost:4000
prisma:
schemaPath: src/generated/prisma.graphql
extensions:
Expand All @@ -51,10 +47,9 @@ projects:
* Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming). NestJS reduces the process involved in setting up a nodejs server.

* We already have the GraphQLModule in NestJS that is nothing more than a wrapper around the Apollo server. We don't reinvent the wheel but provide a ready to use a module instead, that brings a clean way to play with the GraphQL and Nest together.

#### NestJS Framework is not compatible with Apollo Server 2 as of now, so this was major win for us:)
NestJS Framework has inbuilt support of Apollo Server 2 which is awesome :)

Thanks to [issue](https://github.com/nestjs/graphql/issues/32) that helped us to build the boilerplate the right way :)



## Installation
Expand All @@ -66,14 +61,18 @@ $ npm install
## Setting up prisma

```bash
# install prisma cli
$ npm i prisma -g

# login to prisma cloud
$ prisma login
# login to prisma
$ npm run prisma login

# deploy prisma database
₦ prisma deploy
$ npm run prisma deploy

# generate prisma
$ npm run prisma generate

# generate graphql resolvers from schema.graphql
$ npm run resolver-codegen

```

## Running the app
Expand Down Expand Up @@ -103,8 +102,18 @@ Deploying server on now.sh
* Below is the server endpoint deployed on now

```
https://graphql-boilerplate-server-ykmuuaszoe.now.sh/graphql
https://graphql-boilerplate-server-wqrtiyktjn.now.sh/graphql

```


# Roadmap
+ [x] Authentication (JWT)
+ [O] Authentication (Passport)
+ [O] Authentication (Session)
+ [x] Prisma Graphql
+ [x] Apollo Server 2
+ [x] Realtime subscription
+ [x] Prisma Graphql
+ [O] File upload via rest
+ [O] File upload via graphql
+ [O] Redis support
30 changes: 0 additions & 30 deletions database/docker-compose.yml

This file was deleted.

6 changes: 0 additions & 6 deletions database/prisma.yml

This file was deleted.

7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3"
services:
uniserver:
build:
context: ./
dockerfile: Dockerfile
image: nestjs-demo:latest
Empty file removed now.json
Empty file.
Loading