Skip to content

This project is a clone of Hacker News rewritten with universal Javascript, using React and GraphQL.

License

Notifications You must be signed in to change notification settings

olecon17/hackernews-react-graphql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hacker News Clone GitHub stars GitHub followers GitHub issues

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.

Featuring

  • React (UI Framework)
  • GraphQL (Web Data API)
  • Apollo (GraphQL Client)
  • Next.js (Routing, SSR, Hot Module Reloading, Code Splitting, Build tool uses Webpack)
  • Redux (State Management)
  • Node.js (Web Server)
  • Express (Web App Server)
  • Passport.js (Authentication)
  • Babel (JS Transpiling)
  • Flow (Static Types)
  • ESLint (JS Best Practices/Code Highlighting)
  • Jest (Tests)

Benefits

Front End

  • Declarative UI (react)
  • Flux State Management (redux)
  • GraphQL Query Colocation (react-apollo)

Server

  • Universal JS (node & express)
  • Declarative GraphQL Schema (react-tools)
  • 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)

Dev/Test

  • Hot Module Reloading (next)
  • Snapshot Testing (jest)

One Click Download

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 run dev

How To Start

npm install

npm run dev

Configuration

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

How To Test

npm test or npm run test

This project uses Jest as a testing framework. Jest can do snapshot testing of react components. Whenever a component is updated to a functioning up-to-date state, please update the snapshots using npm test -- -u or jest --updateSnapshot.

How To Deploy

If you just want to generate build files: npm run build

npm run deploy

Contributing

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

License

Apache 2.0 License. Copyright © 2017, Clinton D'Annolfo. All rights reserved.

Community

After you ★Star this project, follow @ClintonDAnnolfo on Twitter.

About

This project is a clone of Hacker News rewritten with universal Javascript, using React and GraphQL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.9%
  • CSS 8.1%