Skip to content

Commit f6cfeb6

Browse files
authored
Initial commit
0 parents  commit f6cfeb6

Some content is hidden

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

70 files changed

+9026
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig is awesome: https://editorconfig.org/
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Use unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_size = 2
11+
indent_style = space
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.{md,json}]
19+
insert_final_newline = false
20+
21+
[.*]
22+
insert_final_newline = false

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Description
2+
3+
## Screenshots/Media
4+
5+
## Issues
6+
Closes #
7+
8+
<!-- [Optional]
9+
## Additional Notes
10+
-->
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# client-dev-CD.yml
2+
3+
name: S3 Dev Deploy
4+
on:
5+
push:
6+
branches:
7+
- dev
8+
env:
9+
NODE_ENV: ${{ secrets.NODE_ENV }}
10+
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }}
11+
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }}
12+
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }}
13+
VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }}
14+
VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }}
15+
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }}
16+
VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }}
17+
# …and any additional environment variables
18+
19+
jobs:
20+
run:
21+
runs-on: ubuntu-latest
22+
env:
23+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
24+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@v3
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v3
31+
32+
- name: Install dependencies
33+
uses: borales/actions-yarn@v4
34+
with:
35+
cmd: install
36+
37+
- name: Build
38+
uses: borales/actions-yarn@v4
39+
with:
40+
cmd: build
41+
42+
- name: Deploy
43+
uses: reggionick/s3-deploy@v4
44+
with:
45+
folder: dist
46+
bucket: ${{ secrets.S3_BUCKET }}
47+
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
48+
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
49+
invalidation: /
50+
delete-removed: true
51+
no-cache: true
52+
private: true
53+
files-to-include: ".*/*,*/*,**"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# client-dev-CD.yml
2+
3+
name: S3 Prod Deploy
4+
on:
5+
push:
6+
branches:
7+
- dev
8+
env:
9+
NODE_ENV: ${{ secrets.NODE_ENV }}
10+
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }}
11+
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }}
12+
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }}
13+
VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }}
14+
VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }}
15+
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }}
16+
VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }}
17+
# …and any additional environment variables
18+
19+
jobs:
20+
run:
21+
runs-on: ubuntu-latest
22+
env:
23+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
24+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@v3
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v3
31+
32+
- name: Install dependencies
33+
uses: borales/actions-yarn@v4
34+
with:
35+
cmd: install
36+
37+
- name: Build
38+
uses: borales/actions-yarn@v4
39+
with:
40+
cmd: build
41+
42+
- name: Deploy
43+
uses: reggionick/s3-deploy@v4
44+
with:
45+
folder: dist
46+
bucket: ${{ secrets.S3_BUCKET }}
47+
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
48+
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
49+
invalidation: /
50+
delete-removed: true
51+
no-cache: true
52+
private: true
53+
files-to-include: ".*/*,*/*,**"

.github/workflows/run-checks.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run Checks
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
run-checks:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use Node.js 18
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "18"
20+
cache: "yarn"
21+
22+
- name: Install dependencies
23+
run:
24+
npm exec --workspaces -- npx rimraf node_modules && npx rimraf
25+
node_modules && yarn install --frozen-lockfile
26+
27+
- name: Build React project
28+
run: cd client && yarn run build
29+
30+
- name: Run linter
31+
run: cd client && yarn run lint && cd ../ && cd server && yarn run lint
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# server-dev-CD.yml
2+
3+
name: EC2 Dev Deploy
4+
5+
on:
6+
push:
7+
branches:
8+
- dev
9+
10+
jobs:
11+
Deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Deploy in EC2
17+
env:
18+
PRIVATE_KEY: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
19+
HOSTNAME: ${{ secrets.AWS_EC2_HOSTNAME }}
20+
USER: ${{ secrets.AWS_EC2_USER }}
21+
22+
run: |
23+
echo "$PRIVATE_KEY" > private_key.pem && chmod 600 private_key.pem
24+
ssh -o StrictHostKeyChecking=no -i private_key.pem ${USER}@${HOSTNAME} '
25+
26+
#Now we have got the access of EC2 and we will start the deploy .
27+
cd ~/npo-backend-template &&
28+
git checkout dev &&
29+
git stash &&
30+
git pull origin dev &&
31+
yarn &&
32+
pm2 restart app.js
33+
'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# server-prod-CD.yml
2+
3+
name: EC2 Prod Deploy
4+
5+
on:
6+
push:
7+
branches:
8+
- dev
9+
10+
jobs:
11+
Deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Deploy in EC2
17+
env:
18+
PRIVATE_KEY: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
19+
HOSTNAME: ${{ secrets.AWS_EC2_HOSTNAME }}
20+
USER: ${{ secrets.AWS_EC2_USER }}
21+
22+
run: |
23+
echo "$PRIVATE_KEY" > private_key.pem && chmod 600 private_key.pem
24+
ssh -o StrictHostKeyChecking=no -i private_key.pem ${USER}@${HOSTNAME} '
25+
26+
#Now we have got the access of EC2 and we will start the deploy .
27+
cd ~/npo-backend-template &&
28+
git checkout dev &&
29+
git stash &&
30+
git pull origin dev &&
31+
yarn &&
32+
pm2 restart app.js
33+
'

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#####################################################################################
2+
# Generated
3+
#####################################################################################
4+
5+
## Packages installed by NPM. https://docs.npmjs.com/about-packages-and-modules
6+
node_modules/
7+
8+
## Vitest coverage output. https://vitest.dev/guide/coverage.html
9+
coverage/
10+
11+
## ESLint cache. https://eslint.org/docs/latest/use/command-line-interface#caching
12+
.eslintcache
13+
14+
## Vite build output for React.
15+
build/
16+
17+
## `tsc` output, specified by tsconfig.json
18+
dist/
19+
dist-ssr
20+
21+
## CDK output.
22+
cdk.out/
23+
24+
## Logs.
25+
logs
26+
*.log
27+
npm-debug.log*
28+
yarn-debug.log*
29+
yarn-error.log*
30+
pnpm-debug.log*
31+
lerna-debug.log*
32+
33+
34+
#####################################################################################
35+
# Operating System
36+
#####################################################################################
37+
38+
## MacOS folder settings. https://en.wikipedia.org/wiki/.DS_Store
39+
.DS_Store
40+
41+
## Windows folder icon settings. https://learn.microsoft.com/en-us/windows/win32/shell/how-to-customize-folders-with-desktop-ini#use-a-desktopini-file
42+
Desktop.ini
43+
44+
45+
#####################################################################################
46+
# Development Environment
47+
#####################################################################################
48+
49+
## Private environment variables.
50+
.env
51+
.env.*
52+
!.env.example
53+
54+
## Editor directories and files.
55+
.vscode/*
56+
!.vscode/extensions.json
57+
.idea/*
58+
.DS_Store
59+
*.suo
60+
*.ntvs*
61+
*.njsproj
62+
*.sln
63+
*.sw?
64+
65+
# firebase sdk
66+
firebase-adminsdk.json

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- lint-staged

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/hydrogen

0 commit comments

Comments
 (0)