Skip to content

Commit a76b21f

Browse files
committed
init commit
0 parents  commit a76b21f

34 files changed

+17871
-0
lines changed

.env.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GOOGLE_ANALYTICS_ID=
2+
SITE_URL=
3+
NOCODB_GRAPHQL_XC_TOKEN=
4+
NOCODB_GRAPHQL_URL=

.eslintignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.github
2+
3+
4+
node_modules
5+
6+
public
7+
8+
__mock__
9+
10+
.cache
11+
12+
coverage
13+
14+
public
15+
16+
stories
17+
18+
loaderShim.js
19+
jest-preprocess.js

.eslintrc.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module.exports = {
2+
globals: {
3+
__PATH_PREFIX__: true,
4+
},
5+
plugins: ['@typescript-eslint', 'react', 'prettier'],
6+
extends: [
7+
'react-app',
8+
'airbnb',
9+
'plugin:prettier/recommended',
10+
'prettier/react',
11+
],
12+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
13+
rules: {
14+
'react/jsx-filename-extension': [0, { extensions: ['.js', '.jsx'] }],
15+
'import/prefer-default-export': 0,
16+
'react/prop-types': 0,
17+
'no-use-before-define': 'off',
18+
'@typescript-eslint/no-use-before-define': ['error'],
19+
'arrow-body-style': 'off',
20+
'import/extensions': [
21+
'error',
22+
'always',
23+
{
24+
ts: 'never',
25+
tsx: 'never',
26+
js: 'never',
27+
jsx: 'never',
28+
},
29+
],
30+
},
31+
32+
settings: {
33+
'import/resolver': {
34+
alias: {
35+
map: [
36+
['components', './src/components'],
37+
['lib', './src/lib'],
38+
['styles', './src/styles'],
39+
['types', './src/types'],
40+
],
41+
extensions: ['.js', '.jsx', '.tsx', '.ts'],
42+
},
43+
},
44+
},
45+
};

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
.cache/
3+
public
4+
5+
.env
6+
.env-*

.lintstagedrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"src/**/*.{js,jsx,ts,tsx}": [
3+
"prettier --write",
4+
"yarn run lint"
5+
]
6+
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
package.json
3+
package-lock.json
4+
public

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "auto",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"trailingComma": "es5"
7+
}

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2021 Wing-Kam Wong, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Gatsby with NocoDB (GraphQL) Boilerplate
2+
3+
This boilerplate is based on [gatsby-template](https://github.com/nandiheath/gatsby-template) originally and further integrated with [NocoDB](https://github.com/nocodb/nocodb) GraphQL.
4+
5+
# Features
6+
7+
- Integrated with NocoDB
8+
- Integrated with i18n (with examples - EN, ZH and KO)
9+
- Integrated with Google Analytics
10+
- Integrated with frameworks such as Material UI, Styled Component & TailwindCSS
11+
- Code Linting
12+
13+
# Prerequisites
14+
15+
- Node.js 12.13.0 or higher
16+
17+
If you have ``nvm``, you can run ``nvm install 12.13.0`` to install and switch to the minimum version
18+
19+
# Getting Started
20+
21+
## Setup .env
22+
23+
```
24+
cp .env.sample .env
25+
# update .env
26+
```
27+
28+
## Run locally
29+
30+
```
31+
npm run dev
32+
```
33+
34+
View ``gatsby-nocodb-boilerplate`` in the browser
35+
36+
```
37+
http://localhost:8000/
38+
```
39+
40+
View GraphiQL
41+
42+
```
43+
http://localhost:8000/___graphql
44+
```
45+
46+
## Build
47+
48+
```
49+
npm run build
50+
```

gatsby-browser.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'styles/global.css';
2+
import React from 'react';
3+
import 'lib/i18n';
4+
import I18nWrapper from 'components/templates/I18nWrapper';
5+
6+
export const wrapPageElement = ({ element, props }) => {
7+
return (
8+
<I18nWrapper path={props.uri} locale={props.pageContext.locale}>
9+
{element}
10+
</I18nWrapper>
11+
);
12+
};

0 commit comments

Comments
 (0)