https://github.com/jglchen/hackernews-nextjs-graphql-sse
A Hackernews clone site built with next.js implementing GraphQL APIs, for which Apollo Client is adopted in the frontend and GraphQL Yoga in the backend server. Full functionality of the GraphQL server, including queries, mutations, and subscriptions, is implemented in this app.
https://github.com/jglchen/hackernews-nextjs-graphql-sse
apollo-client docker graphql nextjs reactjs typescript
Last synced: 2 months ago
JSON representation
A Hackernews clone site built with next.js implementing GraphQL APIs, for which Apollo Client is adopted in the frontend and GraphQL Yoga in the backend server. Full functionality of the GraphQL server, including queries, mutations, and subscriptions, is implemented in this app.
- Host: GitHub
- URL: https://github.com/jglchen/hackernews-nextjs-graphql-sse
- Owner: jglchen
- Created: 2023-01-12T07:00:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T09:20:33.000Z (about 3 years ago)
- Last Synced: 2025-03-13T20:44:37.075Z (over 1 year ago)
- Topics: apollo-client, docker, graphql, nextjs, reactjs, typescript
- Language: TypeScript
- Homepage:
- Size: 497 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Hackernews Clone Site with GraphQL (includes GraphQL subscriptions)
This is a [Hackernews](https://news.ycombinator.com/) clone site built with next.js implementing GraphQL APIs, for which Apollo Client is adopted in the frontend and GraphQL Yoga in the backend server.
Subscriptions are a GraphQL feature that allows a server to send data to its clients when a specific event happens. Subscriptions are usually implemented with [WebSockets](https://en.wikipedia.org/wiki/WebSocket) or [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events). GraphQL Yoga uses [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) for the subscription protocol.
The real-time communication of subscriptions however was found not to function well once the package is deployed to Vercel, which is a serverless platform. We will not deploy this package to Vercel, however, a dockerized package of this app is prepared.
### Docker: docker run -p 3000:3000 jglchen/hackernews-nextjs-graphql-sse
### [GitHub](https://github.com/jglchen/hackernews-nextjs-graphql-sse)