Skip to content

Commit 37a462f

Browse files
committed
git test init
0 parents  commit 37a462f

File tree

187 files changed

+31777
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+31777
-0
lines changed

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PORT=8090
2+
NODE_ENV=dev
3+
APP="LTM"
4+
IS_STORYBOOK=true
5+
ENABLE_SOCKETS=false

.eslintrc

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"parser": "babel-eslint",
3+
"root": true,
4+
"extends": [
5+
"airbnb",
6+
"prettier",
7+
"prettier/babel",
8+
"prettier/react",
9+
"plugin:react/recommended"
10+
],
11+
"parserOptions": {
12+
"ecmaVersion": 6,
13+
"ecmaFeatures": {
14+
"jsx": true
15+
}
16+
},
17+
"plugins": [
18+
"prettier",
19+
"react-hooks"
20+
],
21+
"env": {
22+
"browser": true,
23+
"node": true,
24+
"mocha": true,
25+
"es6": true
26+
},
27+
"globals": {
28+
"IS_PROD": true,
29+
"STRIPE_PUBLIC_KEY": true,
30+
"SENTRY_CLIENT_URL": true,
31+
"deferredPrompt": true,
32+
"axios": true,
33+
"globalThis": true,
34+
"ENABLE_SOCKETS": true
35+
},
36+
"rules": {
37+
"prettier/prettier": ["warn"],
38+
"space-before-function-paren": "off",
39+
"react/prefer-stateless-function": "warn",
40+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
41+
"jsx-a11y/anchor-is-valid": "off",
42+
"jsx-a11y/label-has-for": [ 2, {
43+
"required": {
44+
"every": [ "id" ]
45+
}
46+
}],
47+
"jsx-a11y/label-has-associated-control": [ 2, {
48+
"labelComponents": ["CustomInputLabel"],
49+
"labelAttributes": ["label"],
50+
"controlComponents": ["CustomInput"],
51+
"depth": 3
52+
}],
53+
"max-len": ["warn", {
54+
"ignoreComments": true,
55+
"ignoreStrings": true,
56+
"code": 240
57+
}],
58+
"react/jsx-uses-react": 1,
59+
"react/sort-comp": "off",
60+
"import/no-cycle": "off",
61+
"react/prop-types": "off",
62+
"linebreak-style": "off",
63+
"global-require": "off",
64+
"semi": "off",
65+
"arrow-body-style": "off",
66+
"comma-dangle": "off",
67+
"class-methods-use-this": "off",
68+
"quote-props": "off",
69+
"no-underscore-dangle": ["error", { "allow": ["__REDUX_DEVTOOLS_EXTENSION__", "_id", "_doc"] }],
70+
"react/destructuring-assignment": "off",
71+
"react/jsx-wrap-multilines": "off",
72+
"react/jsx-one-expression-per-line": "off",
73+
"react-hooks/rules-of-hooks": "error",
74+
"react-hooks/exhaustive-deps": "warn",
75+
"react/no-array-index-key": "warn",
76+
"jsx-a11y/control-has-associated-label": "warn",
77+
"jsx-a11y/no-autofocus": "warn",
78+
"max-classes-per-file": "warn",
79+
"react/jsx-props-no-spreading": ["off"],
80+
"camelcase": "off"
81+
82+
}
83+
}

