Skip to content

Commit 8270945

Browse files
init
1 parent 6145cac commit 8270945

File tree

199 files changed

+25213
-900
lines changed

Some content is hidden

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

199 files changed

+25213
-900
lines changed

.github/workflows/deploy-app.yaml

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
name: CI/CD for apps
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-java-app:
10+
name: Build Java app
11+
runs-on: buildjet-2vcpu-ubuntu-2204-arm
12+
outputs:
13+
job_successful: ${{ steps.job_successful.outputs.job_successful }}
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 2
19+
- name: Check for changes in directory
20+
id: check_changes
21+
run: |
22+
if git diff-tree --name-only --no-commit-id ${{ github.sha }} | grep -q "^backend"; then
23+
echo "changes_made=yes" >> "$GITHUB_ENV"
24+
else
25+
echo "changes_made=no" >> "$GITHUB_ENV"
26+
fi
27+
- name: Set up QEMU
28+
if: ${{env.changes_made == 'yes'}}
29+
uses: docker/setup-qemu-action@v2
30+
with:
31+
platforms: "arm64"
32+
- name: Set up Docker Buildx
33+
if: ${{env.changes_made == 'yes'}}
34+
uses: docker/setup-buildx-action@v2
35+
- name: Login to Docker Container Registry
36+
if: ${{env.changes_made == 'yes'}}
37+
uses: docker/login-action@v2
38+
with:
39+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
40+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
41+
42+
- name: Build and push the Docker image
43+
if: ${{env.changes_made == 'yes'}}
44+
uses: docker/build-push-action@v3
45+
with:
46+
push: true
47+
context: "{{defaultContext}}:backend"
48+
platforms: "linux/arm64"
49+
tags: |
50+
indianbond/easystartup:suggest-feature-backend-latest-arm
51+
indianbond/easystartup:suggest-feature-backend-${{ github.sha }}-arm
52+
- id: job_successful
53+
if: ${{env.changes_made == 'yes'}}
54+
run: echo "job_successful=yes" >> "$GITHUB_OUTPUT"
55+
build-nextjs-app:
56+
name: Build NextJs app
57+
runs-on: buildjet-2vcpu-ubuntu-2204-arm
58+
outputs:
59+
job_successful: ${{ steps.job_successful.outputs.job_successful }}
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v3
63+
with:
64+
fetch-depth: 2
65+
- name: Check for changes in directory
66+
id: check_changes
67+
run: |
68+
if git diff-tree --name-only --no-commit-id ${{ github.sha }} | grep -q "^frontend"; then
69+
echo "changes_made=yes" >> "$GITHUB_ENV"
70+
else
71+
echo "changes_made=no" >> "$GITHUB_ENV"
72+
fi
73+
- name: Set up QEMU
74+
if: ${{env.changes_made == 'yes'}}
75+
uses: docker/setup-qemu-action@v2
76+
with:
77+
platforms: "arm64"
78+
- name: Set up Docker Buildx
79+
if: ${{env.changes_made == 'yes'}}
80+
uses: docker/setup-buildx-action@v2
81+
- name: Login to Docker Container Registry
82+
if: ${{env.changes_made == 'yes'}}
83+
uses: docker/login-action@v2
84+
with:
85+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
86+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
87+
88+
- name: Build and push the Docker image
89+
if: ${{env.changes_made == 'yes'}}
90+
uses: docker/build-push-action@v3
91+
with:
92+
context: "{{defaultContext}}:frontend"
93+
platforms: "linux/arm64"
94+
push: true
95+
tags: |
96+
indianbond/easystartup:suggest-feature-ui-latest-arm
97+
indianbond/easystartup:suggest-feature-ui-${{ github.sha }}-arm
98+
- id: job_successful
99+
if: ${{env.changes_made == 'yes'}}
100+
run: echo "job_successful=yes" >> "$GITHUB_OUTPUT"
101+
build-nextjs-portal:
102+
name: Build NextJs portal
103+
runs-on: buildjet-2vcpu-ubuntu-2204-arm
104+
outputs:
105+
job_successful: ${{ steps.job_successful.outputs.job_successful }}
106+
steps:
107+
- name: Checkout repository
108+
uses: actions/checkout@v3
109+
with:
110+
fetch-depth: 2
111+
- name: Check for changes in directory
112+
id: check_changes
113+
run: |
114+
if git diff-tree --name-only --no-commit-id ${{ github.sha }} | grep -q "^frontend-portal"; then
115+
echo "changes_made=yes" >> "$GITHUB_ENV"
116+
else
117+
echo "changes_made=no" >> "$GITHUB_ENV"
118+
fi
119+
- name: Set up QEMU
120+
if: ${{env.changes_made == 'yes'}}
121+
uses: docker/setup-qemu-action@v2
122+
with:
123+
platforms: "arm64"
124+
- name: Set up Docker Buildx
125+
if: ${{env.changes_made == 'yes'}}
126+
uses: docker/setup-buildx-action@v2
127+
- name: Login to Docker Container Registry
128+
if: ${{env.changes_made == 'yes'}}
129+
uses: docker/login-action@v2
130+
with:
131+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
132+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
133+
134+
- name: Build and push the Docker image
135+
if: ${{env.changes_made == 'yes'}}
136+
uses: docker/build-push-action@v3
137+
with:
138+
context: "{{defaultContext}}:frontend-portal"
139+
platforms: "linux/arm64"
140+
push: true
141+
tags: |
142+
indianbond/easystartup:suggest-feature-ui-portal-latest-arm
143+
indianbond/easystartup:suggest-feature-ui-portal-${{ github.sha }}-arm
144+
- id: job_successful
145+
if: ${{env.changes_made == 'yes'}}
146+
run: echo "job_successful=yes" >> "$GITHUB_OUTPUT"
147+
update-helm-repo-backend:
148+
needs: [build-java-app]
149+
name: Commit new revision in helm repo for java app
150+
if: ${{needs.build-java-app.outputs.job_successful == 'yes'}}
151+
runs-on: ubuntu-latest
152+
steps:
153+
- name: Checkout Helm repo
154+
uses: actions/checkout@v3
155+
with:
156+
repository: "easyStartup-pulse/helm-charts"
157+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }}
158+
- name: Update backend values.yaml
159+
run: |
160+
cd charts/suggest-feature-backend/partition0
161+
sed -i 's|tag: "suggest-feature-backend-.*|tag: "suggest-feature-backend-'${{ github.sha }}'-arm"|' values.yaml
162+
git config --global user.name 'GitHub Actions'
163+
git config --global user.email 'actions@github.com'
164+
git add values.yaml
165+
git commit -m "Update values.yaml"
166+
git push
167+
update-helm-repo-ui:
168+
needs: [build-nextjs-app]
169+
name: Commit new revision in helm repo for ui
170+
if: ${{needs.build-nextjs-app.outputs.job_successful == 'yes'}}
171+
runs-on: ubuntu-latest
172+
steps:
173+
- name: Checkout Helm repo
174+
uses: actions/checkout@v3
175+
with:
176+
repository: "easyStartup-pulse/helm-charts"
177+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }}
178+
- name: Update values.yaml
179+
run: |
180+
cd charts/suggest-feature-ui
181+
sed -i 's|tag: "suggest-feature-ui-.*|tag: "suggest-feature-ui-'${{ github.sha }}'-arm"|' values.yaml
182+
git config --global user.name 'GitHub Actions'
183+
git config --global user.email 'actions@github.com'
184+
git add values.yaml
185+
git commit -m "Update ui values.yaml"
186+
git push
187+
update-helm-repo-ui-portal:
188+
needs: [build-nextjs-portal]
189+
name: Commit new revision in helm repo for frontend-portal
190+
if: ${{needs.build-nextjs-portal.outputs.job_successful == 'yes'}}
191+
runs-on: ubuntu-latest
192+
steps:
193+
- name: Checkout Helm repo
194+
uses: actions/checkout@v3
195+
with:
196+
repository: "easyStartup-pulse/helm-charts"
197+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }}
198+
- name: Update values.yaml
199+
run: |
200+
cd charts/suggest-feature-ui-portal
201+
sed -i 's|tag: "suggest-feature-ui-portal.*|tag: "suggest-feature-ui-portal-'${{ github.sha }}'-arm"|' values.yaml
202+
git config --global user.name 'GitHub Actions'
203+
git config --global user.email 'actions@github.com'
204+
git add values.yaml
205+
git commit -m "Update ui portal values.yaml"
206+
git push

