Skip to content

Commit

Permalink
Adds a web project to the monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Feb 9, 2019
1 parent 1f6db24 commit e3b7d01
Show file tree
Hide file tree
Showing 80 changed files with 37,519 additions and 0 deletions.
139 changes: 139 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@

# Created by https://www.gitignore.io/api/osx,vim,node,windows,visualstudiocode

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/osx,vim,node,windows,visualstudiocode

### Gatsby ###
public
.cache
20 changes: 20 additions & 0 deletions web/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: node_js
node_js:
- "8.9.1"
os:
- linux
- osx
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
code_climate:
repo_token: ae474865d00b66dab32c385b1799e62a27442b93ea28e655da358d7e0d8587a4
osx_image: xcode8
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-4.8; fi
after_script:
- npm run codeclimate
29 changes: 29 additions & 0 deletions web/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Start a dev server",
"program": "${workspaceRoot}/node_modules/gatsby/dist/bin/cli.js",
"args": [
"develop"
],
"env":{
"REDUX_DEVTOOLS": "true"
}
},
{
"type": "node",
"request": "launch",
"name": "Build a static site",
"program": "${workspaceRoot}/node_modules/gatsby/dist/bin/cli.js",
"args": [
"build"
]
}
]
}
3 changes: 3 additions & 0 deletions web/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"xo.enable": true
}
97 changes: 97 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Gatsby 2.0 starter