.gitignore

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
4+
5+
*.iml
6+
7+
## Directory-based project format:
8+
.idea/
9+
# if you remove the above rule, at least ignore the following:
10+
11+
# User-specific stuff:
12+
# .idea/workspace.xml
13+
# .idea/tasks.xml
14+
# .idea/dictionaries
15+
16+
# Sensitive or high-churn files:
17+
# .idea/dataSources.ids
18+
# .idea/dataSources.xml
19+
# .idea/sqlDataSources.xml
20+
# .idea/dynamic.xml
21+
# .idea/uiDesigner.xml
22+
23+
# Gradle:
24+
# .idea/gradle.xml
25+
# .idea/libraries
26+
27+
# Mongo Explorer plugin:
28+
# .idea/mongoSettings.xml
29+
30+
## File-based project format:
31+
*.ipr
32+
*.iws
33+
34+
## Plugin-specific files:
35+
36+
# IntelliJ
37+
/out/
38+
39+
# mpeltonen/sbt-idea plugin
40+
.idea_modules/
41+
42+
# JIRA plugin
43+
atlassian-ide-plugin.xml
44+
45+
# Crashlytics plugin (for Android Studio and IntelliJ)
46+
com_crashlytics_export_strings.xml
47+
crashlytics.properties
48+
crashlytics-build.properties
49+
50+
# NodeJS modules folder
51+
node_modules
52+
53+
# npm debug log
54+
npm-debug.log
55+
56+
# vs code
57+
.vscode
58+
59+
# coverage
60+
61+
/coverage
62+
/_build
63+
.env
64+
dist
65+
.DS_Store
66+
*/.DS_Store
67+
yarn-error.log
68+
*.csv

.gitlab-ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
variables:
2+
REVIEW_HOST: ${CI_COMMIT_REF_SLUG}.${PROJECT_PREFIX}
3+
DOCKER_NODE: TEST_mrtolerantru_node
4+
stages:
5+
- test
6+
- run
7+
- prod
8+
9+
Test:
10+
stage: test
11+
script:
12+
- docker-compose -f docker/PROD.docker-compose.yml build --compress --parallel
13+
- docker-compose -f docker/PROD.docker-compose.yml run node yarn test
14+
- docker-compose -f docker/PROD.docker-compose.yml rm -f -s -v
15+
tags:
16+
- bash
17+
only:
18+
- merge_requests
19+
20+
Build&Run:
21+
stage: run
22+
script:
23+
- docker-compose -f docker/PROD.docker-compose.yml -p ${CI_COMMIT_REF_SLUG}_${PROJECT_PREFIX} up -d --build
24+
tags:
25+
- bash
26+
only:
27+
- develop
28+
- master
29+
30+
# Prod:
31+
# stage: prod
32+
# script:
33+
# docker-compose -f docker/docker-compose-production.yml -p ${CI_COMMIT_REF_SLUG}_${PROJECT_PREFIX} up -d --build
34+
# tags:
35+
# - bash
36+
# only:
37+
# - production

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"trailingComma": "none",
4+
"tabWidth": 2,
5+
"semi": false,
6+
"singleQuote": true,
7+
"parser": "babel",
8+
"arrowParens": "always"
9+
}

.storybook/addons.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import '@storybook/addon-viewport/register'
2+
import '@storybook/addon-actions/register'
3+
import '@storybook/addon-knobs/register'

.storybook/config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { configure, addDecorator, addParameters } from '@storybook/react'
2+
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
3+
import { withInfo } from '@storybook/addon-info'
4+
import '../client/assets/scss/main.scss'
5+
6+
7+
addDecorator(withInfo)
8+
9+
addParameters({ viewport: { viewports: INITIAL_VIEWPORTS } })
10+
11+
configure(require.context('../stories', true, /\.stories\.js$/), module)

.storybook/preview-head.html

Whitespace-only changes.

.storybook/webpack.config.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const path = require('path')
2+
const custom = require('../webpack.development.config.js')
3+
4+
module.exports = async ({ config, mode }) => {
5+
config.module.rules.push({
6+
test: /\.css$/,
7+
use: [
8+
{
9+
loader: 'postcss-loader',
10+
options: {
11+
ident: 'postcss',
12+
plugins: [require('postcss-import'), require('tailwindcss'), require('autoprefixer')]
13+
}
14+
}
15+
],
16+
include: path.resolve(__dirname, '../')
17+
})
18+
return {
19+
...config,
20+
module: { ...config.module, rules: custom.module.rules },
21+
plugins: config.plugins.concat(custom.plugins)
22+
}
23+
}

