All Projects β†’ clintonwoo β†’ Hackernews React Graphql

clintonwoo / Hackernews React Graphql

Licence: mit
Hacker News clone rewritten with universal JavaScript, using React and GraphQL.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Hackernews React Graphql

Next Graphql Blog
πŸ–Š A Blog including a server and a client. Server is built with Node, Express & a customized GraphQL-yoga server. Client is built with React, Next js & Apollo client.
Stars: ✭ 152 (-96.42%)
Mutual labels:  graphql, apollo, express, nextjs
Next React Graphql Apollo Hooks
React, Apollo, Next.js, GraphQL, Node.js, TypeScript high performance boilerplate with React hooks GraphQL implementation and automatic static type generation
Stars: ✭ 186 (-95.62%)
Mutual labels:  graphql, apollo, express, nextjs
Apollo Upload Examples
A full stack demo of file uploads via GraphQL mutations using Apollo Server and apollo-upload-client.
Stars: ✭ 358 (-91.56%)
Mutual labels:  graphql, apollo, nextjs
Boilerplate Vue Apollo Graphql Mongodb
Start your magical stack journey!
Stars: ✭ 85 (-98%)
Mutual labels:  graphql, apollo, express
Next Advanced Apollo Starter
Advanced, but minimalistic Next.js pre-configured starter with focus on DX
Stars: ✭ 131 (-96.91%)
Mutual labels:  graphql, apollo, nextjs
Erxes Api
API for erxes
Stars: ✭ 57 (-98.66%)
Mutual labels:  graphql, apollo, express
Next React Graphql Apollo boostrap
React + GraphQL + Next.js project architecture that I play with right now
Stars: ✭ 59 (-98.61%)
Mutual labels:  graphql, apollo, nextjs
React Hipstaplate
A ReactJS full-stack boilerplate based on typescript with ssr, custom apollo-server and huge stack of modern utilities which will help you to start your own project
Stars: ✭ 74 (-98.26%)
Mutual labels:  graphql, apollo, express
Next Apollo Example
Next & Apollo Example
Stars: ✭ 413 (-90.26%)
Mutual labels:  graphql, apollo, nextjs
Ran
⚑ RAN! React . GraphQL . Next.js Toolkit ⚑ - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...
Stars: ✭ 2,128 (-49.83%)
Mutual labels:  graphql, apollo, nextjs
Woo Next
πŸš€ React WooCommerce theme, built with Next JS, Webpack, Babel, Node, Express, using GraphQL and Apollo Client
Stars: ✭ 342 (-91.94%)
Mutual labels:  graphql, express, nextjs
Babel Plugin Import Graphql
Enables import syntax for .graphql and .gql files
Stars: ✭ 284 (-93.31%)
Mutual labels:  graphql, apollo, nextjs
Graphql Upload
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
Stars: ✭ 1,071 (-74.75%)
Mutual labels:  graphql, apollo, express
Apollo Server Vercel
⚫ Production-ready Node.js GraphQL server for Vercel Serverless Functions
Stars: ✭ 69 (-98.37%)
Mutual labels:  graphql, apollo, nextjs
Graphql Apq
🎯 Automatic persisted queries (APQ) for any GraphQL server.
Stars: ✭ 43 (-98.99%)
Mutual labels:  graphql, apollo, express
Crypto Grommet
Crypto and equities app
Stars: ✭ 39 (-99.08%)
Mutual labels:  graphql, apollo, nextjs
Brian Lovin Next
My personal site
Stars: ✭ 522 (-87.69%)
Mutual labels:  graphql, apollo, nextjs
Pizzaql
πŸ• Modern OSS Order Management System for Pizza Restaurants
Stars: ✭ 631 (-85.12%)
Mutual labels:  graphql, apollo, nextjs
Next Apollo Auth
Authentication Boilerplate with Next.js and Apollo GraphQL
Stars: ✭ 159 (-96.25%)
Mutual labels:  graphql, apollo, nextjs
Next Ecommerce
⚑️ Quantum Ecommerce. Made with Next.js | GraphQL | Apollo Server | Apollo Client | SSR
Stars: ✭ 186 (-95.62%)
Mutual labels:  graphql, apollo, nextjs

