Skip to content

Commit

Permalink
Updated to architecture v2.x (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramank775 authored Oct 19, 2021
1 parent 97064c0 commit 7267703
Show file tree
Hide file tree
Showing 48 changed files with 8,472 additions and 7,719 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.theia
.vscode
node_modules
deployment
docs
www
.env*
**.md
**.md
discovery_service.json
.gitpod.*
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
24 changes: 9 additions & 15 deletions .env.tmpl
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# KAFKA TOPIC
TOPIC_USER_CONNECTED=user-connected
TOPIC_USER_DISCONNECTED=user-disconnected
TOPIC_MESSAGE_SENT=message-sent
TOPIC_MESSAGE_SENT_FAILED=message-sent-failed
TOPIC_MESSAGE_SENT_ERROR=message-sent-err
TOPIC_USER_CONNECTION_STATE=user-connection-state
TOPIC_SEND_MESSAGE=send-message
TOPIC_NEW_MESSAGE=new-message
TOPIC_DB_MESSAGE=db-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
TOPIC_GATEWAY_MS_1=gateway-1
TOPIC_PERSISTENCE_MESSAGE_MS_1=persistence-message-1
PERSISTENCE_MESSAGE_MS_INITIAL=persistence-message

# KAFKA OPTIONS
Expand All @@ -22,16 +18,11 @@ KAFKA_SASL_USERNAME=
KAFKA_SASL_PASSWORD=

# KAFKA CONSUMER GROUP
CONSUMER_GROUP_PERSISTENCE_MESSAGE=db-message
CONSUMER_GROUP_MESSAGE_ROUTER=message-router
CONSUMER_GROUP_SESSION=session
CONSUMER_GROUP_MESSAGE_DELIVERY=message-delivery
CONSUMER_GROUP_GATEWAY=gateway
CONSUMER_GROUP_GROUP_MESSAGE_ROUTER=group-message-router

# SESSION MS OPTIONS
SESSION_MS_HOST=127.0.0.1
SESSION_MS_PORT=8001

# GROUP MS OPTIONS
GROUP_MS_JSON_HOST=127.0.0.1
GROUP_MS_JSON_PORT=8002
Expand All @@ -47,4 +38,7 @@ FIREBASE_ADMIN_CRED_JSON_PATH=
# s3
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET_NAME=
S3_BUCKET_NAME=

# Service Discovery
SERVICE_DISCOVERY_PATH=discovery_service.json
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": ["plugin:prettier/recommended"],
"env": {
"browser": true,
"es6": true,
"node": true
},
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ dist
.yarn/install-state.gz
.pnp.*

kafka
kafka
*.local.*
12 changes: 6 additions & 6 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM gitpod/workspace-mongodb

COPY config/load.nginx.conf /etc/nginx/nginx.conf
COPY deployment/dev/config/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/2.5.0/kafka_2.12-2.5.0.tgz && \
tar xzf kafka_2.12-2.5.0.tgz && \
sudo mv kafka_2.12-2.5.0 /kafka && \
rm kafka_2.12-2.5.0.tgz && \
ls
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"
8 changes: 7 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

image:
file: .gitpod.Dockerfile
context: deployment/dev

ports:
- port: 8080
Expand All @@ -18,3 +18,9 @@ tasks:
command: nginx
- name: mongodb
command: mkdir -p /workspace/data && mongod --dbpath /workspace/data
- name: redis
command: redis-server

vscode:
extensions:
- editorconfig.editorconfig
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 180,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true
}
188 changes: 0 additions & 188 deletions .theia/launch.json

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"editorconfig.editorconfig"
]
}
Loading

0 comments on commit 7267703

Please sign in to comment.