.github/workflows/deploy.yaml renamed to .github/workflows/deploy-landing-page.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,46 @@ jobs:
1515
build:
1616
name: Build Docusaurus
1717
runs-on: ubuntu-latest
18+
outputs:
19+
job_successful: ${{ steps.job_successful.outputs.job_successful }}
1820
steps:
1921
- uses: actions/checkout@v4
2022
with:
2123
fetch-depth: 0
24+
- name: Check for changes in directory
25+
id: check_changes
26+
run: |
27+
if git diff-tree --name-only --no-commit-id ${{ github.sha }} | grep -q "^docs"; then
28+
echo "changes_made=yes" >> "$GITHUB_ENV"
29+
else
30+
echo "changes_made=no" >> "$GITHUB_ENV"
31+
fi
2232
- uses: actions/setup-node@v4
33+
if: ${{env.changes_made == 'yes'}}
2334
with:
2435
node-version: 18
2536
cache: npm
2637
cache-dependency-path: docs/package-lock.json
2738

2839
- name: Install dependencies
40+
if: ${{env.changes_made == 'yes'}}
2941
run: npm ci
3042
- name: Build website
43+
if: ${{env.changes_made == 'yes'}}
3144
run: npm run build
3245

3346
- name: Upload Build Artifact
47+
if: ${{env.changes_made == 'yes'}}
3448
uses: actions/upload-pages-artifact@v3
3549
with:
3650
path: docs/build
37-
51+
- id: job_successful
52+
if: ${{env.changes_made == 'yes'}}
53+
run: echo "job_successful=yes" >> "$GITHUB_OUTPUT"
3854
deploy:
3955
name: Deploy to GitHub Pages
40-
needs: build
56+
needs: [build]
57+
if: ${{needs.build.outputs.job_successful == 'yes'}}
4158