README.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# React Redux boilerplate
2+
3+
## Quick start
4+
5+
1. To install dependencies and clean the git repo run:
6+
7+
```shell
8+
$ yarn install
9+
```
10+
11+
*We recommend using `yarn` for installing packages, but you can use `npm` instead*:
12+
13+
```shell
14+
$ npm install
15+
```
16+
2. Create first build
17+
18+
```shell
19+
$ yarn run build:prod
20+
```
21+
3. Copy .env.example file to .env and make the necessary changes there
22+
23+
4. Run project in Dev mode
24+
25+
```shell
26+
$ yarn run dev
27+
```
28+
29+
## Features
30+
31+
* Redux
32+
* Modern ES6 for using template strings, JSX syntax, object destructuring arrow functions and more
33+
* Babel for old browser support
34+
* SASS/SCSS: make styles greate again, with no tears
35+
* React Router
36+
* Hot Module Replacement for comfortable development
37+
38+
## Project Structure
39+
40+
#### `client/`
41+
42+
You will write your app in this folder. You will spend most of your time in here.
43+
44+
#### `client/components`
45+
46+
This folder contains all your components
47+
48+
#### `dist/assets`
49+
This directory contains compiled project files
50+
51+
#### `webpack.development.config.js` `and webpack.production.frontend.config.js`
52+
Project environment configs. Webpack uses proper config depending on defined application environment.
53+
By default `webpack.development.config.js` is used unless you build the application with --config webpack.production.frontend.config.js variable.
54+
55+
56+
## Command Line Commands
57+
58+
#### Installation
59+
60+
```Shell
61+
yarn install
62+
```
63+
Installs the dependencies.
64+
65+
#### Development
66+
67+
```Shell
68+
yarn run dev
69+
```
70+
71+
Starts the development server running on `http://localhost:8080` using the webpack.development.config.js with Hot Module Replacement (HMR) (Changes in the application code will be hot-reloaded)
72+
73+
```Shell
74+
yarn run dev:server
75+
```
76+
77+
Starts the development server and makes your application accessible at http://localhost:8080.
78+
79+
```Shell
80+
yarn run clean
81+
```
82+
Removes a directory "dist" from a project
83+
84+
#### Building
85+
86+
```Shell
87+
yarn build:prod
88+
```
89+
90+
Prepares your app for deployment to production environment (using the webpack.production.frontend.config.js) (does not run tests). Optimizes and minifies all files, piping them to the `dist` folder.
91+
92+
93+
#### Testing
94+
95+
```Shell
96+
yarn run test
97+
```
98+
99+
Tests your application modern JavaScript Testing Framework - Jest with the unit tests specified in the `**/__tests__/*.spec.js` files
100+
throughout the application.
101+
102+
```Shell
103+
yarn run test:watch
104+
```
105+
106+
Watches changes to your application and re-runs tests whenever a file changes.
107+
108+
```Shell
109+
yarn run coverage
110+
```
111+
112+
Generates test coverage.
113+
114+
115+
It’s also possible to leave out the run in this command, each script can be executed with its name, e.g:
116+
yarn test:watch
117+
yarn test:coverage
118+
119+
#### Linting
120+
121+
```Shell
122+
yarn run lint
123+
```
124+
Will analyse your code for potential errors. Will check both: `./client/**/**.js` and `./server/**/**.js` files.
125+
Code linting is a type of static analysis that is frequently used to find problematic patterns or code that doesn’t adhere to certain style guidelines.
126+
127+
128+
```Shell
129+
yarn run lint:server
130+
```
131+
132+
Will analyse only `server/**/**.js` files
133+
134+
#### Docker
135+
Nginx web server working on 443, 80 ports on localhost
136+
137+
```run production
138+
docker-compose -f .\docker\PROD.docker-compose.yml up (Options: --build for build, -d to detach )
139+
docker-compose -f .\docker\PROD.docker-compose.yml down (To stop contaiters)
140+
```
141+
```run develop
142+
docker-compose -f .\docker\DEV.docker-compose.yml up (Options: --build for build, -d to detach )
143+
docker-compose -f .\docker\DEV.docker-compose.yml down (To stop contaiters)
144+
```

0 commit comments

Comments
 (0)