Skip to content

Commit b58b010

Browse files
Release v1.0.0
2 parents 32e7b2e + c8c2466 commit b58b010

Some content is hidden

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

48 files changed

+10562
-4140
lines changed

.env.example

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ REDIS_DOCKER_URL=redis://redis:6379
99
REDIS_LOCALHOST_URL=redis://localhost:6379
1010

1111
SESSION_SECRET=session-secret
12-
13-
ACCESS_TOKEN_SECRET=example-access-token
14-
REFRESH_TOKEN_SECRET=example-refresh-token
15-
ACCESS_EXPIRES_IN=1m
16-
REFRESH_EXPIRES_IN=180d
12+
SESSION_EXPIRES_IN=180d
1713

1814
RECAPTCHA_SECRET=recaptcha-secret
1915
RECAPTCHA_SITE=recaptcha-site
16+
DISABLE_RECAPTCHA=false
2017

2118
TELWARE_EMAIL=[email protected]
2219
TELWARE_PASSWORD=telware-password
@@ -31,4 +28,10 @@ VERIFICATION_CODE_EXPIRES_IN=10 #minutes
3128
RESET_TOKEN_EXPIRES_IN=10 #minutes
3229

3330
GOOGLE_CLIENT_ID=google-client-id
34-
GOOGLE_CLIENT_SECRET=google-client-secret
31+
GOOGLE_CLIENT_SECRET=google-client-secret
32+
33+
GITHUB_CLIENT_ID=github-client-id
34+
GITHUB_CLIENT_SECRET=githu-client-secret
35+
36+
CROSS_PLATFORM_OAUTH_REDIRECT_URL=telware://telware.online/social-auth-loading
37+
FRONTEND_URL=localhost:5174

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"env": {
33
"es2021": true,
44
"browser": true,
5-
"node": true
5+
"node": true,
6+
"jest": true
67
},
78
"parser": "@typescript-eslint/parser",
89
"parserOptions": {
@@ -11,7 +12,7 @@
1112
"sourceType": "module"
1213
},
1314
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
14-
"plugins": ["node", "prettier"],
15+
"plugins": ["node", "jest", "prettier"],
1516
"rules": {
1617
"prettier/prettier": "off",
1718
"spaced-comment": "off",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Trigger Jenkins Job
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
types: [closed]
10+
branches:
11+
- main
12+
- dev
13+
14+
jobs:
15+
trigger-jenkins:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Set Jenkins job name based on branch
20+
id: jenkins_job_name
21+
run: |
22+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
23+
echo "job_name=backend" >> $GITHUB_ENV
24+
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
25+
echo "job_name=backend_dev" >> $GITHUB_ENV
26+
else
27+
echo "No Jenkins job to trigger for this branch."
28+
exit 0
29+
fi
30+
31+
- name: Trigger Jenkins job
32+
if: env.job_name != ''
33+
env:
34+
JENKINS_URL: ${{vars.JENKINS_URL}}
35+
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
36+
JOB_NAME: ${{ env.job_name }}
37+
run: |
38+
echo "Triggering Jenkins job $JOB_NAME"
39+
curl -X POST "$JENKINS_URL/buildByToken/build?job=$JOB_NAME&token=$JENKINS_TOKEN"
40+

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' } }],
4+
'@babel/preset-typescript',
5+
],
6+
};

compose.prod.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
services:
2+
mongo:
3+
image: mongo
4+
restart: unless-stopped
5+
environment:
6+
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER:-ROOT}
7+
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD:-1234}
8+
networks:
9+
- backend-net-prod
10+
healthcheck:
11+
test: ['CMD', 'mongosh', '--quiet', '--eval', "db.adminCommand('ping')"]
12+
interval: 20m
13+
timeout: 5s
14+
retries: 5
15+
start_period: 45s
16+
volumes:
17+
- mongo-data:/data/db
18+
19+
20+
backend:
21+
image: telware/backend-prod
22+
build:
23+
context: .
24+
dockerfile: prod.Dockerfile
25+
ports:
26+
- '${PORT:-3000}:3000'
27+
volumes:
28+
- /app/node_modules
29+
restart: unless-stopped
30+
depends_on:
31+
mongo:
32+
condition: service_healthy
33+
redis:
34+
condition: service_healthy
35+
networks:
36+
- backend-net-prod
37+
38+
redis:
39+
image: redis/redis-stack
40+
restart: unless-stopped
41+
networks:
42+
- backend-net-prod
43+
healthcheck:
44+
test: ["CMD", "redis-cli", "ping"]
45+
interval: 20m
46+
timeout: 5s
47+
retries: 5
48+
start_period: 45s
49+
50+
networks:
51+
backend-net-prod:
52+
53+
volumes:
54+
mongo-data:

compose.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ services:
33
image: mongo
44
restart: unless-stopped
55
environment:
6-
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER}
7-
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD}
6+
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER:-ROOT}
7+
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD:-1234}
88
networks:
99
- backend-net
1010
healthcheck:
@@ -13,6 +13,8 @@ services:
1313
timeout: 5s
1414
retries: 5
1515
start_period: 45s
16+
volumes:
17+
- mongo-data:/data/db
1618
# Uncomment Only If You Want To access the mongodb instance from your machine
1719
# ports:
1820
# - 27017:27017
@@ -73,3 +75,6 @@ services:
7375

7476
networks:
7577
backend-net:
78+
79+
volumes:
80+
mongo-data:

coverage/clover.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<coverage generated="1730741278728" clover="3.2.0">
3+
<project timestamp="1730741278728" name="All files">
4+
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
5+
</project>
6+
</coverage>

coverage/coverage-final.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)