-
Notifications
You must be signed in to change notification settings - Fork 357
Page Structure & How to add new page
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
.
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
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:
- https://github.com/jedireza/aqua/blob/master/client/pages/account/Routes.jsx
- https://github.com/jedireza/aqua/blob/master/client/pages/admin/Routes.jsx
- https://github.com/jedireza/aqua/blob/master/client/pages/login/Routes.jsx
So on the server, we only need to render the main payload and the client takes over once we render in the browser.