-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename topic arguments to be agnostic to broker * added eslint and husky pre commit rule * upgrade dependencies * ci: 👷 Added github action to run linting on each commit * migrated to common event store interface * updated readme
- Loading branch information
Showing
58 changed files
with
3,754 additions
and
1,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env" | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
{ | ||
"extends": ["plugin:prettier/recommended"], | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"plugins": ["prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error" | ||
} | ||
"parser": "@babel/eslint-parser", | ||
"extends": [ | ||
"airbnb", | ||
"prettier", | ||
"plugin:node/recommended" | ||
], | ||
"plugins": [ | ||
"prettier" | ||
], | ||
"env": { | ||
"node": true, | ||
"es2021": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-console": "warn", | ||
"consistent-return": "off", | ||
"no-process-exit": "off", | ||
"no-param-reassign": "off", | ||
"no-return-await": "off", | ||
"no-underscore-dangle": "off", | ||
"prefer-destructuring": [ | ||
"error", | ||
{ | ||
"object": true, | ||
"array": false | ||
} | ||
], | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"ignoreRestSiblings": true, | ||
"argsIgnorePattern": "^_" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Linting" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Run liniting | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,5 +115,8 @@ dist | |
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# Redis dump file | ||
*.rdb | ||
|
||
kafka | ||
*.local.* | ||
*.local.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
|
||
image: | ||
file: .gitpod.Dockerfile | ||
file: .gitpod/Dockerfile | ||
|
||
ports: | ||
- port: 8080 | ||
onOpen: open-browser | ||
|
||
tasks: | ||
- init: yarn install | ||
- name: Kafka | ||
- name: Kafka | ||
init: chmod +x deployment/scripts/*.bash && ./deployment/scripts/setup.bash | ||
command: > | ||
chmod +x deployment/dev/scripts/init-kafka.bash && | ||
cp .env.tmpl .env && | ||
KAFKA_HOME=/kafka && | ||
./deployment/dev/scripts/init-kafka.bash $KAFKA_HOME .env | ||
./deployment/scripts/init-kafka.bash $KAFKA_HOME .env | ||
- name: Nginx | ||
command: nginx | ||
command: export NGINX_DOCROOT="${GITPOD_REPO_ROOT}/www" && nginx | ||
- name: mongodb | ||
command: mkdir -p /workspace/data && mongod --dbpath /workspace/data | ||
- name: redis | ||
command: redis-server | ||
|
||
|
||
vscode: | ||
extensions: | ||
- editorconfig.editorconfig | ||
- dbaeumer.vscode-eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
FROM gitpod/workspace-mongodb | ||
|
||
COPY ./deployment/dev/config/load.nginx.conf /etc/nginx/nginx.conf | ||
COPY .gitpod/load.nginx.conf /etc/nginx/nginx.conf | ||
|
||
RUN sudo apt-get update && sudo apt-get install redis-server -y | ||
|
||
RUN wget https://downloads.apache.org/kafka/3.0.0/kafka_2.13-3.0.0.tgz && \ | ||
tar xzf kafka_2.13-3.0.0.tgz && \ | ||
sudo mv kafka_2.13-3.0.0 /kafka && \ | ||
rm kafka_2.13-3.0.0.tgz | ||
|
||
ENV NGINX_DOCROOT_IN_REPO="www" |
4 changes: 2 additions & 2 deletions
4
deployment/dev/config/load.nginx.conf → .gitpod/load.nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This is file will load the main nginx.conf from this directory, This is done as workaround to enable editing of nginx.conf while working | ||
# as gitpod doesn't allow you to edit nginx.conf once it pushed into the /var/nginx/nginx.conf | ||
|
||
include /workspace/chat-server/deployment/dev/config/nginx.conf; | ||
env GITPOD_REPO_ROOT; | ||
include /workspace/chat-server/deployment/config/nginx/nginx.dev.conf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Infra | ||
STAGE=dev | ||
CHAT_SERVER_TAG=v2.2.6 | ||
CONFIG_DIR=./config | ||
|
||
# KAFKA TOPIC | ||
TOPIC_USER_CONNECTION_STATE=user-connection-state | ||
TOPIC_SEND_MESSAGE=send-message | ||
TOPIC_NEW_MESSAGE=new-message | ||
TOPIC_OFFLINE_MESSAGE=offline-message | ||
TOPIC_NEW_GROUP_MS=new-group-message | ||
TOPIC_NEW_LOGIN=new-login | ||
TOPIC_ACK_MESSAGE=ack | ||
|
||
# CREATE TOPIC FOR NAMED SERVICE | ||
PERSISTENCE_MESSAGE_MS_INITIAL=persistence-message | ||
|
||
# KAFKA OPTIONS | ||
BROKER_LIST=localhost:9092 | ||
ZOOKEEPER_ENDPOINT=localhost:2181 | ||
KAFKA_SECURITY_PROTOCOL= | ||
KAFKA_SASL_USERNAME= | ||
KAFKA_SASL_PASSWORD= | ||
|
||
# KAFKA CONSUMER GROUP | ||
CONSUMER_GROUP_MESSAGE_ROUTER=message-router | ||
CONSUMER_GROUP_MESSAGE_DELIVERY=message-delivery | ||
CONSUMER_GROUP_GATEWAY=gateway | ||
CONSUMER_GROUP_GROUP_MESSAGE_ROUTER=group-message-router | ||
|
||
|
||
# MONGO URL | ||
MONGO_URL=mongodb://localhost:27017/chat | ||
MONGO_USER= | ||
MONGO_PASSWORD= | ||
|
||
# Redis | ||
REDIS_ENDPOINT=localhost:6379 | ||
|
||
# Firebase | ||
FIREBASE_PROJECT_ID=vartalap-bef91 | ||
|
||
# s3 | ||
S3_ACCESS_KEY_ID= | ||
S3_SECRET_ACCESS_KEY= | ||
S3_BUCKET_NAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.local.* |
Oops, something went wrong.