You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-13
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
</p>
9
9
10
10
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.
*Server.js* is the entry point. It uses Express and passes requests to Next. Next SSR renders the pages using ```getInitialProps()``` hook from Apollo helper. Therefore the app makes GraphQL requests on the client or server.
75
+
_Server.js_ is the entry point. It uses Express and passes requests to Next. Next SSR renders the pages using `getInitialProps()` hook from Apollo helper. Therefore the app makes GraphQL requests on the client or server.
72
76
73
-
When the client receives the page it preloads next page JS designated with ```<Link prefetch href="/">```. When the client navigates to the linked page it only needs to make a GraphQL query to render. *Great!*
77
+
When the client receives the page it preloads next page JS designated with `<Link prefetch href="/">`. When the client navigates to the linked page it only needs to make a GraphQL query to render. _Great!_
74
78
75
79
See more: <ahref="https://github.com/zeit/next.js/">Next.js</a>,
*root* - Only contains config files such as Babel, ESLint, Docker, Flow, NPM, Yarn, Git.
90
+
_root_ - Only contains config files such as Babel, ESLint, Docker, Flow, NPM, Yarn, Git.
87
91
88
92
## How To Start
89
93
@@ -95,7 +99,7 @@ You can download and run the repo with one command to rule them all:
95
99
96
100
### Setup
97
101
98
-
Running the app in dev mode is fully featured including *hot module reloading*:
102
+
Running the app in dev mode is fully featured including _hot module reloading_:
99
103
100
104
`npm install`
101
105
@@ -107,7 +111,7 @@ To run in production mode:
107
111
108
112
### Configuration
109
113
110
-
The project runs out of the box with default settings (*/src/config.js*). 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*.
114
+
The project runs out of the box with default settings (_/src/config.js_). 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_.
111
115
112
116
## How To Test
113
117
@@ -119,23 +123,23 @@ This project uses Jest and can do snapshot testing of React components. Whenever
119
123
120
124
## How To Build For Deployment
121
125
122
-
`npm run build`: NextJS app with entry point *server.js* that uses Node.js/Express. Uses Babel compiler to transpile project src to build.
126
+
`npm run build`: NextJS app with entry point _server.js_ that uses Node.js/Express. Uses Babel compiler to transpile project src to build.
123
127
124
128
OR
125
129
126
130
`npm run build-docker`
127
131
Docker Container: Builds a docker container using Dockerfile.
128
132
129
-
130
133
#### Static Website (Optional)
131
134
132
135
NextJS lets us make a powerful static website but you need to consider if you need server side rendering.
133
136
134
-
`npm run build-static-website`: Builds static website to */build/static*. Use a static web server *eg.* NGINX/Github Pages.
135
-
137
+
`npm run build-static-website`: Builds static website to _/build/static_. Use a static web server _eg._ NGINX/Github Pages.
136
138
137
139
## Contributing
140
+
138
141
Pull requests are welcome. File an issue for ideas, conversation or feedback.
139
142
140
143
### Community
144
+
141
145
After you ★Star this project, follow [@ClintonDAnnolfo](https://twitter.com/clintondannolfo) on Twitter.
0 commit comments