Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

s-hirano-ist/rss-dumper-graphql

Repository files navigation

RSS Dumper GraphQL

Sample Apollo server for studying backend GraphQL server.

More high-level implementation is located here (Sorry for a private repository). Therefore, there will be no updates here.

Tech Stack

Language - TypeScript
Main Framework - Apollo Server
ORM - Prisma
Database - PostgreSQL
GraphQL Schema Definition - GraphQL Nexus
Code Formatting - Prettier
Linting - ESLint

Render settings

Add following environments

POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
NODE_VERSION=18.17.1
PORT=4000

https://render.com/docs/node-version

Build command

pnpm build

Start command

pnpm start

Use docker

docker compose --profile app up -d

🍾 Initial setups

git clone https://github.com/s-hirano-ist/rss-dumper-graphql.git
cd rss-dumper-graphql
docker compose up --build -d
pnpm i
pnpm prisma:dev

API path

/api/graphql: graphQL endpoint

  • Schema of "News" is defined by nexus-prisma (preferred)
  • Schema of "NewsDetail" is defined hardcode

Sample queries

mutation {
  register(
    email: "example@gmail.com"
    password: "PASSWORD"
    name: "Example Taro"
  ) {
    token
  }
}

mutation {
  login(email: "example@gmail.com", password: "PASSWORD") {
    token
  }
}

query Query {
  allNews {
    heading
    description
  }
  me {
    email
    admin
  }
  allUsers {
    email
    id
    name
    admin
  }
}

🪝 Tags & Realease

gh release create --generate-notes

References

https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql-nexus

https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql-auth