Skip to content

Commit

Permalink
Merge pull request #173 from fdhhhdjd/developer
Browse files Browse the repository at this point in the history
#172 [Devops] Setup Frontend CMS
  • Loading branch information
fdhhhdjd authored Mar 3, 2023
2 parents 81d68b8 + 530d9eb commit a62d4d1
Show file tree
Hide file tree
Showing 106 changed files with 43,966 additions and 0 deletions.
19 changes: 19 additions & 0 deletions frontend-manager-cms/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# git
.git

# Forder run code
node_modules

# Docker
Dockerfile
.dockerignore

# File unit test
./src/tests

# Fotmatcode
.editorconfig
.eslintignore
.eslintrc
.prettierignore
.prettierrc
14 changes: 14 additions & 0 deletions frontend-manager-cms/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
30 changes: 30 additions & 0 deletions frontend-manager-cms/.env.xample
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
################## SETTING MAIN ###################
REACT_APP_API_URL=REACT_APP_API_URL

NODE_ENV=NODE_ENV

REACT_APP_KEY_FACEBOOK=REACT_APP_KEY_FACEBOOK
REACT_APP_KEY_FACEBOOK_TEST=REACT_APP_KEY_FACEBOOK_TEST

REACT_APP_KEY_GOOGLE=REACT_APP_KEY_GOOGLE

REACT_APP_KEY_RECAPTCHA=REACT_APP_KEY_RECAPTCHA

REACT_APP_KEY_RECAPTCHA_V3=REACT_APP_KEY_RECAPTCHA_V3

REACT_APP_KEY_GOOGLE_MAP=REACT_APP_KEY_GOOGLE_MAP

REACT_APP_KEY_GOOGLE_MAP_MAIN=REACT_APP_KEY_GOOGLE_MAP_MAIN

REACT_APP_GOOGLE_LAT=REACT_APP_GOOGLE_LAT
REACT_APP_GOOGLE_LNG=REACT_APP_GOOGLE_LNG


################## Config Firebase ###################
REACT_APP_API_KEY=REACT_APP_API_KEY
REACT_APP_AUTH_DOMAIN=REACT_APP_AUTH_DOMAIN
REACT_APP_DATA_BASE_URL=REACT_APP_DATA_BASE_UR
REACT_APP_PROJECT_ID=REACT_APP_PROJECT_ID
REACT_APP_STORAGE_BUCKET=REACT_APP_STORAGE_BUCKET
REACT_APP_MESSAGING_SENDER_ID=REACT_APP_MESSAGING_SENDER_ID
REACT_APP_APP_ID=REACT_APP_APP_ID
5 changes: 5 additions & 0 deletions frontend-manager-cms/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/*.js
src/assets
src/main.js
public
dist
35 changes: 35 additions & 0 deletions frontend-manager-cms/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"extends": ["react-app", "react-app/jest", "prettier"],
"plugins": ["react", "eslint-plugin-prettier", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"js": true,
"modules": true
}
},
"rules": {
"prettier/prettier": [
"warn",
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
]
}
}
11 changes: 11 additions & 0 deletions frontend-manager-cms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Forder run code
node_modules

# Environment
.env

# Build source
build

# husky
.husky
3 changes: 3 additions & 0 deletions frontend-manager-cms/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package.json
package-lock.json
build
20 changes: 20 additions & 0 deletions frontend-manager-cms/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"endOfLine": "auto"
}
14 changes: 14 additions & 0 deletions frontend-manager-cms/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### STAGE 1: Build ###
FROM node:14-alpine as builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

### STAGE 2: Production Environment ###
FROM nginx:1.9.15-alpine
COPY --from=builder /app/build /usr/share/nginx/html
COPY --from=builder /app/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]
13 changes: 13 additions & 0 deletions frontend-manager-cms/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3001

CMD [ "npm", "start" ]
21 changes: 21 additions & 0 deletions frontend-manager-cms/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Nguyễn Tiến Tài

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 12 additions & 0 deletions frontend-manager-cms/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"baseUrl": "./src",
"paths": {
"./*": ["src/*"]
}
},
"include": ["src/**/*", "tests"],
"exclude": ["node_modules", "build"]
}
7 changes: 7 additions & 0 deletions frontend-manager-cms/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Run Frontend dev
run-dev:
npm run dev

# Run Production
run-product:
npm start
9 changes: 9 additions & 0 deletions frontend-manager-cms/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server{
listen 3000;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
Loading

0 comments on commit a62d4d1

Please sign in to comment.