4259
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
4360
permissions:

backend/.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
Create table in markdown
44

5-
| Variable | Description | Default |
6-
| ---------|--------------------------------------------------------------|---------------------------------|
7-
| FROM_EMAIL | Email address to send emails from |
8-
| AWS_ACCESS_KEY | AWS access key to send email |
9-
| AWS_ACCESS_SECRET | AWS access secret to send email |
10-
| AWS_REGION | AWS region to send email | us-east-1 |
11-
| JWT_KEY | JWT key to sign auth tokens | <randomly_generated_on_restart> |
12-
| EMAIL_RATE_LIMIT | Rate limit for sending emails per month to prevent spam cost | 100000 |
5+
| Variable | Description | Default |
6+
|-------------------|-------------------------------------------------------------|---------------------------------|
7+
| MONGO_URL | Mongo Url | mongodb://localhost:27017
8+
| FROM_EMAIL | Email address to send emails from |
9+
| AWS_ACCESS_KEY | AWS access key to send email |
10+
| AWS_ACCESS_SECRET | AWS access secret to send email |
11+
| AWS_REGION | AWS region to send email | us-east-1 |
12+
| JWT_KEY | JWT key to sign auth tokens | <randomly_generated_on_restart> |
13+
| EMAIL_RATE_LIMIT | Rate limit for sending emails per month to prevent spam cost | 100000 |
14+
15+
# Backend database MonogoDB
16+

backend/build.gradle

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ repositories {
1515
}
1616

1717
application {
18-
mainClassName = 'io.easystartup.suggestfeature.Application'
18+
mainClassName = 'io.easystartup.suggestfeature.Main'
1919
}
2020

2121
bootJar {
22-
mainClass = 'io.easystartup.suggestfeature.Application'
22+
mainClass = 'io.easystartup.suggestfeature.Main'
2323
}
24+
compileJava.options.encoding = 'UTF-8'
2425

2526
dependencies {
2627
implementation group: 'com.amazonaws', name: 'aws-java-sdk-ses', version: '1.12.767'
@@ -33,6 +34,15 @@ dependencies {
3334

3435
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.5.0-M2'
3536
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
37+
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
38+
implementation group: 'commons-io', name: 'commons-io', version: '2.16.1'
39+
implementation group: 'commons-validator', name: 'commons-validator', version: '1.9.0'
40+
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1'
41+
42+
implementation group: 'com.fasterxml.uuid', name: 'java-uuid-generator', version: '5.1.0'
43+
implementation group: 'software.amazon.awssdk', name: 's3', version: '2.27.12'
44+
implementation group: 'software.amazon.awssdk', name: 'auth', version: '2.27.12'
45+
3646

3747
implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0'
3848
implementation group: 'com.google.guava', name: 'guava', version: '33.2.1-jre'
@@ -46,9 +56,17 @@ dependencies {
4656
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '3.3.2'
4757
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jersey', version: '3.3.2'
4858
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '3.3.2'
59+
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '3.3.2'
4960
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '6.3.1'
5061
implementation group: 'org.springframework.security', name: 'spring-security-core', version: '6.3.1'
5162

63+
implementation group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '3.1.8'
64+
implementation group: 'dnsjava', name: 'dnsjava', version: '3.6.1'
65+
implementation group: 'com.github.slugify', name: 'slugify', version: '3.0.7'
66+
// for transliterator of slugify
67+
implementation group: 'com.ibm.icu', name: 'icu4j', version: '75.1'
68+
69+
5270
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
5371
}
5472

0 commit comments

Comments
 (0)