@paralect/hive 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -2
- package/starter/.babelrc +3 -0
- package/starter/Dockerfile +17 -8
- package/starter/bin/deploy.sh +5 -0
- package/starter/deploy/api/Chart.yaml +6 -0
- package/starter/deploy/api/staging.yaml +3 -0
- package/starter/deploy/api/templates/deployment.yaml +43 -0
- package/starter/deploy/api/templates/ingress.yaml +26 -0
- package/starter/deploy/api/templates/service.yaml +14 -0
- package/starter/deploy/script/Dockerfile +39 -0
- package/starter/deploy/script/package-lock.json +1499 -0
- package/starter/deploy/script/package.json +12 -0
- package/starter/deploy/script/src/config.js +48 -0
- package/starter/deploy/script/src/index.js +105 -0
- package/starter/deploy/script/src/util.js +19 -0
- package/starter/package-lock.json +3363 -139
- package/starter/package.json +9 -1
- package/starter/src/app-config/index.js +10 -0
- package/starter/src/db.js +13 -3
- package/starter/src/emails/MyEmailComponent.jsx +16 -0
- package/starter/src/emails/dist/MyEmailComponent.js +17 -0
- package/starter/src/helpers/getResourceEndpoints.js +16 -13
- package/starter/src/helpers/getResources.js +2 -1
- package/starter/src/helpers/getSchemas.js +3 -0
- package/starter/src/resources/health/endpoints/get.js +7 -0
- package/starter/src/resources/users/endpoints/getCurrentUser.js +4 -1
- package/starter/src/resources/users/endpoints/getUserProfile.js +3 -2
- package/starter/src/routes/index.js +1 -1
- package/starter/src/services/emailService.js +15 -0
- package/starter/bin/init-project.sh +0 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paralect/hive",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"@koa/multer": "3.0.0",
|
|
15
15
|
"@koa/router": "10.1.1",
|
|
16
16
|
"@paralect/node-mongo": "2.1.1",
|
|
17
|
+
"@react-email/components": "^0.0.20",
|
|
18
|
+
"@react-email/render": "^0.0.16",
|
|
17
19
|
"@sendgrid/mail": "7.6.1",
|
|
18
20
|
"@socket.io/redis-adapter": "7.1.0",
|
|
19
21
|
"@socket.io/redis-emitter": "4.1.1",
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"eslint-config-prettier": "8.5.0",
|
|
27
29
|
"fs-extra": "^11.2.0",
|
|
28
30
|
"handlebars": "4.7.7",
|
|
29
|
-
"joi": "17.
|
|
31
|
+
"joi": "^17.13.3",
|
|
30
32
|
"koa": "2.13.4",
|
|
31
33
|
"koa-bodyparser": "4.3.0",
|
|
32
34
|
"koa-helmet": "6.1.0",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"moment-duration-format": "2.3.2",
|
|
41
43
|
"multer": "1.4.4",
|
|
42
44
|
"node-schedule": "2.1.0",
|
|
45
|
+
"nodemailer": "^6.9.14",
|
|
43
46
|
"nodemon": "2.0.15",
|
|
44
47
|
"prettier": "2.6.2",
|
|
45
48
|
"psl": "1.8.0",
|
package/starter/.babelrc
ADDED
package/starter/Dockerfile
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
FROM
|
|
1
|
+
FROM node:16.13.1-alpine3.13 as base
|
|
2
2
|
RUN apk add --no-cache python3 py3-pip
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
ENV NODE_ENV=production
|
|
5
|
+
ENV APP_ENV=production
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
EXPOSE 3001
|
|
9
|
+
COPY ["./package*.json", "/app/"]
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
RUN npm set progress=false && npm config set depth 0
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
RUN npm set-script prepare ""
|
|
14
|
+
|
|
15
|
+
RUN npm ci --only=production --quiet
|
|
16
|
+
|
|
17
|
+
COPY ./ ./
|
|
18
|
+
|
|
19
|
+
RUN mkdir -p /project/logs
|
|
20
|
+
RUN touch /project/logs/log.txt
|
|
21
|
+
|
|
22
|
+
CMD npm start 2>&1 | tee /project/logs/log.txt
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
kind: Deployment
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ .Values.service }}
|
|
5
|
+
labels:
|
|
6
|
+
app: {{ .Values.service }}
|
|
7
|
+
spec:
|
|
8
|
+
replicas: 1
|
|
9
|
+
selector:
|
|
10
|
+
matchLabels:
|
|
11
|
+
app: {{ .Values.service }}
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels:
|
|
15
|
+
app: {{ .Values.service }}
|
|
16
|
+
spec:
|
|
17
|
+
restartPolicy: Always
|
|
18
|
+
containers:
|
|
19
|
+
- name: {{ .Values.service }}
|
|
20
|
+
image: {{ .Values.containerRegistry }}:{{ .Values.imagesVersion }}
|
|
21
|
+
env:
|
|
22
|
+
- name: PROJECT_ID
|
|
23
|
+
value: {{ .Values.projectId }}
|
|
24
|
+
env:
|
|
25
|
+
- name: MONGODB_URI
|
|
26
|
+
value: {{ .Values.mongoDbUri }}
|
|
27
|
+
imagePullPolicy: Always
|
|
28
|
+
livenessProbe:
|
|
29
|
+
httpGet:
|
|
30
|
+
path: /health
|
|
31
|
+
port: {{ .Values.port }}
|
|
32
|
+
initialDelaySeconds: 300
|
|
33
|
+
periodSeconds: 10
|
|
34
|
+
ports:
|
|
35
|
+
- containerPort: {{ .Values.port }}
|
|
36
|
+
protocol: TCP
|
|
37
|
+
nodeSelector:
|
|
38
|
+
doks.digitalocean.com/node-pool: {{ .Values.nodePool }}
|
|
39
|
+
strategy:
|
|
40
|
+
type: RollingUpdate
|
|
41
|
+
rollingUpdate:
|
|
42
|
+
maxUnavailable: 0
|
|
43
|
+
maxSurge: 1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
kind: Ingress
|
|
2
|
+
apiVersion: networking.k8s.io/v1
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ .Values.service }}
|
|
5
|
+
labels:
|
|
6
|
+
app: {{ .Values.service }}
|
|
7
|
+
annotations:
|
|
8
|
+
nginx.ingress.kubernetes.io/proxy-read-timeout: "180"
|
|
9
|
+
nginx.ingress.kubernetes.io/proxy-body-size: "20m"
|
|
10
|
+
external-dns.alpha.kubernetes.io/hostname: {{ first .Values.domain }}
|
|
11
|
+
external-dns.alpha.kubernetes.io/ttl: "120" #optional
|
|
12
|
+
spec:
|
|
13
|
+
ingressClassName: nginx
|
|
14
|
+
rules:
|
|
15
|
+
{{- range $domain := .Values.domain }}
|
|
16
|
+
- host: {{ $domain }}
|
|
17
|
+
http:
|
|
18
|
+
paths:
|
|
19
|
+
- path: /
|
|
20
|
+
pathType: Prefix
|
|
21
|
+
backend:
|
|
22
|
+
service:
|
|
23
|
+
name: {{ $.Values.service }}
|
|
24
|
+
port:
|
|
25
|
+
number: {{ $.Values.port }}
|
|
26
|
+
{{- end}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
FROM node:16.13.1-alpine3.13
|
|
2
|
+
|
|
3
|
+
RUN apk add docker
|
|
4
|
+
|
|
5
|
+
ARG VCS_REF
|
|
6
|
+
ARG BUILD_DATE
|
|
7
|
+
|
|
8
|
+
# Metadata
|
|
9
|
+
LABEL org.label-schema.vcs-ref=$VCS_REF \
|
|
10
|
+
org.label-schema.name="helm-kubectl" \
|
|
11
|
+
org.label-schema.url="https://hub.docker.com/r/dtzar/helm-kubectl/" \
|
|
12
|
+
org.label-schema.vcs-url="https://github.com/dtzar/helm-kubectl" \
|
|
13
|
+
org.label-schema.build-date=$BUILD_DATE
|
|
14
|
+
|
|
15
|
+
# Note: Latest version of kubectl may be found at:
|
|
16
|
+
# https://github.com/kubernetes/kubernetes/releases
|
|
17
|
+
ENV KUBE_LATEST_VERSION="v1.22.4"
|
|
18
|
+
|
|
19
|
+
# Note: Latest version of helm may be found at:
|
|
20
|
+
# https://github.com/kubernetes/helm/releases
|
|
21
|
+
ENV HELM_VERSION="v3.7.1"
|
|
22
|
+
|
|
23
|
+
RUN apk add --no-cache ca-certificates bash git openssh curl \
|
|
24
|
+
&& wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \
|
|
25
|
+
&& chmod +x /usr/local/bin/kubectl \
|
|
26
|
+
&& wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm \
|
|
27
|
+
&& chmod +x /usr/local/bin/helm
|
|
28
|
+
|
|
29
|
+
WORKDIR /home/node/app
|
|
30
|
+
|
|
31
|
+
ADD ./deploy/script/package.json \
|
|
32
|
+
./deploy/script/package-lock.json \
|
|
33
|
+
./deploy/script/
|
|
34
|
+
|
|
35
|
+
RUN npm i --prefix ./deploy/script --progress=false --no-audit --production
|
|
36
|
+
|
|
37
|
+
ADD ./ ./
|
|
38
|
+
|
|
39
|
+
CMD node ./deploy/script/src/index.js
|