sandbox

πŸ”₯ Leader

Requirements

Bits is built upon Fractal, a tool that enables the rapid development of components, templates and pages. Fractal uses a number of ES6 features, so this project requires Node.js v4.0+ to be installed locally. A global install of Gulp is also recommended.

Installation

To get the project up and running, and view components in the browser, complete the following steps:

  1. Download and install Node: https://nodejs.org/
  2. Clone this repo: git clone git@github.com:24ways/frontend.git (SSH) or git clone https://github.com/24ways/frontend.git (HTTPS)
  3. [Optional] Install Gulp globally: npm install gulp -g
  4. [Optional] Install Fractal globally: npm install fractal -g
  5. Install project dependancies: npm install
  6. Start the development environment: npm start
  7. Open your browser and visit http://localhost:3000

Development

When developing components, you may want assets automatically compiled and the browser to refresh automatically. To do this, run the following task:

  • npm run dev

Creating a static build

To create a static instance of this project, run the following task:

  • npm run build

This will create a folder called www, into which the required files will be created.

Deployment

To make this project publicly accessible, you can deploy a static instance by running the following task:

  • npm run publish

This will publish the contents of public to your gh-pages branch.

Development Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

Repo structure

Sometimes it’s helpful to know what all these different files are for…

/
β”œβ”€ src/
β”‚  β”œβ”€ assets/        # Assets
β”‚  β”‚  β”œβ”€ icons/      # Favicon and home screen icons
β”‚  β”‚  β”œβ”€ images/     # Raster images (used in component examples)
β”‚  β”‚  β”œβ”€ scripts/    # JavaScript files
β”‚  β”‚  β”œβ”€ styles/     # CSS files
β”‚  β”‚  └─ vectors/    # SVG images, icons and logos
|  |
β”‚  β”œβ”€ components/    # Components
β”‚  β”‚  β”œβ”€ _partials/  # …that render component previews
β”‚  β”‚  β”œβ”€ common/     # …that may appear anywhere
β”‚  β”‚  β”œβ”€ global/     # …that appear on every page
β”‚  β”‚  β”œβ”€ layouts/    # …that govern macro layout
β”‚  β”‚  β”œβ”€ scopes/     # …that style undecorated markup
β”‚  β”‚  β”œβ”€ templates/  # …that combine components to render page types
β”‚  β”‚  └─ utilities/  # …that have a single purpose/role
|  |
β”‚  β”œβ”€ docs/          # Documentation
β”‚  β”‚  β”œβ”€ _partials/  # Partials for rendering documentation
β”‚  β”‚  └─ …           # Documentation files
β”‚  β”‚
β”‚  └─ tokens/        # Design tokens
|
β”œβ”€ tmp/              # Files required for dynamic builds (ignored by Git)
β”œβ”€ www/              # Public build (ignored by Git)
β”‚
β”œβ”€ .editorconfig     # Code style definitions
β”œβ”€ .gitignore        # List of files and folders not tracked by Git
β”œβ”€ .eslintrc         # Linting preferences for JavasScript
β”œβ”€ .stylelintrc      # Linting preferences for CSS
β”œβ”€ fractal.js        # Configuration for Fractal
β”œβ”€ gulpfile.js       # Configuration for Gulp tasks
β”œβ”€ LICENSE           # License information for this project
β”œβ”€ package.json      # Project manifest
└─ README.md         # This file

For detailed explanation on how things work, checkout the guide and docs for vue-loader.