Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

antoniojps/votos-client

Repository files navigation

Portuguese politics made easy.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • Node

Installing

  1. Clone
git clone https://github.com/antoniojps/votos-client.git
  1. Install dependencies
cd votos-client
yarn install
  1. Start developing
yarn start

Your site is now running at http://localhost:8000!

Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

Developing new components

Atomic design

The components structure follows Atomic Design:

  • Atoms: elements, buttons, inputs
  • Molecules: cards, the combination of atoms
  • Organisms: sections of a page, the combination of molecules

Develop in isolation

Storybook is used to build components in isolation and document behaviors for potential reuse through storybook stories.

A molecule or organism that possibly recieves data through an asynchronous request should always consider the three stories:

  • Loading
  • Error
  • Default

Other stories are created to demonstrate modifiers (props that modify the component).

Run storybook:

yarn storybook

Here's an example components folders struture:

components
└───atoms
│   └───Button
│       │   Button.js
│       │   Button.stories.js
└───molecules
│   └───Card
│       │   Card.js
│       │   Card.stories.js
└───organisms
│   └───Nav
│       │   Nav.js
│       │   Nav.stories.js

Deployment

To understand how to deploy the website read the Gatsby documentation: Deploying and Hosting.

yarn build

Start the production server

yarn serve

Built With

  • React - A JavaScript library for building user interfaces
  • Gatsby - React-based, GraphQL powered, static site generator.
  • styled-components - CSS in JS for React.
  • Storybook - Tool for developing UI components in isolation for React, Vue, and Angular.

Authors

About

Plataforma Online da Democracia Portuguesa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published