Hacker News Clone React/GraphQL

GitHub Stars GitHub Followers GitHub Issues GitHub Pull Requests

This project is a clone of hacker news rewritten with universal JavaScript, using React and GraphQL. It is intended to be an example or boilerplate to help you structure your projects using production-ready technologies.

Hacker News Clone Demo

Live Demo

Overview

Featuring

  • React - (UI Framework)

  • GraphQL - (Web Data API)

  • Apollo - (GraphQL Client/Server)

  • Next - (Routing, SSR, Hot Module Reloading, Code Splitting, Build tool uses Webpack)

  • TypeScript - (Static Types)

  • Webpack - (Module Bundler)

  • PostCSS - (CSS Processing)

  • Node.js - (Web Server)

  • Express - (Web App Server)

  • Passport - (Authentication)

  • ESLint - (Coding Best Practices/Code Highlighting)

  • Jest - (Tests)

  • Docker - (Container Deployment)

  • Optional - Yarn or Pnpm Package Manager - (Better Dependencies)

Benefits

Front End

  • Declarative UI - (react)
  • Static Typing (typescript)
  • GraphQL Fragment Colocation - (@apollo/client)
  • Prefetch Page Assets - (next)

Server

  • Universal JS - (node & express)
  • Declarative GraphQL Schema - (apollo-server)
  • GraphQL Query Batching - (apollo-server-express)
  • GraphQL Stored Queries - (apollo-server-express)
  • Easy GraphiQL Include - (apollo-server-express)
  • Local Authentication Strategy - (passport)
  • Server Side Rendering - (next)
  • Code Splitting - (next)
  • Build to Static Website - (next)
  • Container Based Runtime - (docker)

Dev/Test

  • Hot Module Reloading - (next)
  • Snapshot Testing - (jest)
  • GraphQL Playground - (apollo-server-express)
  • Faster Package Install - (pnpm/yarn)
  • JS/TS Best Practices - (eslint)

Architecture Overview

Hacker News Clone Architecture Overview

server.ts is the entry point. It uses Express and passes requests to Next. Next SSR renders the pages using getServerSideProps() hook from Apollo helper. Therefore the app makes GraphQL requests on the client or server.

When the client loads the page it preloads next pages code from any <Link href="https://github.com/">. When the client navigates to the next page it only needs to make one GraphQL query to render. Great!

See more: Next.js, Apollo GraphQL Client

GraphQL: GraphQL-Tools by Apollo or GraphQL docs

Directory Structure

Each web page has a React component in pages. Server code is in server. Shared code that runs on client or server is in src. Do not import from server or pages in src to avoid running code in the wrong environment.

The project root contains config files such as TypeScript, Babel, ESLint, Docker, Flow, NPM, Yarn, Git.

How To Start

One Click Download & Run

You can download and run the repo with one command to rule them all:

git clone https://github.com/clintonwoo/hackernews-react-graphql.git && cd hackernews-react-graphql && npm install && npm start

Setup

Running the app in dev mode is fully featured including hot module reloading:

npm install

npm start

To run in production mode:

npm run build:prod && npm run start:prod

Configuration

The project runs out of the box with default settings (/src/config.ts). You can include a .env file in your project root to configure settings (this is the 'dotenv' npm package). The .env file is included in .gitignore.

How To Test

Jest

npm test

This project uses Jest and can do snapshot testing of React components. Whenever a component is changed, please update the snapshots using npm test -- -u or npx jest --updateSnapshot.

How To Build For Deployment

npm run build:prod: NextJS app with entry point server.ts that uses Node.js/Express. Uses TypeScript compiler to transpile project src to build.

OR

npm run build-docker Docker Container: Builds a docker container using Dockerfile.

Static Website (Optional)

NextJS lets us make a powerful static website but you need to consider if you need server side rendering.

npm run build-static-website: Builds static website to /build/static. Use a static web server eg. NGINX/Github Pages.

Contributing

Pull requests are welcome. File an issue for ideas, conversation or feedback.

Community

After you β˜…Star this project, follow @ClintonDAnnolfo on Twitter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].