Skip to content

Commit 212a5a6

Browse files
completed for project structure
0 parents  commit 212a5a6

File tree

107 files changed

+16574
-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.

107 files changed

+16574
-0
lines changed

.env.development

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NODE_ENV=development
2+
API_SERVER_URL=http://localhost:3000
3+
PORT=3000

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
build

.eslintrc.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
jest: true,
7+
},
8+
extends: [
9+
'eslint:recommended',
10+
'plugin:react/recommended',
11+
'plugin:@typescript-eslint/recommended',
12+
],
13+
parser: '@typescript-eslint/parser',
14+
parserOptions: {
15+
ecmaFeatures: {
16+
jsx: true,
17+
},
18+
ecmaVersion: 12,
19+
sourceType: 'module',
20+
},
21+
plugins: ['react', 'react-hooks', '@typescript-eslint'],
22+
rules: {
23+
'react/jsx-closing-bracket-location': 'warn',
24+
'react/jsx-tag-spacing': 'off',
25+
'array-bracket-spacing': [0, 'never'],
26+
'react/prop-types': 'off',
27+
'prefer-const': 'warn',
28+
'jsx-quotes': ['error', 'prefer-double'],
29+
'no-console': 'off',
30+
'react-hooks/rules-of-hooks': 'error',
31+
'react-hooks/exhaustive-deps': 'warn',
32+
'no-useless-escape': 'off',
33+
// unknown is I don't know; any is I don't care
34+
'@typescript-eslint/no-explicit-any': ['off', { ignoreRestArgs: true }],
35+
'@typescript-eslint/no-var-requires': 0,
36+
'@typescript-eslint/ban-types': ['off'],
37+
},
38+
// Fix warning https://github.com/yannickcr/eslint-plugin-react#configuration
39+
settings: {
40+
react: {
41+
createClass: 'createReactClass', // Regex for Component Factory to use,
42+
// default to "createReactClass"
43+
pragma: 'React', // Pragma to use, default to "React"
44+
fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment"
45+
version: 'detect', // React version. "detect" automatically picks the version you have installed.
46+
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
47+
// default to latest and warns if missing
48+
// It will default to "detect" in the future
49+
flowVersion: '0.53', // Flow version
50+
},
51+
propWrapperFunctions: [
52+
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
53+
'forbidExtraProps',
54+
{ property: 'freeze', object: 'Object' },
55+
{ property: 'myFavoriteWrapper' },
56+
],
57+
linkComponents: [
58+
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
59+
'Hyperlink',
60+
{ name: 'Link', linkAttribute: 'to' },
61+
],
62+
},
63+
};

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Frontend
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# configuration
5+
.env
6+
.husky
7+
8+
# build
9+
/build
10+
/dist
11+
12+
# dependencies
13+
/node_modules
14+
15+
# misc
16+
.DS_Store
17+
.DS_STORE
18+
# .env.local
19+
# .env.development.local
20+
# .env.test.local
21+
# .env.production.local
22+
23+
# Log
24+
logs
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
# package-lock.json
30+
31+
32+
# dotenv environment variables file
33+
.env
34+
.env.production

.huskyinstall

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
const { spawn } = require('child_process')
4+
5+
function removeDir(_path) {
6+
if (!fs.existsSync(_path)) {
7+
return console.log('Directory path not found.')
8+
}
9+
10+
const files = fs.readdirSync(_path)
11+
12+
if (files.length > 0) {
13+
files.forEach(function(filename) {
14+
if (fs.statSync(_path + '/' + filename).isDirectory()) {
15+
removeDir(_path + '/' + filename)
16+
} else {
17+
fs.unlinkSync(_path + '/' + filename)
18+
}
19+
})
20+
}
21+
22+
fs.rmdirSync(_path)
23+
}
24+
25+
const huskyDir = path.join(__dirname, '.husky')
26+
removeDir(huskyDir)
27+
28+
29+
/**
30+
* To fix windows error
31+
*/
32+
const appAlias = app => /^win/.test(process.platform) ? `${app}.cmd` : app
33+
34+
const scripts = [
35+
[ appAlias('npx'), [ 'husky', 'install' ] ],
36+
[ appAlias('npx'), [ 'husky', 'add', '.husky/pre-commit', 'npx lint-staged' ] ],
37+
// [ appAlias('npx'), [ 'husky', 'add', '.husky/pre-push', 'npm run test' ] ],
38+
]
39+
40+
const runCMD = (cmd, options) => new Promise((resolve, reject) => {
41+
const output = [ `Execute: ${cmd} ${options.join(' ')}` ]
42+
const execCMD = spawn(cmd, options)
43+
44+
execCMD.stdout.on('data', data => output.push(data))
45+
execCMD.stderr.on('data', data => output.push(data))
46+
47+
execCMD.on('error', error => {
48+
return reject(error)
49+
})
50+
51+
execCMD.on('close', code => {
52+
if (code) {
53+
return reject(new Error(output.join('\n').replace(/[\n]{2,}/gm, '\n')))
54+
}
55+
return resolve(output.join('\n').replace(/[\n]{2,}/gm, '\n'))
56+
})
57+
})
58+
59+
async function run () {
60+
for (const script of scripts) {
61+
try {
62+
console.log(`====================================================`)
63+
const message = await runCMD(...script)
64+
console.log(message)
65+
} catch (error) {
66+
console.log(error)
67+
}
68+
}
69+
}
70+
71+
run()

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
node_modules/
3+
package-lock.json
4+
yarn.lock

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"arrowParens": "avoid"
9+
}

.vscode/settings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"cSpell.words": [
3+
"eslintignore",
4+
"huskyinstall",
5+
"prettierignore",
6+
"toastify",
7+
"todos"
8+
]
9+
}

LICENSE

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

0 commit comments

Comments
 (0)