GithubHelp home page GithubHelp logo

kleopatra999 / advocacy.mozilla.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/advocacy.mozilla.org

0.0 2.0 0.0 44.64 MB

Home Page: https://advocacy.mozilla.org

License: Mozilla Public License 2.0

JavaScript 78.09% CSS 21.91%

advocacy.mozilla.org's Introduction

Overview

This is the repository for https://advocacy.mozilla.org

As of April 2016, there are three parts to the site.

Homepage and Open Web Fellows are an index.html file statically generated by a server at build time. This single index page then renders the requested page on the client side.

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.

Getting Started

Clone a copy of the repository using something like git.

To get a local version of the site running, you'll need node 4 or higher installed on your local machine.

Build

To start local development, install and run the following commands:

$ cp sample.env .env
$ npm install
$ npm start

Develop Workflow

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

Sitemap

/ -> /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

Source Structure

Running 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/components/ and /src/pages/. Components are shared UI elements, like header and footer used to build pages.

We have an npm script that uses babel to compile the contents of /src from es6 to /dist as es5. These are built to run on the server and client.

We use webpack to package our client side files into /public, which is handled in webpack.config.js

We use react-router to handle the site structure, which live in /src/avocacy-main.js and /src/encrypt-main.js.

We use node version 4 or higher to run our server, which is handled in app.js.

"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/encrypt-main.js and /src/lib/react-server-rooute.js to handle server side rendering.

advocacy.mozilla.org's People

Contributors

scottdowne avatar alanmoo avatar alicoding avatar mmmavis avatar theochevalier avatar mozilla-pontoon avatar andreitarkovski avatar jbuck avatar koehlermichael avatar mikkcz avatar vasimi avatar avelper avatar treecycles avatar stoyandimitrov avatar simonwex avatar fauzanalfi avatar vesper-mozilla avatar hpauljohnson avatar kitsunenosarat avatar satdav avatar mathjazz avatar tonnesm avatar bychekru avatar valianttry avatar piotrdrag avatar archaeopteryx avatar unghost avatar flukeout avatar melechuga avatar mozinet-fr avatar

Watchers

rosa maria palacios juncosa avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.