Skip to content

Commit 2c9d32f

Browse files
committed
Update
1 parent 827e7cc commit 2c9d32f

File tree

55 files changed

+2062
-265
lines changed

Some content is hidden

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

55 files changed

+2062
-265
lines changed

.env.sample

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
11
POSTGRES_SCHEMA="public"
22
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=${POSTGRES_SCHEMA}"
33

4+
5+
# Gitea Webhook Configuration
6+
GITEA_WEBHOOK_AUTH="your_webhook_secret_here"
7+
8+
# Kafka Configuration
9+
KAFKA_BROKERS=localhost:9092
10+
KAFKA_CLIENT_ID=tc-review-api
11+
KAFKA_GROUP_ID=tc-review-consumer-group
12+
KAFKA_SSL_ENABLED=false
13+
14+
# SASL Configuration (optional - uncomment if needed)
15+
# KAFKA_SASL_MECHANISM=plain
16+
# KAFKA_SASL_USERNAME=
17+
# KAFKA_SASL_PASSWORD=
18+
19+
# Consumer Configuration
20+
KAFKA_SESSION_TIMEOUT=30000
21+
KAFKA_HEARTBEAT_INTERVAL=3000
22+
KAFKA_MAX_WAIT_TIME=5000
23+
KAFKA_CONNECTION_TIMEOUT=10000
24+
KAFKA_REQUEST_TIMEOUT=30000
25+
26+
# Retry Configuration
27+
KAFKA_RETRY_ATTEMPTS=5
28+
KAFKA_INITIAL_RETRY_TIME=100
29+
KAFKA_MAX_RETRY_TIME=30000
30+
31+
# Dead Letter Queue Configuration
32+
KAFKA_DLQ_ENABLED=true
33+
KAFKA_DLQ_TOPIC_SUFFIX=.dlq
34+
KAFKA_DLQ_MAX_RETRIES=3
35+
436
# API configs
537
BUS_API_URL="https://api.topcoder-dev.com/v5/bus/events"
638
CHALLENGE_API_URL="https://api.topcoder-dev.com/v5/challenges/"
39+
RESOURCE_API_URL="https://api.topcoder-dev.com/v6/"
740
MEMBER_API_URL="https://api.topcoder-dev.com/v5/members"
841
# M2m configs
942
M2M_AUTH_URL="https://auth0.topcoder-dev.com/oauth/token"

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ WORKDIR /app
1515
COPY . .
1616
RUN npm install pnpm -g
1717
RUN pnpm install
18+
RUN pnpm run lint
1819
RUN pnpm run build
1920
RUN chmod +x appStartUp.sh
2021
CMD ./appStartUp.sh

docker-compose.kafka.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
services:
2+
zookeeper:
3+
image: confluentinc/cp-zookeeper:7.4.0
4+
hostname: zookeeper
5+
container_name: zookeeper
6+
ports:
7+
- "2181:2181"
8+
environment:
9+
ZOOKEEPER_CLIENT_PORT: 2181
10+
ZOOKEEPER_TICK_TIME: 2000
11+
networks:
12+
- kafka-network
13+
14+
kafka:
15+
image: confluentinc/cp-kafka:7.4.0
16+
hostname: kafka
17+
container_name: kafka
18+
depends_on:
19+
- zookeeper
20+
ports:
21+
- "9092:9092"
22+
- "9101:9101"
23+
environment:
24+
KAFKA_BROKER_ID: 1
25+
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
26+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
27+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
28+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
29+
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
30+
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
31+
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
32+
KAFKA_JMX_PORT: 9101
33+
KAFKA_JMX_HOSTNAME: localhost
34+
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
35+
networks:
36+
- kafka-network
37+
38+
kafka-ui:
39+
image: provectuslabs/kafka-ui:latest
40+
container_name: kafka-ui
41+
depends_on:
42+
- kafka
43+
ports:
44+
- "8080:8080"
45+
environment:
46+
KAFKA_CLUSTERS_0_NAME: local
47+
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
48+
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
49+
networks:
50+
- kafka-network
51+
52+
networks:
53+
kafka-network:
54+
driver: bridge

0 commit comments

Comments
 (0)