Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

Page Structure & How to add new page

Reza Akhavan edited this page Feb 9, 2017 · 4 revisions

Server

We're using hapi as the web server, so follow the trails in ./server.js, ./server/*. One thing that can be confusing is that we use the glue module to compose the server, see ./manifest.js.

Client

In it's default state, the front-end is essentially 5 single page apps, some with their own routes and some without. You can see this in the webpack configuration.

https://github.com/jedireza/aqua/blob/master/gulp/webpack.js#L16-L20

Client routes

We're using react-router on the front-end. Adding a whole new entry point will require a new server side render see ./server/web/. But adding a page to /login/, /account/ or /admin/ should just require a new entry in the appropriate routes.jsx file.

The SPAs (single page apps) that have multiple routes, have a client-side router:

So on the server, we only need to render the main payload and the client takes over once we render in the browser.