Skip to content

Commit 32e7b2e

Browse files
Release v0.0.1
2 parents abbcda9 + 05e2f8d commit 32e7b2e

78 files changed

Lines changed: 12130 additions & 2 deletions

Some content is hidden

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

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git
2+
.gitignore
3+
node_modules

.env.example

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
NODE_ENV=development-production
2+
ENV=docker-localhost
3+
PORT=3000
4+
MONGO_DB_DOCKER_URL=mongodb://{USER}:{PASSWORD}@mongo:27017/telwareDB?authSource=admin
5+
MONGO_DB_LOCALHOST_URL=mongodb://localhost:27017/telwareDB
6+
MONGO_DB_USER=ROOT
7+
MONGO_DB_PASSWORD=1234
8+
REDIS_DOCKER_URL=redis://redis:6379
9+
REDIS_LOCALHOST_URL=redis://localhost:6379
10+
11+
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
17+
18+
RECAPTCHA_SECRET=recaptcha-secret
19+
RECAPTCHA_SITE=recaptcha-site
20+
21+
TELWARE_EMAIL=telware@gmail.com
22+
TELWARE_PASSWORD=telware-password
23+
GMAIL_HOST=smtp.gmail.com
24+
25+
MAILTRAP_USERNAME=mailtrap-username
26+
MAILTRAP_PASSWORD=mailtrap-password
27+
MAILTRAP_HOST=smtp.mailtrap.io
28+
MAIL_PORT=587
29+
30+
VERIFICATION_CODE_EXPIRES_IN=10 #minutes
31+
RESET_TOKEN_EXPIRES_IN=10 #minutes
32+
33+
GOOGLE_CLIENT_ID=google-client-id
34+
GOOGLE_CLIENT_SECRET=google-client-secret

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"env": {
3+
"es2021": true,
4+
"browser": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "./tsconfig.json",
10+
"ecmaVersion": 2021,
11+
"sourceType": "module"
12+
},
13+
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
14+
"plugins": ["node", "prettier"],
15+
"rules": {
16+
"prettier/prettier": "off",
17+
"spaced-comment": "off",
18+
"no-console": "warn",
19+
"consistent-return": "off",
20+
"func-names": "off",
21+
"no-process-exit": "off",
22+
"no-param-reassign": "off",
23+
"no-underscore-dangle": "off",
24+
"import/extensions": "off",
25+
"class-methods-use-this": "off",
26+
"lines-between-class-members": "off",
27+
"prefer-destructuring": ["error", { "object": true, "array": false }],
28+
"no-unused-vars": [
29+
"error",
30+
{
31+
"argsIgnorePattern": "req|res|next|^_",
32+
"varsIgnorePattern": "req|res|next|^_"
33+
}
34+
],
35+
"node/no-missing-import": "off",
36+
"node/no-unsupported-features/es-syntax": [
37+
"error",
38+
{
39+
"version": ">=13.0.0",
40+
"ignores": ["modules"]
41+
}
42+
]
43+
},
44+
"settings": {
45+
"import/resolver": {
46+
"typescript": {
47+
"project": "./tsconfig.json"
48+
}
49+
}
50+
}
51+
}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**/node_modules/
2+
**/dist
3+
./src/public/
4+
.git
5+
npm-debug.log
6+
.coverage
7+
.coverage.*
8+
.env
9+
.aws
10+
OAuth
11+
public

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"bracketSpacing": true
8+
}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# telware-backend
2-
Backend Repo for TelWare
1+
# telware backend
2+
3+
Backend Repo for TelWare Messaging Platform

compose.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
services:
2+
mongo:
3+
image: mongo
4+
restart: unless-stopped
5+
environment:
6+
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER}
7+
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD}
8+
networks:
9+
- backend-net
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+
# Uncomment Only If You Want To access the mongodb instance from your machine
17+
# ports:
18+
# - 27017:27017
19+
20+
mongo-express:
21+
image: mongo-express
22+
restart: unless-stopped
23+
ports:
24+
- 8081:8081
25+
environment:
26+
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_DB_USER}
27+
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_DB_PASSWORD}
28+
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongo:27017/telwareDB?authSource=admin
29+
ME_CONFIG_BASICAUTH: 'false'
30+
networks:
31+
- backend-net
32+
depends_on:
33+
mongo:
34+
condition: service_healthy
35+
36+
backend:
37+
image: telware/backend
38+
build:
39+
context: .
40+
dockerfile: dev.Dockerfile
41+
ports:
42+
- '${PORT:-3000}:3000'
43+
volumes:
44+
- .:/app
45+
- /app/node_modules
46+
environment:
47+
- NODE_ENV=${NODE_ENV:-development}
48+
- PORT=${PORT:-3000}
49+
restart: unless-stopped
50+
depends_on:
51+
mongo:
52+
condition: service_healthy
53+
redis:
54+
condition: service_healthy
55+
networks:
56+
- backend-net
57+
58+
redis:
59+
image: redis/redis-stack
60+
restart: unless-stopped
61+
ports:
62+
- 6379:6379
63+
- 8001:8001
64+
networks:
65+
- backend-net
66+
healthcheck:
67+
test: ["CMD", "redis-cli", "ping"]
68+
interval: 20m
69+
timeout: 5s
70+
retries: 5
71+
start_period: 45s
72+
# TODO: Add some environment variables that might be used in production
73+
74+
networks:
75+
backend-net:

dev.Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:latest
2+
3+
RUN mkdir /app
4+
5+
WORKDIR /app
6+
7+
COPY package*.json ./
8+
9+
RUN npm install
10+
11+
COPY . .
12+
13+
EXPOSE 3000
14+
15+
CMD ["npm", "run", "dev"]
16+
17+
18+

0 commit comments

Comments
 (0)