[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![Build Status](https://travis-ci.org/fabien0102/gatsby-starter.svg?branch=master)](https://travis-ci.org/fabien0102/gatsby-starter)
[![Build status](https://ci.appveyor.com/api/projects/status/k06pajqcm23lay1s/branch/master?svg=true)](https://ci.appveyor.com/project/fabien0102/gatsby-starter/branch/master)
[![Code Climate](https://codeclimate.com/github/fabien0102/gatsby-starter/badges/gpa.svg)](https://codeclimate.com/github/fabien0102/gatsby-starter)
[![Test Coverage](https://codeclimate.com/github/fabien0102/gatsby-starter/badges/coverage.svg)](https://codeclimate.com/github/fabien0102/gatsby-starter/coverage)

Demo: <https://fabien0102-gatsby-starter.netlify.com/>

Storybook: <https://fabien0102-gatsby-starter.netlify.com/docs/>

Gatsby 2.0 starter for generate awesome static website working with a nice env development.

## Warning

This starter is currently in wip (see progression to #What's inside session).

## Getting started

Install this starter (assuming Gatsby is installed) by running from your CLI:

```bash
$ gatsby new my-website https://github.com/fabien0102/gatsby-starter
```

Run `npm start` (or press `F5` if you are on VSCode) to hot-serve your website on <http://localhost:8000>.

Run `npm run build` to create static site ready to host (`/public`)

## What's inside?

- [ ] Gatsby 2.0 (alpha)
- [x] sharp
- [x] offline support
- [ ] google analytics
- [x] manifest
- [x] typescript
- [x] blog in markdown
- [x] Best practices tools
- [x] [Jest](https://facebook.github.io/jest/) / [Enzyme](http://airbnb.io/enzyme/)
- [x] [Storybook](https://storybooks.js.org/)
- [x] [Typescript](https://www.typescriptlang.org/) / [tslint](https://palantir.github.io/tslint/)
- [x] [xo linter](https://github.com/sindresorhus/xo)
- [x] [Remark-lint](https://github.com/wooorm/remark-lint)
- [x] [Husky](https://github.com/typicode/husky) & [lint-staged](https://github.com/okonet/lint-staged) for autofix each commit
- [x] Travis/AppVeyor config (unix-osx-windows CI)
- [x] Code climate config
- [x] SEO
- [x] [Helmet](https://github.com/nfl/react-helmet)
- [x] [Semantic-ui](http://react.semantic-ui.com) for styling
- [x] Lazyboy tools
- [x] [plop](https://github.com/amwmedia/plop) templates -> `npm run generate`

## Files structure

.
├── data // website data (included into graphQL)
│ ├── author.json // list of blog authors
│ ├── avatars // authors avatars
│ └── blog // all blog data (posts, images)
├── gatsby-config.js // gatsby configuration
├── gatsby-node.js // gatsby node hooks
├── generators // generators (`npm run generate`)
│ ├── blog-post-generator.js // `blog post` generator
│ ├── component-generator.js // `component` generator
│ ├── page-generator.js // `page` generator
│ ├── plopfile.js // generators entry
│ ├── templates // all templates (handlebar notation)
│ └── utils.js // utils scripts for generators
├── package.json
├── public // output folder (in .gitignore)
├── README.md // this file
├── src // sources
│ ├── components // all react components
│ ├── css // styles
│ ├── declarations.d.ts // declarations for no typescript modules/files
│ ├── graphql-types.d.ts // graphql types (`npm run graphql-types`)
│ ├── html.tsx // main html (required)
│ ├── layouts // layouts
│ │ └── default.tsx // default layout (required)
│ ├── pages // all pages
│ └── templates // all templates (used for procedural page creation, see `gatsby-node.js`)
├── tools // miscs tools for dev
│ └── update-post-date.js // update post date hook
├── tsconfig.json // typescript configuration
├── tslint.json // tslint configuration
└── package-lock.json // npm lock file

## Plop generators - `npm run generate`

To avoid any boring copy/paste, this starter-kit have many generators to permit
simple bootstrap of current file pattern (eg. components/pages/blog posts). e.g. to add a new blog post first add the authors to data/authors.json and add authors' images to the data/avatars folder. Next execute 'npm run generate' and select 'Blog post'. Follow the prompts for a new post. Each blog post requires an image be added to the /data/blog/<your new post> folder prior to running 'gatsby develop'.

You can add/delete/modify any generators into `/generators` folder.

Be lazy and have fun!
9 changes: 9 additions & 0 deletions web/data/author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "Fabien BERNARD",
"bio": "JavaScript Developer with ♥ #Craftman #Lean #JS #FRP. Member at @GatsbyJS.",
"avatar": "avatars/fabien0102.jpg",
"twitter": "@fabien0102",
"github": "@fabien0102"
}
]
Binary file added web/data/avatars/fabien0102.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions web/data/blog/2017-04-18--welcoming/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Welcoming
createdDate: '2017-04-18'
updatedDate: '2017-05-06'
author: Fabien BERNARD
tags:
- starter
- gatsby
image: pexels-photo-253092.jpeg
draft: false
---

Welcome to gatsby-starter!

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tristique lacus vitae diam posuere faucibus. In hac habitasse platea dictumst. Ut id arcu non risus tincidunt commodo. Sed felis leo, pharetra non porttitor sodales, sodales dictum tortor. Vivamus vel neque interdum, egestas urna ac, finibus tellus. Morbi et rhoncus ligula, nec volutpat dolor. Cras efficitur ipsum a facilisis laoreet. Duis ut libero eget mi convallis maximus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque blandit sit amet erat vel semper.

Ut egestas nisl in nunc accumsan, et interdum erat finibus. Fusce commodo ex nec imperdiet fermentum. Suspendisse non nulla eu eros rutrum vestibulum. Curabitur sit amet tortor venenatis, efficitur felis non, commodo urna. Aliquam ut auctor risus. Nullam nec felis pellentesque, tincidunt erat ut, aliquam neque. Ut elementum aliquam leo.

Pellentesque sit amet purus a erat tincidunt elementum. Mauris lobortis egestas tellus, vel blandit tortor pellentesque at. Suspendisse potenti. Aenean vehicula, dolor ac interdum fermentum, velit elit fermentum nisi, in hendrerit nisi dolor semper est. Cras ullamcorper eros nec lacus maximus, a tincidunt ipsum feugiat. Quisque dignissim bibendum orci nec vestibulum. Phasellus accumsan eleifend posuere. Aliquam urna neque, auctor id accumsan nec, viverra vel tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sagittis libero ut porttitor lobortis. Nam nec felis tellus. Praesent ipsum ipsum, consectetur non hendrerit non, egestas et felis.

Donec pretium facilisis orci, vitae blandit ex gravida a. Etiam a augue urna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce finibus urna lectus, eu iaculis massa tempus non. Maecenas in lectus massa. In ut ipsum eleifend, condimentum libero ut, ultricies massa. Integer viverra fringilla sem. Mauris nulla mi, accumsan sed hendrerit ut, tincidunt quis neque. Nullam egestas sem neque, id porta nunc sagittis quis.

Morbi libero sem, molestie nec volutpat ac, volutpat eget dui. Phasellus ante turpis, blandit accumsan facilisis volutpat, bibendum vehicula metus. Fusce pellentesque orci ac imperdiet vestibulum. Aenean aliquam et elit sit amet eleifend. Vivamus libero lacus, porta quis neque a, tincidunt cursus lorem. Nulla placerat gravida nulla, in vestibulum risus lobortis ut. Proin sit amet varius arcu. Sed tincidunt vitae lectus vitae pretium. Fusce malesuada nec diam blandit pharetra. Vivamus fringilla elit ut odio sollicitudin, a convallis nulla dictum. Proin porta nisi eu cursus hendrerit. Donec vel tortor at magna maximus placerat gravida nec ligula.

```javascript
const plop = "coucou";
const toto = "tata";
```

coucou `plop` comment tu vas ?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions web/data/blog/2017-05-02--article-1/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: 'Article #1'
createdDate: '2017-05-02'
updatedDate: '2017-05-06'
author: Fabien BERNARD
tags:
- test
image: pexels-photo-59628.jpeg
draft: false
---

My awesome article

## TODO

- [x] Replace image
- [ ] Write an awesome article
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions web/data/blog/2017-05-02--article-2/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: 'Article #2'
createdDate: '2017-05-02'
updatedDate: '2017-05-06'
author: Fabien BERNARD
tags:
- test
image: cup-of-coffee-laptop-office-macbook-89786.jpeg
draft: false
---

My awesome article

## TODO

- [x] Replace image
- [ ] Write an awesome article
9 changes: 9 additions & 0 deletions web/gatsby-browser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from "react";
import { Provider } from "react-redux";

import { store } from "./src/store";

export const wrapRootElement = ({ element }) =>
<Provider store={store} >
{element}
</Provider>;
Loading

0 comments on commit e3b7d01

Please sign in to comment.