This is the repository for https://advocacy.mozilla.org
As of April 2016, there are three parts to the site.
Encrypt Campaign doesn't use an html file and nothing is built on the server, instead the server generates the pages as requested and passed to the client. The result page is cached on the server in memory after the first request, so the next request is not generated again.
Clone a copy of the repository using something like git.
To get a local version of the site running, you'll need node 8 or higher installed on your local machine.
To start local development, install and run the following commands:
$ cp sample.env .env $ npm install $ npm start
After successfully building and running the server, go to localhost:8080/
You can now start changing files in the
/src directory, such that saving your changes and refreshing the browser will show your changes.
Files outside of /src require npm start to be rerun
/ -> /src/pages/home.js /encrypt/ -> /src/pages/encrypt/index.js /open-web-fellows/ -> /src/pages/open-web-fellows/overview.js /open-web-fellows/info/ -> /src/pages/open-web-fellows/info.js /open-web-fellows/fellows/ -> /src/pages/open-web-fellows/fellows.js
npm start is the entry point to build our code and run our server. All our npm scripts and npm dependencies are stored in package.json.
Our client side code is written in react and lives in
/src. Our files are organized into two directories,
/src/pages/. Components are shared UI elements, like header and footer used to build pages.
We use webpack to package our client side files into
/public, which is handled in
We use react-router to handle the site structure, which live in
We use node version 8 or higher to run our server, which is handled in
"Encrypt" pages are handled a bit differently from the rest. The standard routes, and source, use
/src/advocacy-main.js for pretty much all the generating and packaging of files, routes, and source. Encrypt uses
/src/encrypt-app.js to package client side files, and uses
/src/lib/react-server-rooute.js to handle server side rendering.